From c6d67daa813db9d7d85537df0554b0ff03d47ab1 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 22 May 2017 20:48:47 +0200 Subject: [PATCH] fix(conflict): use latest gen/ from origin/master that fixes a conflict when merging --- gen/adexchangebuyer1d3-cli/Cargo.toml | 6 +- gen/adexchangebuyer1d3-cli/README.md | 2 +- gen/adexchangebuyer1d3-cli/mkdocs.yml | 2 +- gen/adexchangebuyer1d3-cli/src/main.rs | 2 +- gen/adexchangebuyer1d3/Cargo.toml | 4 +- gen/adexchangebuyer1d3/README.md | 68 +- gen/adexchangebuyer1d3/src/lib.rs | 71 +- gen/adexchangebuyer1d4-cli/Cargo.toml | 6 +- gen/adexchangebuyer1d4-cli/README.md | 2 +- gen/adexchangebuyer1d4-cli/mkdocs.yml | 2 +- gen/adexchangebuyer1d4-cli/src/main.rs | 89 +- gen/adexchangebuyer1d4/Cargo.toml | 4 +- gen/adexchangebuyer1d4/README.md | 80 +- gen/adexchangebuyer1d4/src/lib.rs | 172 +- gen/adexchangeseller2-cli/Cargo.toml | 2 +- gen/adexchangeseller2/src/lib.rs | 55 +- gen/admin1_directory-cli/Cargo.toml | 6 +- gen/admin1_directory-cli/README.md | 2 +- gen/admin1_directory-cli/mkdocs.yml | 2 +- gen/admin1_directory-cli/src/main.rs | 136 +- gen/admin1_directory/Cargo.toml | 4 +- gen/admin1_directory/README.md | 114 +- gen/admin1_directory/src/lib.rs | 673 +- gen/admin1_reports-cli/Cargo.toml | 6 +- gen/admin1_reports-cli/README.md | 2 +- gen/admin1_reports-cli/mkdocs.yml | 2 +- gen/admin1_reports-cli/src/main.rs | 4 +- gen/admin1_reports/Cargo.toml | 4 +- gen/admin1_reports/README.md | 56 +- gen/admin1_reports/src/lib.rs | 51 +- gen/adsense1d4-cli/Cargo.toml | 6 +- 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 | 105 +- gen/adsensehost4d1-cli/Cargo.toml | 6 +- 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 | 81 +- gen/analytics3-cli/Cargo.toml | 6 +- gen/analytics3-cli/README.md | 3 +- gen/analytics3-cli/mkdocs.yml | 3 +- gen/analytics3-cli/src/main.rs | 79 +- gen/analytics3/Cargo.toml | 4 +- gen/analytics3/README.md | 50 +- gen/analytics3/src/lib.rs | 690 +- gen/androidenterprise1-cli/Cargo.toml | 6 +- gen/androidenterprise1-cli/README.md | 16 +- gen/androidenterprise1-cli/mkdocs.yml | 14 +- gen/androidenterprise1-cli/src/main.rs | 1298 +- gen/androidenterprise1/Cargo.toml | 4 +- gen/androidenterprise1/README.md | 86 +- gen/androidenterprise1/src/lib.rs | 18990 +++++++--------- gen/androidpublisher2-cli/Cargo.toml | 6 +- gen/androidpublisher2-cli/README.md | 2 +- gen/androidpublisher2-cli/mkdocs.yml | 2 +- gen/androidpublisher2-cli/src/main.rs | 4 +- gen/androidpublisher2/Cargo.toml | 4 +- gen/androidpublisher2/README.md | 62 +- gen/androidpublisher2/src/lib.rs | 170 +- gen/appengine1-cli/Cargo.toml | 6 +- gen/appengine1-cli/README.md | 2 +- gen/appengine1-cli/mkdocs.yml | 2 +- gen/appengine1-cli/src/main.rs | 118 +- gen/appengine1/Cargo.toml | 4 +- gen/appengine1/README.md | 42 +- gen/appengine1/src/lib.rs | 460 +- gen/appengine1_beta4-cli/Cargo.toml | 6 +- gen/appengine1_beta4-cli/README.md | 2 +- gen/appengine1_beta4-cli/mkdocs.yml | 2 +- gen/appengine1_beta4-cli/src/main.rs | 78 +- gen/appengine1_beta4/Cargo.toml | 4 +- gen/appengine1_beta4/README.md | 42 +- gen/appengine1_beta4/src/lib.rs | 576 +- gen/appengine1_beta5-cli/Cargo.toml | 6 +- gen/appengine1_beta5-cli/README.md | 2 +- gen/appengine1_beta5-cli/mkdocs.yml | 2 +- gen/appengine1_beta5-cli/src/main.rs | 86 +- gen/appengine1_beta5/Cargo.toml | 4 +- gen/appengine1_beta5/README.md | 42 +- gen/appengine1_beta5/src/lib.rs | 469 +- gen/appsactivity1-cli/Cargo.toml | 6 +- 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 | 33 +- gen/appstate1-cli/Cargo.toml | 6 +- 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 | 39 +- gen/autoscaler1_beta2-cli/Cargo.toml | 2 +- gen/autoscaler1_beta2/src/lib.rs | 47 +- gen/bigquery2-cli/Cargo.toml | 6 +- gen/bigquery2-cli/README.md | 2 +- gen/bigquery2-cli/mkdocs.yml | 2 +- gen/bigquery2-cli/src/main.rs | 11 +- gen/bigquery2/Cargo.toml | 4 +- gen/bigquery2/README.md | 58 +- gen/bigquery2/src/lib.rs | 208 +- gen/blogger3-cli/Cargo.toml | 2 +- gen/blogger3/src/lib.rs | 93 +- gen/books1-cli/Cargo.toml | 6 +- gen/books1-cli/README.md | 2 +- gen/books1-cli/mkdocs.yml | 2 +- gen/books1-cli/src/main.rs | 10 +- gen/books1/Cargo.toml | 4 +- gen/books1/README.md | 68 +- gen/books1/src/lib.rs | 211 +- gen/calendar3-cli/Cargo.toml | 6 +- gen/calendar3-cli/README.md | 2 +- gen/calendar3-cli/mkdocs.yml | 2 +- gen/calendar3-cli/src/main.rs | 2 +- gen/calendar3/Cargo.toml | 4 +- gen/calendar3/README.md | 86 +- gen/calendar3/src/lib.rs | 379 +- gen/classroom1-cli/Cargo.toml | 6 +- gen/classroom1-cli/README.md | 4 +- gen/classroom1-cli/mkdocs.yml | 4 +- gen/classroom1-cli/src/main.rs | 1038 +- gen/classroom1/Cargo.toml | 4 +- gen/classroom1/README.md | 64 +- gen/classroom1/src/lib.rs | 5710 +++-- gen/cloudbilling1-cli/Cargo.toml | 6 +- gen/cloudbilling1-cli/README.md | 2 +- gen/cloudbilling1-cli/mkdocs.yml | 2 +- gen/cloudbilling1-cli/src/main.rs | 65 +- gen/cloudbilling1/Cargo.toml | 4 +- gen/cloudbilling1/README.md | 46 +- gen/cloudbilling1/src/lib.rs | 223 +- gen/clouddebugger2-cli/Cargo.toml | 6 +- gen/clouddebugger2-cli/README.md | 2 +- gen/clouddebugger2-cli/mkdocs.yml | 2 +- gen/clouddebugger2-cli/src/main.rs | 40 +- gen/clouddebugger2/Cargo.toml | 4 +- gen/clouddebugger2/README.md | 44 +- gen/clouddebugger2/src/lib.rs | 560 +- gen/cloudkms1_beta1-cli/Cargo.toml | 37 + gen/cloudkms1_beta1-cli/LICENSE.md | 30 + gen/cloudkms1_beta1-cli/README.md | 137 + gen/cloudkms1_beta1-cli/mkdocs.yml | 40 + gen/cloudkms1_beta1-cli/src/cmn.rs | 747 + gen/cloudkms1_beta1-cli/src/main.rs | 2789 +++ gen/cloudkms1_beta1/Cargo.toml | 28 + gen/cloudkms1_beta1/LICENSE.md | 30 + gen/cloudkms1_beta1/README.md | 184 + gen/cloudkms1_beta1/src/cmn.rs | 753 + gen/cloudkms1_beta1/src/lib.rs | 8276 +++++++ gen/cloudlatencytest2-cli/Cargo.toml | 2 +- gen/cloudlatencytest2/src/lib.rs | 31 +- gen/cloudmonitoring2_beta2-cli/Cargo.toml | 6 +- gen/cloudmonitoring2_beta2-cli/README.md | 2 +- gen/cloudmonitoring2_beta2-cli/mkdocs.yml | 2 +- gen/cloudmonitoring2_beta2-cli/src/main.rs | 2 +- gen/cloudmonitoring2_beta2/Cargo.toml | 4 +- gen/cloudmonitoring2_beta2/README.md | 50 +- gen/cloudmonitoring2_beta2/src/lib.rs | 41 +- gen/cloudresourcemanager1-cli/Cargo.toml | 6 +- gen/cloudresourcemanager1-cli/README.md | 25 +- gen/cloudresourcemanager1-cli/mkdocs.yml | 23 +- gen/cloudresourcemanager1-cli/src/main.rs | 2498 +- gen/cloudresourcemanager1/Cargo.toml | 4 +- gen/cloudresourcemanager1/README.md | 66 +- gen/cloudresourcemanager1/src/lib.rs | 11030 +++++++-- .../Cargo.toml | 6 +- gen/cloudresourcemanager1_beta1-cli/README.md | 2 +- .../mkdocs.yml | 2 +- .../src/main.rs | 43 +- gen/cloudresourcemanager1_beta1/Cargo.toml | 4 +- gen/cloudresourcemanager1_beta1/README.md | 48 +- gen/cloudresourcemanager1_beta1/src/lib.rs | 337 +- gen/clouduseraccountsvm_beta-cli/Cargo.toml | 2 +- gen/clouduseraccountsvm_beta/src/lib.rs | 61 +- gen/container1-cli/Cargo.toml | 6 +- gen/container1-cli/README.md | 10 +- gen/container1-cli/mkdocs.yml | 10 +- gen/container1-cli/src/main.rs | 1239 +- gen/container1/Cargo.toml | 4 +- gen/container1/README.md | 61 +- gen/container1/src/lib.rs | 4538 +++- gen/content2-cli/Cargo.toml | 6 +- gen/content2-cli/README.md | 9 +- gen/content2-cli/mkdocs.yml | 8 +- gen/content2-cli/src/main.rs | 657 +- gen/content2/Cargo.toml | 4 +- gen/content2/README.md | 72 +- gen/content2/src/lib.rs | 3945 +--- gen/content2_sandbox-cli/Cargo.toml | 6 +- gen/content2_sandbox-cli/README.md | 2 +- gen/content2_sandbox-cli/mkdocs.yml | 2 +- gen/content2_sandbox-cli/src/main.rs | 6 +- gen/content2_sandbox/Cargo.toml | 4 +- gen/content2_sandbox/README.md | 44 +- gen/content2_sandbox/src/lib.rs | 67 +- gen/coordinate1-cli/Cargo.toml | 2 +- gen/coordinate1/src/lib.rs | 51 +- gen/customsearch1-cli/Cargo.toml | 2 +- gen/customsearch1/src/lib.rs | 29 +- gen/dataproc1-cli/Cargo.toml | 6 +- gen/dataproc1-cli/README.md | 3 +- gen/dataproc1-cli/mkdocs.yml | 3 +- gen/dataproc1-cli/src/main.rs | 326 +- gen/dataproc1/Cargo.toml | 4 +- gen/dataproc1/README.md | 42 +- gen/dataproc1/src/lib.rs | 965 +- gen/deploymentmanager2-cli/Cargo.toml | 6 +- gen/deploymentmanager2-cli/README.md | 2 +- gen/deploymentmanager2-cli/mkdocs.yml | 2 +- gen/deploymentmanager2-cli/src/main.rs | 5 +- gen/deploymentmanager2/Cargo.toml | 4 +- gen/deploymentmanager2/README.md | 60 +- gen/deploymentmanager2/src/lib.rs | 107 +- gen/deploymentmanager2_beta2-cli/Cargo.toml | 2 +- gen/deploymentmanager2_beta2/src/lib.rs | 53 +- gen/dfareporting2d1-cli/Cargo.toml | 2 +- gen/dfareporting2d1/src/lib.rs | 415 +- gen/dfareporting2d2-cli/Cargo.toml | 2 +- gen/dfareporting2d2/src/lib.rs | 415 +- gen/dfareporting2d3-cli/Cargo.toml | 2 +- gen/dfareporting2d3/src/lib.rs | 413 +- gen/dfareporting2d4-cli/Cargo.toml | 2 +- gen/dfareporting2d4/src/lib.rs | 413 +- gen/dfareporting2d5-cli/Cargo.toml | 6 +- gen/dfareporting2d5-cli/README.md | 2 +- gen/dfareporting2d5-cli/mkdocs.yml | 2 +- gen/dfareporting2d5-cli/src/main.rs | 2 +- gen/dfareporting2d5/Cargo.toml | 4 +- gen/dfareporting2d5/README.md | 274 +- gen/dfareporting2d5/src/lib.rs | 552 +- gen/dfareporting2d6-cli/Cargo.toml | 6 +- gen/dfareporting2d6-cli/README.md | 2 +- gen/dfareporting2d6-cli/mkdocs.yml | 2 +- gen/dfareporting2d6-cli/src/main.rs | 2 +- gen/dfareporting2d6/Cargo.toml | 4 +- gen/dfareporting2d6/README.md | 282 +- gen/dfareporting2d6/src/lib.rs | 566 +- gen/dfareporting2d7-cli/Cargo.toml | 6 +- gen/dfareporting2d7-cli/README.md | 2 +- gen/dfareporting2d7-cli/mkdocs.yml | 2 +- gen/dfareporting2d7-cli/src/main.rs | 6 +- gen/dfareporting2d7/Cargo.toml | 4 +- gen/dfareporting2d7/README.md | 286 +- gen/dfareporting2d7/src/lib.rs | 592 +- gen/discovery1-cli/Cargo.toml | 2 +- gen/discovery1/src/lib.rs | 31 +- gen/dns1-cli/Cargo.toml | 6 +- 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 | 47 +- gen/doubleclickbidmanager1-cli/Cargo.toml | 6 +- gen/doubleclickbidmanager1-cli/README.md | 6 +- gen/doubleclickbidmanager1-cli/mkdocs.yml | 2 +- gen/doubleclickbidmanager1-cli/src/main.rs | 34 +- gen/doubleclickbidmanager1/Cargo.toml | 4 +- gen/doubleclickbidmanager1/README.md | 52 +- gen/doubleclickbidmanager1/src/lib.rs | 484 +- gen/doubleclicksearch2-cli/Cargo.toml | 6 +- 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 | 52 +- gen/drive2-cli/Cargo.toml | 6 +- gen/drive2-cli/README.md | 9 +- gen/drive2-cli/mkdocs.yml | 8 +- gen/drive2-cli/src/main.rs | 954 +- gen/drive2/Cargo.toml | 4 +- gen/drive2/README.md | 125 +- gen/drive2/src/lib.rs | 5194 +++-- gen/drive3-cli/Cargo.toml | 6 +- gen/drive3-cli/README.md | 8 +- gen/drive3-cli/mkdocs.yml | 7 +- gen/drive3-cli/src/main.rs | 712 +- gen/drive3/Cargo.toml | 4 +- gen/drive3/README.md | 124 +- gen/drive3/src/lib.rs | 5269 +++-- gen/firebasedynamiclinks1-cli/Cargo.toml | 6 +- gen/firebasedynamiclinks1-cli/README.md | 2 +- gen/firebasedynamiclinks1-cli/mkdocs.yml | 2 +- gen/firebasedynamiclinks1-cli/src/main.rs | 7 +- gen/firebasedynamiclinks1/Cargo.toml | 4 +- gen/firebasedynamiclinks1/README.md | 42 +- gen/firebasedynamiclinks1/src/lib.rs | 69 +- gen/fitness1-cli/Cargo.toml | 2 +- gen/fitness1/src/lib.rs | 53 +- gen/fusiontables2-cli/Cargo.toml | 6 +- gen/fusiontables2-cli/README.md | 2 +- gen/fusiontables2-cli/mkdocs.yml | 2 +- gen/fusiontables2-cli/src/main.rs | 2 +- gen/fusiontables2/Cargo.toml | 4 +- gen/fusiontables2/README.md | 70 +- gen/fusiontables2/src/lib.rs | 101 +- gen/games1-cli/Cargo.toml | 6 +- 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 | 135 +- .../Cargo.toml | 6 +- .../README.md | 2 +- .../mkdocs.yml | 2 +- .../src/main.rs | 2 +- .../Cargo.toml | 4 +- .../README.md | 54 +- .../src/lib.rs | 57 +- .../Cargo.toml | 6 +- 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 | 83 +- gen/gan1_beta1-cli/Cargo.toml | 2 +- gen/gan1_beta1/src/lib.rs | 47 +- gen/genomics1-cli/Cargo.toml | 8 +- gen/genomics1-cli/README.md | 6 +- gen/genomics1-cli/mkdocs.yml | 4 +- gen/genomics1-cli/src/main.rs | 852 +- gen/genomics1/Cargo.toml | 6 +- gen/genomics1/README.md | 76 +- gen/genomics1/src/lib.rs | 4383 ++-- gen/gmail1-cli/Cargo.toml | 6 +- gen/gmail1-cli/README.md | 7 +- gen/gmail1-cli/mkdocs.yml | 7 +- gen/gmail1-cli/src/main.rs | 491 +- gen/gmail1/Cargo.toml | 4 +- gen/gmail1/README.md | 54 +- gen/gmail1/src/lib.rs | 2316 +- gen/groupsmigration1-cli/Cargo.toml | 2 +- gen/groupsmigration1/src/lib.rs | 31 +- gen/groupssettings1-cli/Cargo.toml | 2 +- gen/groupssettings1/src/lib.rs | 35 +- gen/iam1-cli/Cargo.toml | 6 +- gen/iam1-cli/README.md | 3 +- gen/iam1-cli/mkdocs.yml | 3 +- gen/iam1-cli/src/main.rs | 234 +- gen/iam1/Cargo.toml | 4 +- gen/iam1/README.md | 46 +- gen/iam1/src/lib.rs | 906 +- gen/identitytoolkit3-cli/Cargo.toml | 6 +- gen/identitytoolkit3-cli/README.md | 2 +- gen/identitytoolkit3-cli/mkdocs.yml | 2 +- gen/identitytoolkit3-cli/src/main.rs | 23 +- gen/identitytoolkit3/Cargo.toml | 4 +- gen/identitytoolkit3/README.md | 44 +- gen/identitytoolkit3/src/lib.rs | 122 +- gen/kgsearch1-cli/Cargo.toml | 6 +- gen/kgsearch1-cli/README.md | 2 +- gen/kgsearch1-cli/mkdocs.yml | 2 +- gen/kgsearch1-cli/src/main.rs | 8 +- gen/kgsearch1/Cargo.toml | 4 +- gen/kgsearch1/README.md | 42 +- gen/kgsearch1/src/lib.rs | 65 +- gen/licensing1-cli/Cargo.toml | 6 +- gen/licensing1-cli/README.md | 2 +- gen/licensing1-cli/mkdocs.yml | 2 +- gen/licensing1-cli/src/main.rs | 12 +- gen/licensing1/Cargo.toml | 4 +- gen/licensing1/README.md | 44 +- gen/licensing1/src/lib.rs | 59 +- gen/logging2-cli/Cargo.toml | 6 +- gen/logging2-cli/README.md | 2 +- gen/logging2-cli/mkdocs.yml | 2 +- gen/logging2-cli/src/main.rs | 140 +- gen/logging2/Cargo.toml | 4 +- gen/logging2/README.md | 54 +- gen/logging2/src/lib.rs | 432 +- gen/logging2_beta1-cli/Cargo.toml | 6 +- gen/logging2_beta1-cli/README.md | 2 +- gen/logging2_beta1-cli/mkdocs.yml | 2 +- gen/logging2_beta1-cli/src/main.rs | 57 +- gen/logging2_beta1/Cargo.toml | 4 +- gen/logging2_beta1/README.md | 52 +- gen/logging2_beta1/src/lib.rs | 992 +- gen/manager1_beta2-cli/Cargo.toml | 2 +- gen/manager1_beta2/src/lib.rs | 43 +- gen/manufacturers1-cli/Cargo.toml | 6 +- gen/manufacturers1-cli/README.md | 2 +- gen/manufacturers1-cli/mkdocs.yml | 2 +- gen/manufacturers1-cli/src/main.rs | 2 +- gen/manufacturers1/Cargo.toml | 4 +- gen/manufacturers1/README.md | 42 +- gen/manufacturers1/src/lib.rs | 363 +- gen/mirror1-cli/Cargo.toml | 6 +- gen/mirror1-cli/README.md | 2 +- gen/mirror1-cli/mkdocs.yml | 2 +- gen/mirror1-cli/src/main.rs | 2 +- gen/mirror1/Cargo.toml | 4 +- gen/mirror1/README.md | 70 +- gen/mirror1/src/lib.rs | 83 +- gen/ml1_beta1-cli/Cargo.toml | 8 +- gen/ml1_beta1-cli/README.md | 6 +- gen/ml1_beta1-cli/mkdocs.yml | 4 +- gen/ml1_beta1-cli/src/main.rs | 109 +- gen/ml1_beta1/Cargo.toml | 6 +- gen/ml1_beta1/README.md | 54 +- gen/ml1_beta1/src/lib.rs | 1076 +- gen/monitoring3-cli/Cargo.toml | 6 +- gen/monitoring3-cli/README.md | 2 +- gen/monitoring3-cli/mkdocs.yml | 2 +- gen/monitoring3-cli/src/main.rs | 2 +- gen/monitoring3/Cargo.toml | 4 +- gen/monitoring3/README.md | 42 +- gen/monitoring3/src/lib.rs | 187 +- gen/pagespeedonline2-cli/Cargo.toml | 2 +- gen/pagespeedonline2/src/lib.rs | 29 +- gen/partners2-cli/Cargo.toml | 8 +- gen/partners2-cli/README.md | 24 +- gen/partners2-cli/mkdocs.yml | 16 +- gen/partners2-cli/src/main.rs | 1498 +- gen/partners2/Cargo.toml | 6 +- gen/partners2/README.md | 87 +- gen/partners2/src/lib.rs | 6098 ++++- gen/people1-cli/Cargo.toml | 8 +- gen/people1-cli/README.md | 6 +- gen/people1-cli/mkdocs.yml | 4 +- gen/people1-cli/src/main.rs | 30 +- gen/people1/Cargo.toml | 6 +- gen/people1/README.md | 50 +- gen/people1/src/lib.rs | 712 +- gen/playmoviespartner1-cli/Cargo.toml | 6 +- gen/playmoviespartner1-cli/README.md | 6 +- gen/playmoviespartner1-cli/mkdocs.yml | 6 +- gen/playmoviespartner1-cli/src/main.rs | 426 +- gen/playmoviespartner1/Cargo.toml | 4 +- gen/playmoviespartner1/README.md | 42 +- gen/playmoviespartner1/src/lib.rs | 2158 +- gen/plus1-cli/Cargo.toml | 6 +- 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 | 47 +- gen/plusdomains1-cli/Cargo.toml | 6 +- 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 | 71 +- gen/prediction1d6-cli/Cargo.toml | 2 +- gen/prediction1d6/src/lib.rs | 43 +- gen/proximitybeacon1_beta1-cli/Cargo.toml | 6 +- gen/proximitybeacon1_beta1-cli/README.md | 3 +- gen/proximitybeacon1_beta1-cli/mkdocs.yml | 3 +- gen/proximitybeacon1_beta1-cli/src/main.rs | 325 +- gen/proximitybeacon1_beta1/Cargo.toml | 4 +- gen/proximitybeacon1_beta1/README.md | 53 +- gen/proximitybeacon1_beta1/src/lib.rs | 1590 +- gen/pubsub1-cli/Cargo.toml | 8 +- gen/pubsub1-cli/README.md | 6 +- gen/pubsub1-cli/mkdocs.yml | 4 +- gen/pubsub1-cli/src/main.rs | 53 +- gen/pubsub1/Cargo.toml | 6 +- gen/pubsub1/README.md | 46 +- gen/pubsub1/src/lib.rs | 189 +- gen/pubsub1_beta2-cli/Cargo.toml | 8 +- gen/pubsub1_beta2-cli/README.md | 6 +- gen/pubsub1_beta2-cli/mkdocs.yml | 4 +- gen/pubsub1_beta2-cli/src/main.rs | 38 +- gen/pubsub1_beta2/Cargo.toml | 6 +- gen/pubsub1_beta2/README.md | 46 +- gen/pubsub1_beta2/src/lib.rs | 227 +- gen/qpxexpress1-cli/Cargo.toml | 2 +- gen/qpxexpress1/src/lib.rs | 29 +- gen/replicapool1_beta2-cli/Cargo.toml | 2 +- gen/replicapool1_beta2/src/lib.rs | 51 +- gen/replicapoolupdater1_beta1-cli/Cargo.toml | 2 +- gen/replicapoolupdater1_beta1/src/lib.rs | 47 +- gen/reseller1_sandbox-cli/Cargo.toml | 2 +- gen/reseller1_sandbox/src/lib.rs | 55 +- gen/resourceviews1_beta2-cli/Cargo.toml | 2 +- gen/resourceviews1_beta2/src/lib.rs | 49 +- gen/safebrowsing4-cli/Cargo.toml | 6 +- gen/safebrowsing4-cli/README.md | 6 +- gen/safebrowsing4-cli/mkdocs.yml | 4 +- gen/safebrowsing4-cli/src/main.rs | 195 +- gen/safebrowsing4/Cargo.toml | 4 +- gen/safebrowsing4/README.md | 63 +- gen/safebrowsing4/src/lib.rs | 1978 +- gen/searchconsole1-cli/Cargo.toml | 37 + gen/searchconsole1-cli/LICENSE.md | 30 + gen/searchconsole1-cli/README.md | 110 + gen/searchconsole1-cli/mkdocs.yml | 17 + gen/searchconsole1-cli/src/cmn.rs | 747 + gen/searchconsole1-cli/src/main.rs | 351 + gen/searchconsole1/Cargo.toml | 28 + gen/searchconsole1/LICENSE.md | 30 + gen/searchconsole1/README.md | 179 + gen/searchconsole1/src/cmn.rs | 753 + gen/searchconsole1/src/lib.rs | 731 + gen/serviceregistryalpha-cli/Cargo.toml | 2 +- gen/serviceregistryalpha/src/lib.rs | 43 +- gen/siteverification1-cli/Cargo.toml | 6 +- gen/siteverification1-cli/README.md | 2 +- gen/siteverification1-cli/mkdocs.yml | 2 +- gen/siteverification1-cli/src/main.rs | 2 +- gen/siteverification1/Cargo.toml | 4 +- gen/siteverification1/README.md | 42 +- gen/siteverification1/src/lib.rs | 43 +- gen/slides1-cli/Cargo.toml | 6 +- gen/slides1/Cargo.toml | 4 +- gen/slides1/README.md | 55 +- gen/slides1/src/lib.rs | 1116 +- gen/spectrum1_explorer-cli/Cargo.toml | 6 +- gen/spectrum1_explorer-cli/README.md | 2 +- gen/spectrum1_explorer-cli/mkdocs.yml | 2 +- gen/spectrum1_explorer-cli/src/main.rs | 2 +- gen/spectrum1_explorer/Cargo.toml | 4 +- gen/spectrum1_explorer/README.md | 42 +- gen/spectrum1_explorer/src/lib.rs | 41 +- gen/sqladmin1_beta4-cli/Cargo.toml | 6 +- gen/sqladmin1_beta4-cli/README.md | 4 +- gen/sqladmin1_beta4-cli/mkdocs.yml | 2 +- gen/sqladmin1_beta4-cli/src/main.rs | 67 +- gen/sqladmin1_beta4/Cargo.toml | 4 +- gen/sqladmin1_beta4/README.md | 70 +- gen/sqladmin1_beta4/src/lib.rs | 266 +- gen/storage1-cli/Cargo.toml | 6 +- gen/storage1-cli/README.md | 15 +- gen/storage1-cli/mkdocs.yml | 13 +- gen/storage1-cli/src/main.rs | 1254 +- gen/storage1/Cargo.toml | 4 +- gen/storage1/README.md | 112 +- gen/storage1/src/lib.rs | 7443 ++++-- gen/storagetransfer1-cli/Cargo.toml | 6 +- gen/storagetransfer1-cli/README.md | 4 +- gen/storagetransfer1-cli/mkdocs.yml | 3 +- gen/storagetransfer1-cli/src/main.rs | 147 +- gen/storagetransfer1/Cargo.toml | 4 +- gen/storagetransfer1/README.md | 55 +- gen/storagetransfer1/src/lib.rs | 1920 +- gen/surveys2-cli/Cargo.toml | 6 +- gen/surveys2-cli/README.md | 2 +- gen/surveys2-cli/mkdocs.yml | 2 +- gen/surveys2-cli/src/main.rs | 2 +- gen/surveys2/Cargo.toml | 4 +- gen/surveys2/README.md | 50 +- gen/surveys2/src/lib.rs | 55 +- gen/tagmanager1-cli/Cargo.toml | 2 +- gen/tagmanager1/src/lib.rs | 127 +- gen/taskqueue1_beta2-cli/Cargo.toml | 2 +- gen/taskqueue1_beta2/src/lib.rs | 43 +- gen/tasks1-cli/Cargo.toml | 2 +- gen/tasks1/src/lib.rs | 55 +- gen/translate2-cli/Cargo.toml | 2 +- gen/translate2/src/lib.rs | 33 +- gen/urlshortener1-cli/Cargo.toml | 2 +- gen/urlshortener1/src/lib.rs | 33 +- gen/webfonts1-cli/Cargo.toml | 2 +- gen/webfonts1/src/lib.rs | 29 +- gen/webmasters3-cli/Cargo.toml | 6 +- gen/webmasters3-cli/README.md | 2 +- gen/webmasters3-cli/mkdocs.yml | 2 +- gen/webmasters3-cli/src/main.rs | 2 +- gen/webmasters3/Cargo.toml | 4 +- gen/webmasters3/README.md | 50 +- gen/webmasters3/src/lib.rs | 55 +- gen/youtube3-cli/Cargo.toml | 6 +- gen/youtube3-cli/README.md | 4 +- gen/youtube3-cli/mkdocs.yml | 3 +- gen/youtube3-cli/src/main.rs | 116 +- gen/youtube3/Cargo.toml | 4 +- gen/youtube3/README.md | 156 +- gen/youtube3/src/lib.rs | 1547 +- gen/youtubeanalytics1-cli/Cargo.toml | 6 +- gen/youtubeanalytics1-cli/README.md | 2 +- gen/youtubeanalytics1-cli/mkdocs.yml | 2 +- gen/youtubeanalytics1-cli/src/main.rs | 7 +- gen/youtubeanalytics1/Cargo.toml | 4 +- gen/youtubeanalytics1/README.md | 50 +- gen/youtubeanalytics1/src/lib.rs | 84 +- gen/youtubereporting1-cli/Cargo.toml | 6 +- gen/youtubereporting1-cli/README.md | 2 +- gen/youtubereporting1-cli/mkdocs.yml | 2 +- gen/youtubereporting1-cli/src/main.rs | 11 +- gen/youtubereporting1/Cargo.toml | 4 +- gen/youtubereporting1/README.md | 54 +- gen/youtubereporting1/src/lib.rs | 204 +- 594 files changed, 96349 insertions(+), 45763 deletions(-) create mode 100644 gen/cloudkms1_beta1-cli/Cargo.toml create mode 100644 gen/cloudkms1_beta1-cli/LICENSE.md create mode 100644 gen/cloudkms1_beta1-cli/README.md create mode 100644 gen/cloudkms1_beta1-cli/mkdocs.yml create mode 100644 gen/cloudkms1_beta1-cli/src/cmn.rs create mode 100644 gen/cloudkms1_beta1-cli/src/main.rs create mode 100644 gen/cloudkms1_beta1/Cargo.toml create mode 100644 gen/cloudkms1_beta1/LICENSE.md create mode 100644 gen/cloudkms1_beta1/README.md create mode 100644 gen/cloudkms1_beta1/src/cmn.rs create mode 100644 gen/cloudkms1_beta1/src/lib.rs create mode 100644 gen/searchconsole1-cli/Cargo.toml create mode 100644 gen/searchconsole1-cli/LICENSE.md create mode 100644 gen/searchconsole1-cli/README.md create mode 100644 gen/searchconsole1-cli/mkdocs.yml create mode 100644 gen/searchconsole1-cli/src/cmn.rs create mode 100644 gen/searchconsole1-cli/src/main.rs create mode 100644 gen/searchconsole1/Cargo.toml create mode 100644 gen/searchconsole1/LICENSE.md create mode 100644 gen/searchconsole1/README.md create mode 100644 gen/searchconsole1/src/cmn.rs create mode 100644 gen/searchconsole1/src/lib.rs diff --git a/gen/adexchangebuyer1d3-cli/Cargo.toml b/gen/adexchangebuyer1d3-cli/Cargo.toml index e26be4e689..6e8fcf6382 100644 --- a/gen/adexchangebuyer1d3-cli/Cargo.toml +++ b/gen/adexchangebuyer1d3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-adexchangebuyer1d3-cli" -version = "1.0.4+20161020" +version = "1.0.4+20170504" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d3-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-adexchangebuyer1d3] path = "../adexchangebuyer1d3" -version = "1.0.4+20161020" +version = "1.0.4+20170504" diff --git a/gen/adexchangebuyer1d3-cli/README.md b/gen/adexchangebuyer1d3-cli/README.md index 7221534f0c..e0c0054b51 100644 --- a/gen/adexchangebuyer1d3-cli/README.md +++ b/gen/adexchangebuyer1d3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Ad Exchange Buyer* API at revision *20161020*. The CLI is at version *1.0.4*. +This documentation was generated from the *Ad Exchange Buyer* API at revision *20170504*. The CLI is at version *1.0.4*. ```bash adexchangebuyer1d3 [options] diff --git a/gen/adexchangebuyer1d3-cli/mkdocs.yml b/gen/adexchangebuyer1d3-cli/mkdocs.yml index 6e48eac064..5060973d72 100644 --- a/gen/adexchangebuyer1d3-cli/mkdocs.yml +++ b/gen/adexchangebuyer1d3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Buyer v1.0.4+20161020 +site_name: Ad Exchange Buyer v1.0.4+20170504 site_url: http://byron.github.io/google-apis-rs/google-adexchangebuyer1d3-cli site_description: A complete library to interact with Ad Exchange Buyer (protocol v1.3) diff --git a/gen/adexchangebuyer1d3-cli/src/main.rs b/gen/adexchangebuyer1d3-cli/src/main.rs index 47eb49b5e2..68839c7652 100644 --- a/gen/adexchangebuyer1d3-cli/src/main.rs +++ b/gen/adexchangebuyer1d3-cli/src/main.rs @@ -2304,7 +2304,7 @@ fn main() { let mut app = App::new("adexchangebuyer1d3") .author("Sebastian Thiel ") - .version("1.0.4+20161020") + .version("1.0.4+20170504") .about("Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangebuyer1d3_cli") .arg(Arg::with_name("url") diff --git a/gen/adexchangebuyer1d3/Cargo.toml b/gen/adexchangebuyer1d3/Cargo.toml index 960c41d0f1..44b0808f2d 100644 --- a/gen/adexchangebuyer1d3/Cargo.toml +++ b/gen/adexchangebuyer1d3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexchangebuyer1d3" -version = "1.0.4+20161020" +version = "1.0.4+20170504" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d3" homepage = "https://developers.google.com/ad-exchange/buyer-rest" -documentation = "https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020" +documentation = "https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504" license = "MIT" keywords = ["adexchangebuyer", "google", "protocol", "web", "api"] diff --git a/gen/adexchangebuyer1d3/README.md b/gen/adexchangebuyer1d3/README.md index 1cb2b595d3..5e2e693227 100644 --- a/gen/adexchangebuyer1d3/README.md +++ b/gen/adexchangebuyer1d3/README.md @@ -5,28 +5,28 @@ DO NOT EDIT ! --> The `google-adexchangebuyer1d3` library allows access to all features of the *Google Ad Exchange Buyer* service. -This documentation was generated from *Ad Exchange Buyer* crate version *1.0.4+20161020*, where *20161020* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Ad Exchange Buyer* crate version *1.0.4+20170504*, where *20170504* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *Ad Exchange Buyer* *v1d3* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html) ... -* [accounts](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.Account.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.AccountUpdateCall.html) -* [billing info](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.BillingInfo.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.BillingInfoListCall.html) -* [budget](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.Budget.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.BudgetUpdateCall.html) -* [creatives](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.Creative.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.CreativeInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.CreativeListCall.html) -* [direct deals](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.DirectDeal.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.DirectDealGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.DirectDealListCall.html) -* [performance report](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.PerformanceReport.html) - * [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.PerformanceReportListCall.html) -* [pretargeting config](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.PretargetingConfig.html) - * [*delete*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.PretargetingConfigUpdateCall.html) +* [accounts](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.Account.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.AccountUpdateCall.html) +* [billing info](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.BillingInfo.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.BillingInfoListCall.html) +* [budget](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.Budget.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.BudgetUpdateCall.html) +* [creatives](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.Creative.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.CreativeInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.CreativeListCall.html) +* [direct deals](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.DirectDeal.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.DirectDealGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.DirectDealListCall.html) +* [performance report](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.PerformanceReport.html) + * [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.PerformanceReportListCall.html) +* [pretargeting config](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.PretargetingConfig.html) + * [*delete*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.PretargetingConfigUpdateCall.html) @@ -35,17 +35,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html)** +* **[Hub](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/struct.AdExchangeBuyer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.Part.html)** + * **[Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.ResponseResult.html), it will return that by default. You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making this call: `.param("alt", "media")`. @@ -156,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-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20161020/google_adexchangebuyer1d3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adexchangebuyer1d3/1.0.4+20170504/google_adexchangebuyer1d3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adexchangebuyer1d3/src/lib.rs b/gen/adexchangebuyer1d3/src/lib.rs index ccbfcb2a82..a26add6ed5 100644 --- a/gen/adexchangebuyer1d3/src/lib.rs +++ b/gen/adexchangebuyer1d3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Buyer* crate version *1.0.4+20161020*, where *20161020* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Ad Exchange Buyer* crate version *1.0.4+20170504*, where *20170504* is the exact revision of the *adexchangebuyer:v1.3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Ad Exchange Buyer* *v1d3* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). @@ -191,7 +191,7 @@ // 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 +// 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)] @@ -322,8 +322,6 @@ pub struct AdExchangeBuyer { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for AdExchangeBuyer {} @@ -336,8 +334,6 @@ impl<'a, C, A> AdExchangeBuyer client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/adexchangebuyer/v1.3/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -372,26 +368,6 @@ impl<'a, C, A> AdExchangeBuyer self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/adexchangebuyer/v1.3/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1909,7 +1885,7 @@ impl<'a, C, A> BillingInfoGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/billinginfo/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -2142,7 +2118,7 @@ impl<'a, C, A> BillingInfoListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "billinginfo"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/billinginfo".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -2344,7 +2320,7 @@ impl<'a, C, A> DirectDealListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "directdeals"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/directdeals".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -2548,7 +2524,7 @@ impl<'a, C, A> DirectDealGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "directdeals/{id}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/directdeals/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -2792,7 +2768,7 @@ impl<'a, C, A> BudgetPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -3070,7 +3046,7 @@ impl<'a, C, A> BudgetUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -3341,7 +3317,7 @@ impl<'a, C, A> BudgetGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/billinginfo/{accountId}/{billingId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -3591,7 +3567,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "creatives"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -3846,7 +3822,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "creatives"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4089,7 +4065,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "creatives/{accountId}/{buyerCreativeId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/creatives/{accountId}/{buyerCreativeId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4341,7 +4317,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{id}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4607,7 +4583,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{id}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4864,7 +4840,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -5068,7 +5044,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{id}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.3/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -5317,7 +5293,7 @@ impl<'a, C, A> PerformanceReportListCall<'a, C, A> where C: BorrowMut PretargetingConfigDeleteCall<'a, C, A> where C: BorrowMut PretargetingConfigPatchCall<'a, C, A> where C: BorrowMut PretargetingConfigGetCall<'a, C, A> where C: BorrowMut PretargetingConfigInsertCall<'a, C, A> where C: BorrowMut PretargetingConfigListCall<'a, C, A> where C: BorrowMut PretargetingConfigUpdateCall<'a, C, A> where C: BorrowMut PretargetingConfigUpdateCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d4-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-adexchangebuyer1d4] path = "../adexchangebuyer1d4" -version = "1.0.4+20161020" +version = "1.0.4+20170504" diff --git a/gen/adexchangebuyer1d4-cli/README.md b/gen/adexchangebuyer1d4-cli/README.md index dcfed45381..4060999edd 100644 --- a/gen/adexchangebuyer1d4-cli/README.md +++ b/gen/adexchangebuyer1d4-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Ad Exchange Buyer* API at revision *20161020*. The CLI is at version *1.0.4*. +This documentation was generated from the *Ad Exchange Buyer* API at revision *20170504*. The CLI is at version *1.0.4*. ```bash adexchangebuyer1d4 [options] diff --git a/gen/adexchangebuyer1d4-cli/mkdocs.yml b/gen/adexchangebuyer1d4-cli/mkdocs.yml index 25ad9330f6..874186276d 100644 --- a/gen/adexchangebuyer1d4-cli/mkdocs.yml +++ b/gen/adexchangebuyer1d4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Ad Exchange Buyer v1.0.4+20161020 +site_name: Ad Exchange Buyer v1.0.4+20170504 site_url: http://byron.github.io/google-apis-rs/google-adexchangebuyer1d4-cli site_description: A complete library to interact with Ad Exchange Buyer (protocol v1.4) diff --git a/gen/adexchangebuyer1d4-cli/src/main.rs b/gen/adexchangebuyer1d4-cli/src/main.rs index b725821f9e..b46e459cbf 100644 --- a/gen/adexchangebuyer1d4-cli/src/main.rs +++ b/gen/adexchangebuyer1d4-cli/src/main.rs @@ -1818,29 +1818,30 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config-name" => Some(("configName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "excluded-geo-criteria-ids" => Some(("excludedGeoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "user-identifier-data-required" => Some(("userIdentifierDataRequired", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "excluded-verticals" => Some(("excludedVerticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "excluded-content-labels" => Some(("excludedContentLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "verticals" => Some(("verticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "platforms" => Some(("platforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config-id" => Some(("configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "excluded-verticals" => Some(("excludedVerticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config-name" => Some(("configName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "excluded-geo-criteria-ids" => Some(("excludedGeoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "excluded-content-labels" => Some(("excludedContentLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-devices" => Some(("mobileDevices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "geo-criteria-ids" => Some(("geoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-operating-system-versions" => Some(("mobileOperatingSystemVersions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "config-id" => Some(("configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "excluded-user-lists" => Some(("excludedUserLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-active" => Some(("isActive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "minimum-viewability-decile" => Some(("minimumViewabilityDecile", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "supported-creative-attributes" => Some(("supportedCreativeAttributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "user-identifier-data-required" => Some(("userIdentifierDataRequired", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "minimum-viewability-decile", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1975,29 +1976,30 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config-name" => Some(("configName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "excluded-geo-criteria-ids" => Some(("excludedGeoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "user-identifier-data-required" => Some(("userIdentifierDataRequired", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "excluded-verticals" => Some(("excludedVerticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "excluded-content-labels" => Some(("excludedContentLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "verticals" => Some(("verticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "platforms" => Some(("platforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config-id" => Some(("configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "excluded-verticals" => Some(("excludedVerticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config-name" => Some(("configName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "excluded-geo-criteria-ids" => Some(("excludedGeoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "excluded-content-labels" => Some(("excludedContentLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-devices" => Some(("mobileDevices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "geo-criteria-ids" => Some(("geoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-operating-system-versions" => Some(("mobileOperatingSystemVersions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "config-id" => Some(("configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "excluded-user-lists" => Some(("excludedUserLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-active" => Some(("isActive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "minimum-viewability-decile" => Some(("minimumViewabilityDecile", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "supported-creative-attributes" => Some(("supportedCreativeAttributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "user-identifier-data-required" => Some(("userIdentifierDataRequired", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "minimum-viewability-decile", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2080,29 +2082,30 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config-name" => Some(("configName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "excluded-geo-criteria-ids" => Some(("excludedGeoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "user-identifier-data-required" => Some(("userIdentifierDataRequired", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "excluded-verticals" => Some(("excludedVerticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "excluded-content-labels" => Some(("excludedContentLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "verticals" => Some(("verticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "platforms" => Some(("platforms", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config-id" => Some(("configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "excluded-verticals" => Some(("excludedVerticals", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config-name" => Some(("configName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "excluded-geo-criteria-ids" => Some(("excludedGeoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "excluded-content-labels" => Some(("excludedContentLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-devices" => Some(("mobileDevices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "billing-id" => Some(("billingId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "geo-criteria-ids" => Some(("geoCriteriaIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "mobile-operating-system-versions" => Some(("mobileOperatingSystemVersions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "mobile-carriers" => Some(("mobileCarriers", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "config-id" => Some(("configId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "excluded-user-lists" => Some(("excludedUserLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-active" => Some(("isActive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "minimum-viewability-decile" => Some(("minimumViewabilityDecile", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "supported-creative-attributes" => Some(("supportedCreativeAttributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "user-identifier-data-required" => Some(("userIdentifierDataRequired", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "vendor-types" => Some(("vendorTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "user-lists" => Some(("userLists", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "creative-type" => Some(("creativeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing-id", "config-id", "config-name", "creative-type", "excluded-content-labels", "excluded-geo-criteria-ids", "excluded-user-lists", "excluded-verticals", "geo-criteria-ids", "is-active", "kind", "languages", "minimum-viewability-decile", "mobile-carriers", "mobile-devices", "mobile-operating-system-versions", "platforms", "supported-creative-attributes", "user-identifier-data-required", "user-lists", "vendor-types", "verticals"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4083,7 +4086,7 @@ fn main() { let mut app = App::new("adexchangebuyer1d4") .author("Sebastian Thiel ") - .version("1.0.4+20161020") + .version("1.0.4+20170504") .about("Accesses your bidding-account information, submits creatives for validation, finds available direct deals, and retrieves performance reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_adexchangebuyer1d4_cli") .arg(Arg::with_name("url") diff --git a/gen/adexchangebuyer1d4/Cargo.toml b/gen/adexchangebuyer1d4/Cargo.toml index f8597f5b3c..237260a2ed 100644 --- a/gen/adexchangebuyer1d4/Cargo.toml +++ b/gen/adexchangebuyer1d4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adexchangebuyer1d4" -version = "1.0.4+20161020" +version = "1.0.4+20170504" authors = ["Sebastian Thiel "] description = "A complete library to interact with Ad Exchange Buyer (protocol v1.4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/adexchangebuyer1d4" homepage = "https://developers.google.com/ad-exchange/buyer-rest" -documentation = "https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020" +documentation = "https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504" license = "MIT" keywords = ["adexchangebuyer", "google", "protocol", "web", "api"] diff --git a/gen/adexchangebuyer1d4/README.md b/gen/adexchangebuyer1d4/README.md index f826c5705a..41d8f27539 100644 --- a/gen/adexchangebuyer1d4/README.md +++ b/gen/adexchangebuyer1d4/README.md @@ -5,38 +5,38 @@ DO NOT EDIT ! --> The `google-adexchangebuyer1d4` library allows access to all features of the *Google Ad Exchange Buyer* service. -This documentation was generated from *Ad Exchange Buyer* crate version *1.0.4+20161020*, where *20161020* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Ad Exchange Buyer* crate version *1.0.4+20170504*, where *20170504* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *Ad Exchange Buyer* *v1d4* API can be found at the [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html) ... -* [accounts](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.Account.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.AccountUpdateCall.html) -* [billing info](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.BillingInfo.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.BillingInfoListCall.html) -* [budget](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.Budget.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.BudgetUpdateCall.html) -* [creatives](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.Creative.html) - * [*add deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.CreativeAddDealCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.CreativeListCall.html), [*list deals*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.CreativeListDealCall.html) and [*remove deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.CreativeRemoveDealCall.html) +* [accounts](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.Account.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.AccountListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.AccountUpdateCall.html) +* [billing info](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.BillingInfo.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.BillingInfoGetCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.BillingInfoListCall.html) +* [budget](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.Budget.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.BudgetGetCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.BudgetPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.BudgetUpdateCall.html) +* [creatives](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.Creative.html) + * [*add deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.CreativeAddDealCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.CreativeListCall.html), [*list deals*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.CreativeListDealCall.html) and [*remove deal*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.CreativeRemoveDealCall.html) * marketplacedeals - * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.MarketplacedealDeleteCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.MarketplacedealInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.MarketplacedealListCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.MarketplacedealUpdateCall.html) + * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.MarketplacedealDeleteCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.MarketplacedealInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.MarketplacedealListCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.MarketplacedealUpdateCall.html) * marketplacenotes - * [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.MarketplacenoteInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.MarketplacenoteListCall.html) + * [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.MarketplacenoteInsertCall.html) and [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.MarketplacenoteListCall.html) * marketplaceprivateauction - * [*updateproposal*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.MarketplaceprivateauctionUpdateproposalCall.html) -* [performance report](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.PerformanceReport.html) - * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.PerformanceReportListCall.html) -* [pretargeting config](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.PretargetingConfig.html) - * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.PretargetingConfigUpdateCall.html) -* [products](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.Product.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.ProductGetCall.html) and [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.ProductSearchCall.html) -* [proposals](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.Proposal.html) - * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.ProposalGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.ProposalInsertCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.ProposalPatchCall.html), [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.ProposalSearchCall.html), [*setupcomplete*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.ProposalSetupcompleteCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.ProposalUpdateCall.html) + * [*updateproposal*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.MarketplaceprivateauctionUpdateproposalCall.html) +* [performance report](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.PerformanceReport.html) + * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.PerformanceReportListCall.html) +* [pretargeting config](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.PretargetingConfig.html) + * [*delete*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigDeleteCall.html), [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigInsertCall.html), [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigListCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigPatchCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.PretargetingConfigUpdateCall.html) +* [products](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.Product.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.ProductGetCall.html) and [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.ProductSearchCall.html) +* [proposals](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.Proposal.html) + * [*get*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.ProposalGetCall.html), [*insert*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.ProposalInsertCall.html), [*patch*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.ProposalPatchCall.html), [*search*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.ProposalSearchCall.html), [*setupcomplete*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.ProposalSetupcompleteCall.html) and [*update*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.ProposalUpdateCall.html) * pubprofiles - * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.PubprofileListCall.html) + * [*list*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.PubprofileListCall.html) @@ -45,17 +45,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html)** +* **[Hub](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/struct.AdExchangeBuyer.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.Part.html)** + * **[Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -148,17 +148,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.ResponseResult.html), it will return that by default. You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making this call: `.param("alt", "media")`. @@ -168,29 +168,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20161020/google_adexchangebuyer1d4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adexchangebuyer1d4/1.0.4+20170504/google_adexchangebuyer1d4/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/adexchangebuyer1d4/src/lib.rs b/gen/adexchangebuyer1d4/src/lib.rs index 70c7953014..7b19063c78 100644 --- a/gen/adexchangebuyer1d4/src/lib.rs +++ b/gen/adexchangebuyer1d4/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Ad Exchange Buyer* crate version *1.0.4+20161020*, where *20161020* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Ad Exchange Buyer* crate version *1.0.4+20170504*, where *20170504* is the exact revision of the *adexchangebuyer:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Ad Exchange Buyer* *v1d4* API can be found at the //! [official documentation site](https://developers.google.com/ad-exchange/buyer-rest). @@ -203,7 +203,7 @@ // 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 +// 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)] @@ -334,8 +334,6 @@ pub struct AdExchangeBuyer { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for AdExchangeBuyer {} @@ -348,8 +346,6 @@ impl<'a, C, A> AdExchangeBuyer client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/adexchangebuyer/v1.4/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -399,26 +395,6 @@ impl<'a, C, A> AdExchangeBuyer self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/adexchangebuyer/v1.4/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -585,15 +561,15 @@ impl Part for CreativeDealIdsDealStatuses {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Creative { - /// Detected product categories, if any. Read-only. This field should not be set in requests. + /// Detected product categories, if any. Each category is represented by an integer as defined in ad-product-categories.txt. Read-only. This field should not be set in requests. #[serde(rename="productCategories")] pub product_categories: Option>, /// The agency id for this creative. #[serde(rename="agencyId")] pub agency_id: Option, - /// All attributes for the ads that may be shown from this snippet. + /// List of buyer selectable attributes for the ads that may be shown from this snippet. Each attribute is represented by an integer as defined in buyer-declarable-creative-attributes.txt. pub attribute: Option>, - /// All restricted categories for the ads that may be shown from this snippet. + /// All restricted categories for the ads that may be shown from this snippet. Each category is represented by an integer as defined in the ad-restricted-categories.txt. #[serde(rename="restrictedCategories")] pub restricted_categories: Option>, /// Detected domains for this creative. Read-only. This field should not be set in requests. @@ -625,7 +601,7 @@ pub struct Creative { /// Account id. #[serde(rename="accountId")] pub account_id: Option, - /// The name of the company being advertised in the creative. + /// The name of the company being advertised in the creative. The value provided must exist in the advertisers.txt file. #[serde(rename="advertiserName")] pub advertiser_name: Option, /// Resource type. @@ -636,7 +612,7 @@ pub struct Creative { /// The set of destination urls for the snippet. #[serde(rename="clickThroughUrl")] pub click_through_url: Option>, - /// The granular status of this ad in specific contexts. A context here relates to where something ultimately serves (for example, a physical location, a platform, an HTTPS vs HTTP request, or the type of auction). Read-only. This field should not be set in requests. + /// The granular status of this ad in specific contexts. A context here relates to where something ultimately serves (for example, a physical location, a platform, an HTTPS vs HTTP request, or the type of auction). Read-only. This field should not be set in requests. See the examples in the Creatives guide for more details. #[serde(rename="servingRestrictions")] pub serving_restrictions: Option>, /// Shows any corrections that were applied to this creative. Read-only. This field should not be set in requests. @@ -653,13 +629,13 @@ pub struct Creative { /// The last upload timestamp of this creative if it was uploaded via API. Read-only. The value of this field is generated, and will be ignored for uploads. (formatted RFC 3339 timestamp). #[serde(rename="apiUploadTimestamp")] pub api_upload_timestamp: Option, - /// All vendor types for the ads that may be shown from this snippet. + /// List of vendor types for the ads that may be shown from this snippet. Each vendor type is represented by an integer as defined in vendors.txt. #[serde(rename="vendorType")] pub vendor_type: Option>, /// The filtering reasons for the creative. Read-only. This field should not be set in requests. #[serde(rename="filteringReasons")] pub filtering_reasons: Option, - /// Detected sensitive categories, if any. Read-only. This field should not be set in requests. + /// Detected sensitive categories, if any. Each category is represented by an integer as defined in ad-sensitive-categories.txt. Read-only. This field should not be set in requests. #[serde(rename="sensitiveCategories")] pub sensitive_categories: Option>, } @@ -873,7 +849,7 @@ pub struct Proposal { /// True if the proposal is being renegotiated (readonly). #[serde(rename="isRenegotiating")] pub is_renegotiating: Option, - /// True, if the buyside inventory setup is complete for this proposal. (readonly, except via OrderSetupCompleted action) + /// True, if the buyside inventory setup is complete for this proposal. (readonly, except via OrderSetupCompleted action) Deprecated in favor of deal level setup complete flag. #[serde(rename="isSetupComplete")] pub is_setup_complete: Option, /// IDs of DBM advertisers permission to this proposal. @@ -946,9 +922,14 @@ pub struct Product { /// What exchange will provide this inventory (readonly, except on create). #[serde(rename="inventorySource")] pub inventory_source: Option, + /// The buyer that created the offer if this is a buyer initiated offer (readonly, except on create) + pub buyer: Option, /// Id of the publisher profile for a given seller. A (seller.account_id, publisher_profile_id) pair uniquely identifies a publisher profile. Buyers can call the PublisherProfiles::List endpoint to get a list of publisher profiles for a given seller. #[serde(rename="publisherProfileId")] pub publisher_profile_id: Option, + /// The role that created the offer. Set to BUYER for buyer initiated offers. + #[serde(rename="creatorRole")] + pub creator_role: Option, /// Time of last update in ms. since epoch (readonly) #[serde(rename="lastUpdateTimeMs")] pub last_update_time_ms: Option, @@ -960,11 +941,17 @@ pub struct Product { pub legacy_offer_id: Option, /// Identifies what kind of resource this is. Value: the fixed string "adexchangebuyer#product". pub kind: Option, + /// Marketplace publisher profile Id. This Id differs from the regular publisher_profile_id in that 1. This is a new id, the old Id will be deprecated in 2017. 2. This id uniquely identifies a publisher profile by itself. + #[serde(rename="marketplacePublisherProfileId")] + pub marketplace_publisher_profile_id: Option, /// The name for this product as set by the seller. (buyer-readonly) pub name: Option, /// The syndication product associated with the deal. (readonly, except on create) #[serde(rename="syndicationProduct")] pub syndication_product: Option, + /// The billed buyer corresponding to the buyer that created the offer. (readonly, except on create) + #[serde(rename="billedBuyer")] + pub billed_buyer: Option, /// Optional private auction id if this offer is a private auction offer. #[serde(rename="privateAuctionId")] pub private_auction_id: Option, @@ -1154,7 +1141,7 @@ pub struct CreativeServingRestrictionsContexts { /// Only set when contextType=AUCTION_TYPE. Represents the auction types this restriction applies to. #[serde(rename="auctionType")] pub auction_type: Option>, - /// Only set when contextType=LOCATION. Represents the geo criterias this restriction applies to. + /// Only set when contextType=LOCATION. Represents the geo criterias this restriction applies to. Impressions are considered to match a context if either the user location or publisher location matches a given geoCriteriaId. #[serde(rename="geoCriteriaId")] pub geo_criteria_id: Option>, } @@ -1198,7 +1185,7 @@ pub struct DealTermsGuaranteedFixedPriceTermsBillingInfo { /// The original contracted quantity (# impressions) for this deal. To ensure delivery, sometimes the publisher will book the deal with a impression buffer, such that guaranteed_looks is greater than the contracted quantity. However clients are billed using the original contracted quantity. #[serde(rename="originalContractedQuantity")] pub original_contracted_quantity: Option, - /// The timestamp (in ms since epoch) when the original reservation price for the deal was first converted to DFP currency. This is used to convert the contracted price into advertiser's currency without discrepancy. + /// The timestamp (in ms since epoch) when the original reservation price for the deal was first converted to DFP currency. This is used to convert the contracted price into buyer's currency without discrepancy. #[serde(rename="currencyConversionTimeMs")] pub currency_conversion_time_ms: Option, } @@ -1254,7 +1241,7 @@ pub struct CreativeFilteringReasonsReasons { /// The number of times the creative was filtered for the status. The count is aggregated across all publishers on the exchange. #[serde(rename="filteringCount")] pub filtering_count: Option, - /// The filtering status code. Please refer to the creative-status-codes.txt file for different statuses. + /// The filtering status code as defined in creative-status-codes.txt. #[serde(rename="filteringStatus")] pub filtering_status: Option, } @@ -1404,12 +1391,15 @@ pub struct AccountBidderLocation { /// - US_EAST /// - US_WEST pub region: Option, - /// The protocol that the bidder endpoint is using. By default, OpenRTB protocols use JSON, except PROTOCOL_OPENRTB_PROTOBUF. PROTOCOL_OPENRTB_PROTOBUF uses protobuf encoding over the latest OpenRTB protocol version, which is 2.4 right now. Allowed values: + /// The protocol that the bidder endpoint is using. OpenRTB protocols with prefix PROTOCOL_OPENRTB_PROTOBUF use proto buffer, otherwise use JSON. Allowed values: /// - PROTOCOL_ADX /// - PROTOCOL_OPENRTB_2_2 /// - PROTOCOL_OPENRTB_2_3 /// - PROTOCOL_OPENRTB_2_4 - /// - PROTOCOL_OPENRTB_PROTOBUF + /// - PROTOCOL_OPENRTB_2_5 + /// - PROTOCOL_OPENRTB_PROTOBUF_2_3 + /// - PROTOCOL_OPENRTB_PROTOBUF_2_4 + /// - PROTOCOL_OPENRTB_PROTOBUF_2_5 #[serde(rename="bidProtocol")] pub bid_protocol: Option, /// The maximum queries per second the Ad Exchange will send. @@ -1481,7 +1471,7 @@ impl Resource for Account {} impl ResponseResult for Account {} -/// The granular status of this ad in specific contexts. A context here relates to where something ultimately serves (for example, a physical location, a platform, an HTTPS vs HTTP request, or the type of auction). Read-only. This field should not be set in requests. +/// The granular status of this ad in specific contexts. A context here relates to where something ultimately serves (for example, a physical location, a platform, an HTTPS vs HTTP request, or the type of auction). Read-only. This field should not be set in requests. See the examples in the Creatives guide for more details. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1818,6 +1808,9 @@ impl ResponseResult for GetOrderDealsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DealServingMetadata { + /// True if alcohol ads are allowed for this deal (read-only). This field is only populated when querying for finalized orders using the method GetFinalizedOrderDeals + #[serde(rename="alcoholAdsAllowed")] + pub alcohol_ads_allowed: Option, /// Tracks which parties (if any) have paused a deal. (readonly, except via PauseResumeOrderDeals action) #[serde(rename="dealPauseStatus")] pub deal_pause_status: Option, @@ -1909,10 +1902,13 @@ pub struct MarketplaceDeal { /// Metadata about the serving status of this deal (readonly, writes via custom actions) #[serde(rename="dealServingMetadata")] pub deal_serving_metadata: Option, + /// True, if the buyside inventory setup is complete for this deal. (readonly, except via OrderSetupCompleted action) + #[serde(rename="isSetupComplete")] + pub is_setup_complete: Option, /// The time (ms since epoch) of the deal creation. (readonly) #[serde(rename="creationTimeMs")] pub creation_time_ms: Option, - /// Description for the deal terms. (updatable) + /// Description for the deal terms. (buyer-readonly) #[serde(rename="inventoryDescription")] pub inventory_description: Option, /// The product-id from which this deal was created. (readonly, except on create) @@ -1974,6 +1970,9 @@ impl Part for Seller {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PretargetingConfig { + /// The name of the config. Must be unique. Required for all requests. + #[serde(rename="configName")] + pub config_name: Option, /// The kind of the resource, i.e. "adexchangebuyer#pretargetingConfig". pub kind: Option, /// Requests containing any of these vertical ids will match. @@ -2001,9 +2000,9 @@ pub struct PretargetingConfig { /// Whether this config is active. Required for all requests. #[serde(rename="isActive")] pub is_active: Option, - /// The name of the config. Must be unique. Required for all requests. - #[serde(rename="configName")] - pub config_name: Option, + /// Requests where the predicted viewability is below the specified decile will not match. E.g. if the buyer sets this value to 5, requests from slots where the predicted viewability is below 50% will not match. If the predicted viewability is unknown this field will be ignored. + #[serde(rename="minimumViewabilityDecile")] + pub minimum_viewability_decile: Option, /// Requests containing any of these vertical ids will not match. Values are from the publisher-verticals.txt file in the downloadable files section. #[serde(rename="excludedVerticals")] pub excluded_verticals: Option>, @@ -2172,7 +2171,7 @@ pub struct AddOrderDealsRequest { impl RequestValue for AddOrderDealsRequest {} -/// Used to specify pricing rules for buyers/advertisers. Each PricePerBuyer in an product can become [0,1] deals. To check if there is a PricePerBuyer for a particular buyer or buyer/advertiser pair, we look for the most specific matching rule - we first look for a rule matching the buyer and advertiser, next a rule with the buyer but an empty advertiser list, and otherwise look for a matching rule where no buyer is set. +/// Used to specify pricing rules for buyers. Each PricePerBuyer in a product can become [0,1] deals. To check if there is a PricePerBuyer for a particular buyer we look for the most specific matching rule - we first look for a rule matching the buyer and otherwise look for a matching rule where no buyer is set. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -2183,6 +2182,9 @@ pub struct PricePerBuyer { pub auction_tier: Option, /// The buyer who will pay this price. If unset, all buyers can pay this price (if the advertisers match, and there's no more specific rule matching the buyer). pub buyer: Option, + /// Reference to the buyer that will get billed. + #[serde(rename="billedBuyer")] + pub billed_buyer: Option, /// The specified price pub price: Option, } @@ -2402,6 +2404,9 @@ pub struct TargetingValueCreativeSize { /// The Creative size type. #[serde(rename="creativeSizeType")] pub creative_size_type: Option, + /// The native template for native ad. + #[serde(rename="nativeTemplate")] + pub native_template: Option, /// For video size type, the list of companion sizes. #[serde(rename="companionSizes")] pub companion_sizes: Option>, @@ -3767,7 +3772,7 @@ impl<'a, C, A> PubprofileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "publisher/{accountId}/profiles"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/publisher/{accountId}/profiles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4002,7 +4007,7 @@ impl<'a, C, A> BillingInfoGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/billinginfo/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4235,7 +4240,7 @@ impl<'a, C, A> BillingInfoListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "billinginfo"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/billinginfo".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -4446,7 +4451,7 @@ impl<'a, C, A> MarketplacedealDeleteCall<'a, C, A> where C: BorrowMut MarketplacedealInsertCall<'a, C, A> where C: BorrowMut MarketplacedealUpdateCall<'a, C, A> where C: BorrowMut MarketplacedealListCall<'a, C, A> where C: BorrowMut MarketplaceprivateauctionUpdateproposalCall<'a, C, A> where C: Bo } - let mut url = self.hub._base_url.clone() + "privateauction/{privateAuctionId}/updateproposal"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/privateauction/{privateAuctionId}/updateproposal".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -5742,7 +5747,7 @@ impl<'a, C, A> ProposalSearchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "proposals/search"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/proposals/search".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -5958,7 +5963,7 @@ impl<'a, C, A> ProposalInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "proposals/insert"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/proposals/insert".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -6197,7 +6202,7 @@ impl<'a, C, A> ProposalUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "proposals/{proposalId}/{revisionNumber}/{updateAction}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/proposals/{proposalId}/{revisionNumber}/{updateAction}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -6475,7 +6480,7 @@ impl<'a, C, A> ProposalSetupcompleteCall<'a, C, A> where C: BorrowMut ProposalPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "proposals/{proposalId}/{revisionNumber}/{updateAction}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/proposals/{proposalId}/{revisionNumber}/{updateAction}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -6990,7 +6995,7 @@ impl<'a, C, A> ProposalGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "proposals/{proposalId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/proposals/{proposalId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -7234,7 +7239,7 @@ impl<'a, C, A> BudgetUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -7505,7 +7510,7 @@ impl<'a, C, A> BudgetGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -7759,7 +7764,7 @@ impl<'a, C, A> BudgetPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "billinginfo/{accountId}/{billingId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/billinginfo/{accountId}/{billingId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -8042,7 +8047,7 @@ impl<'a, C, A> PerformanceReportListCall<'a, C, A> where C: BorrowMut ProductSearchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "products/search"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/products/search".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -8504,7 +8509,7 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "products/{productId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/products/{productId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -8744,7 +8749,7 @@ impl<'a, C, A> MarketplacenoteListCall<'a, C, A> where C: BorrowMut MarketplacenoteInsertCall<'a, C, A> where C: BorrowMut AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{id}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -9528,7 +9533,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -9732,7 +9737,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{id}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -9979,7 +9984,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{id}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -10277,7 +10282,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "creatives"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -10528,7 +10533,7 @@ impl<'a, C, A> CreativeRemoveDealCall<'a, C, A> where C: BorrowMut CreativeAddDealCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "creatives/{accountId}/{buyerCreativeId}/addDeal/{dealId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}/addDeal/{dealId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -11023,7 +11028,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "creatives/{accountId}/{buyerCreativeId}"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -11273,7 +11278,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "creatives"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -11503,7 +11508,7 @@ impl<'a, C, A> CreativeListDealCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "creatives/{accountId}/{buyerCreativeId}/listDeals"; + let mut url = "https://www.googleapis.com/adexchangebuyer/v1.4/creatives/{accountId}/{buyerCreativeId}/listDeals".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeBuyer.as_ref().to_string(), ()); } @@ -11755,7 +11760,7 @@ impl<'a, C, A> PretargetingConfigInsertCall<'a, C, A> where C: BorrowMut PretargetingConfigListCall<'a, C, A> where C: BorrowMut PretargetingConfigUpdateCall<'a, C, A> where C: BorrowMut PretargetingConfigPatchCall<'a, C, A> where C: BorrowMut PretargetingConfigDeleteCall<'a, C, A> where C: BorrowMut PretargetingConfigGetCall<'a, C, A> where C: BorrowMut PretargetingConfigGetCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for AdExchangeSeller {} @@ -344,8 +342,6 @@ impl<'a, C, A> AdExchangeSeller client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/adexchangeseller/v2.0/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -362,26 +358,6 @@ impl<'a, C, A> AdExchangeSeller self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/adexchangeseller/v2.0/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1268,7 +1244,7 @@ impl<'a, C, A> AccountReportSavedGenerateCall<'a, C, A> where C: BorrowMut AccountMetadataMetricListCall<'a, C, A> where C: BorrowMut AccountReportGenerateCall<'a, C, A> where C: BorrowMut AccountUrlchannelListCall<'a, C, A> where C: BorrowMut AccountReportSavedListCall<'a, C, A> where C: BorrowMut AccountPreferreddealGetCall<'a, C, A> where C: BorrowMut AccountAdclientListCall<'a, C, A> where C: BorrowMut AccountMetadataDimensionListCall<'a, C, A> where C: BorrowMut AccountCustomchannelGetCall<'a, C, A> where C: BorrowMut AccountCustomchannelListCall<'a, C, A> where C: BorrowMut AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts"; + let mut url = "https://www.googleapis.com/adexchangeseller/v2.0/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeSellerReadonly.as_ref().to_string(), ()); } @@ -4177,7 +4153,7 @@ impl<'a, C, A> AccountAlertListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/alerts"; + let mut url = "https://www.googleapis.com/adexchangeseller/v2.0/accounts/{accountId}/alerts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeSellerReadonly.as_ref().to_string(), ()); } @@ -4419,7 +4395,7 @@ impl<'a, C, A> AccountPreferreddealListCall<'a, C, A> where C: BorrowMut AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; + let mut url = "https://www.googleapis.com/adexchangeseller/v2.0/accounts/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AdexchangeSellerReadonly.as_ref().to_string(), ()); } @@ -4819,3 +4795,4 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa } + diff --git a/gen/admin1_directory-cli/Cargo.toml b/gen/admin1_directory-cli/Cargo.toml index e718c5db03..33e903fbbf 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.4+20161124" +version = "1.0.4+20170419" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-admin1_directory] path = "../admin1_directory" -version = "1.0.4+20161124" +version = "1.0.4+20170419" diff --git a/gen/admin1_directory-cli/README.md b/gen/admin1_directory-cli/README.md index 6f3d554c5a..8ef159e240 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 *20161124*. The CLI is at version *1.0.4*. +This documentation was generated from the *directory* API at revision *20170419*. The CLI is at version *1.0.4*. ```bash admin1-directory [options] diff --git a/gen/admin1_directory-cli/mkdocs.yml b/gen/admin1_directory-cli/mkdocs.yml index 27b1f0d28c..a311667815 100644 --- a/gen/admin1_directory-cli/mkdocs.yml +++ b/gen/admin1_directory-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: directory v1.0.4+20161124 +site_name: directory v1.0.4+20170419 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) diff --git a/gen/admin1_directory-cli/src/main.rs b/gen/admin1_directory-cli/src/main.rs index fb9b64f4ac..38a0352ac7 100644 --- a/gen/admin1_directory-cli/src/main.rs +++ b/gen/admin1_directory-cli/src/main.rs @@ -5674,14 +5674,16 @@ impl<'n> Engine<'n> { "deletion-time" => Some(("deletionTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "suspension-reason" => Some(("suspensionReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "thumbnail-photo-url" => Some(("thumbnailPhotoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "is-admin" => Some(("isAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "is-enrolled-in2-sv" => Some(("isEnrolledIn2Sv", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "include-in-global-address-list" => Some(("includeInGlobalAddressList", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "is-admin" => Some(("isAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-login-time" => Some(("lastLoginTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "org-unit-path" => Some(("orgUnitPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "agreed-to-terms" => Some(("agreedToTerms", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ip-whitelisted" => Some(("ipWhitelisted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "primary-email" => Some(("primaryEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-enforced-in2-sv" => Some(("isEnforcedIn2Sv", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "is-mailbox-setup" => Some(("isMailboxSetup", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "password" => Some(("password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5693,7 +5695,7 @@ impl<'n> Engine<'n> { "change-password-at-next-login" => Some(("changePasswordAtNextLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-enforced-in2-sv", "is-enrolled-in2-sv", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5951,14 +5953,16 @@ impl<'n> Engine<'n> { "deletion-time" => Some(("deletionTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "suspension-reason" => Some(("suspensionReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "thumbnail-photo-url" => Some(("thumbnailPhotoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "is-admin" => Some(("isAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "is-enrolled-in2-sv" => Some(("isEnrolledIn2Sv", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "include-in-global-address-list" => Some(("includeInGlobalAddressList", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "is-admin" => Some(("isAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-login-time" => Some(("lastLoginTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "org-unit-path" => Some(("orgUnitPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "agreed-to-terms" => Some(("agreedToTerms", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ip-whitelisted" => Some(("ipWhitelisted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "primary-email" => Some(("primaryEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-enforced-in2-sv" => Some(("isEnforcedIn2Sv", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "is-mailbox-setup" => Some(("isMailboxSetup", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "password" => Some(("password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -5970,7 +5974,7 @@ impl<'n> Engine<'n> { "change-password-at-next-login" => Some(("changePasswordAtNextLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-enforced-in2-sv", "is-enrolled-in2-sv", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -6419,14 +6423,16 @@ impl<'n> Engine<'n> { "deletion-time" => Some(("deletionTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "suspension-reason" => Some(("suspensionReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "thumbnail-photo-url" => Some(("thumbnailPhotoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "is-admin" => Some(("isAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "is-enrolled-in2-sv" => Some(("isEnrolledIn2Sv", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "include-in-global-address-list" => Some(("includeInGlobalAddressList", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "is-admin" => Some(("isAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "last-login-time" => Some(("lastLoginTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "org-unit-path" => Some(("orgUnitPath", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "agreed-to-terms" => Some(("agreedToTerms", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "ip-whitelisted" => Some(("ipWhitelisted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "primary-email" => Some(("primaryEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-enforced-in2-sv" => Some(("isEnforcedIn2Sv", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "is-mailbox-setup" => Some(("isMailboxSetup", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "password" => Some(("password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -6438,7 +6444,7 @@ impl<'n> Engine<'n> { "change-password-at-next-login" => Some(("changePasswordAtNextLogin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "customer-id" => Some(("customerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["agreed-to-terms", "aliases", "change-password-at-next-login", "creation-time", "customer-id", "deletion-time", "etag", "family-name", "full-name", "given-name", "hash-function", "id", "include-in-global-address-list", "ip-whitelisted", "is-admin", "is-delegated-admin", "is-enforced-in2-sv", "is-enrolled-in2-sv", "is-mailbox-setup", "kind", "last-login-time", "name", "non-editable-aliases", "org-unit-path", "password", "primary-email", "suspended", "suspension-reason", "thumbnail-photo-etag", "thumbnail-photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -7397,13 +7403,13 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), (Some(r##"resource-id"##), None, - Some(r##"Immutable id of Chrome OS Device"##), + Some(r##"Immutable ID of Chrome OS Device"##), Some(true), Some(false)), @@ -7425,13 +7431,13 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), (Some(r##"device-id"##), None, - Some(r##"Immutable id of Chrome OS Device"##), + Some(r##"Immutable ID of Chrome OS Device"##), Some(true), Some(false)), @@ -7453,7 +7459,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -7475,13 +7481,13 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), (Some(r##"device-id"##), None, - Some(r##"Immutable id of Chrome OS Device"##), + Some(r##"Immutable ID of Chrome OS Device"##), Some(true), Some(false)), @@ -7509,13 +7515,13 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), (Some(r##"device-id"##), None, - Some(r##"Immutable id of Chrome OS Device"##), + Some(r##"Immutable ID of Chrome OS Device"##), Some(true), Some(false)), @@ -7627,7 +7633,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable id of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -7649,7 +7655,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable id of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -7677,7 +7683,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable id of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -7705,7 +7711,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable id of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -7730,7 +7736,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable id of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -7752,7 +7758,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable id of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -7780,7 +7786,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable id of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -7808,7 +7814,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable id of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -8211,13 +8217,13 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), (Some(r##"resource-id"##), None, - Some(r##"Immutable id of Mobile Device"##), + Some(r##"Immutable ID of Mobile Device"##), Some(true), Some(false)), @@ -8239,13 +8245,13 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), (Some(r##"resource-id"##), None, - Some(r##"Immutable id of Mobile Device"##), + Some(r##"Immutable ID of Mobile Device"##), Some(true), Some(false)), @@ -8261,13 +8267,13 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), (Some(r##"resource-id"##), None, - Some(r##"Immutable id of Mobile Device"##), + Some(r##"Immutable ID of Mobile Device"##), Some(true), Some(false)), @@ -8289,7 +8295,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -8314,7 +8320,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account. The customerId is also returned as part of the Users resource."##), + Some(r##"The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource."##), Some(true), Some(false)), @@ -8336,7 +8342,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account. The customerId is also returned as part of the Users resource."##), + Some(r##"The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource."##), Some(true), Some(false)), @@ -8364,7 +8370,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account."##), + Some(r##"The unique ID for the customer's G Suite account."##), Some(true), Some(false)), @@ -8386,7 +8392,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account."##), + Some(r##"The unique ID for the customer's G Suite account."##), Some(true), Some(false)), @@ -8420,7 +8426,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account."##), + Some(r##"The unique ID for the customer's G Suite account."##), Some(true), Some(false)), @@ -8457,7 +8463,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -8479,7 +8485,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -8507,7 +8513,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -8535,7 +8541,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -8557,7 +8563,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -8591,7 +8597,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -8628,7 +8634,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable ID of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -8653,7 +8659,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), + Some(r##"The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), Some(true), Some(false)), @@ -8675,7 +8681,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), + Some(r##"The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), Some(true), Some(false)), @@ -8703,7 +8709,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), + Some(r##"The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), Some(true), Some(false)), @@ -8731,7 +8737,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), + Some(r##"The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), Some(true), Some(false)), @@ -8753,7 +8759,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), + Some(r##"The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), Some(true), Some(false)), @@ -8787,7 +8793,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), + Some(r##"The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID."##), Some(true), Some(false)), @@ -8824,7 +8830,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable ID of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -8846,7 +8852,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable ID of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -8874,7 +8880,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable ID of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -8902,7 +8908,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable ID of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -8927,7 +8933,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable ID of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -8949,7 +8955,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable ID of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -8977,7 +8983,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable ID of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -9005,7 +9011,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable id of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -9027,7 +9033,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable ID of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -9061,7 +9067,7 @@ fn main() { vec![ (Some(r##"customer"##), None, - Some(r##"Immutable ID of the Google Apps account."##), + Some(r##"Immutable ID of the G Suite account."##), Some(true), Some(false)), @@ -9098,7 +9104,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -9120,7 +9126,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -9148,7 +9154,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -9176,7 +9182,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -9198,7 +9204,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -9232,7 +9238,7 @@ fn main() { vec![ (Some(r##"customer-id"##), None, - Some(r##"Immutable id of the Google Apps account"##), + Some(r##"Immutable ID of the G Suite account"##), Some(true), Some(false)), @@ -9793,7 +9799,7 @@ fn main() { let mut app = App::new("admin1-directory") .author("Sebastian Thiel ") - .version("1.0.4+20161124") + .version("1.0.4+20170419") .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 22b5c1137f..9202d69705 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.4+20161124" +version = "1.0.4+20170419" 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.4+20161124" +documentation = "https://docs.rs/google-admin1_directory/1.0.4+20170419" license = "MIT" keywords = ["admin", "google", "protocol", "web", "api"] diff --git a/gen/admin1_directory/README.md b/gen/admin1_directory/README.md index bf62ed45d0..fd02da39fc 100644 --- a/gen/admin1_directory/README.md +++ b/gen/admin1_directory/README.md @@ -5,61 +5,61 @@ DO NOT EDIT ! --> The `google-admin1_directory` library allows access to all features of the *Google directory* service. -This documentation was generated from *directory* crate version *1.0.4+20161124*, where *20161124* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *directory* crate version *1.0.4+20170419*, where *20170419* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161124/google_admin1_directory/struct.Directory.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Directory.html) ... -* [asps](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Asp.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.AspDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.AspGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.AspListCall.html) -* [channels](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Channel.html) - * [*stop*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ChannelStopCall.html) +* [asps](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Asp.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.AspDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.AspGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.AspListCall.html) +* [channels](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Channel.html) + * [*stop*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ChannelStopCall.html) * chromeosdevices - * [*action*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ChromeosdeviceActionCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ChromeosdeviceGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ChromeosdeviceListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ChromeosdevicePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ChromeosdeviceUpdateCall.html) -* [customers](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Customer.html) - * [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.CustomerGetCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.CustomerPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.CustomerUpdateCall.html) + * [*action*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ChromeosdeviceActionCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ChromeosdeviceGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ChromeosdeviceListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ChromeosdevicePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ChromeosdeviceUpdateCall.html) +* [customers](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Customer.html) + * [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.CustomerGetCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.CustomerPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.CustomerUpdateCall.html) * domain aliases - * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.DomainAliaseDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.DomainAliaseGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.DomainAliaseInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.DomainAliaseListCall.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.DomainAliaseDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.DomainAliaseGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.DomainAliaseInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.DomainAliaseListCall.html) * domains - * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.DomainDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.DomainGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.DomainInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.DomainListCall.html) -* [groups](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Group.html) - * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.GroupAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.GroupAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.GroupAliaseListCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.GroupGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.GroupListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.GroupUpdateCall.html) -* [members](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Member.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.MemberDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.MemberGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.MemberInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.MemberListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.MemberPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.MemberUpdateCall.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.DomainDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.DomainGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.DomainInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.DomainListCall.html) +* [groups](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Group.html) + * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.GroupAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.GroupAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.GroupAliaseListCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.GroupDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.GroupGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.GroupListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.GroupPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.GroupUpdateCall.html) +* [members](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Member.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.MemberDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.MemberGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.MemberInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.MemberListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.MemberPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.MemberUpdateCall.html) * mobiledevices - * [*action*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.MobiledeviceActionCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.MobiledeviceDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.MobiledeviceGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.MobiledeviceListCall.html) -* [notifications](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Notification.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.NotificationGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.NotificationListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.NotificationPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.NotificationUpdateCall.html) + * [*action*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.MobiledeviceActionCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.MobiledeviceDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.MobiledeviceGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.MobiledeviceListCall.html) +* [notifications](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Notification.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.NotificationGetCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.NotificationListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.NotificationPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.NotificationUpdateCall.html) * orgunits - * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.OrgunitDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.OrgunitGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.OrgunitInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.OrgunitListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.OrgunitPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.OrgunitUpdateCall.html) -* [privileges](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Privilege.html) - * [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.PrivilegeListCall.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.OrgunitDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.OrgunitGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.OrgunitInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.OrgunitListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.OrgunitPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.OrgunitUpdateCall.html) +* [privileges](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Privilege.html) + * [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.PrivilegeListCall.html) * resources - * [*calendars delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ResourceCalendarDeleteCall.html), [*calendars get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ResourceCalendarGetCall.html), [*calendars insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ResourceCalendarInsertCall.html), [*calendars list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ResourceCalendarListCall.html), [*calendars patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ResourceCalendarPatchCall.html) and [*calendars update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.ResourceCalendarUpdateCall.html) -* [role assignments](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RoleAssignment.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RoleAssignmentDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RoleAssignmentGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RoleAssignmentInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RoleAssignmentListCall.html) -* [roles](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Role.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RoleDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RoleGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RoleInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RoleListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RolePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.RoleUpdateCall.html) -* [schemas](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Schema.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.SchemaDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.SchemaGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.SchemaInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.SchemaListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.SchemaPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.SchemaUpdateCall.html) -* [tokens](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Token.html) - * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.TokenDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.TokenGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.TokenListCall.html) -* [users](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.User.html) - * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserAliaseListCall.html), [*aliases watch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserAliaseWatchCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserListCall.html), [*make admin*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserMakeAdminCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserPatchCall.html), [*photos delete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserPhotoDeleteCall.html), [*photos get*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserPhotoGetCall.html), [*photos patch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserPhotoPatchCall.html), [*photos update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserPhotoUpdateCall.html), [*undelete*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserUndeleteCall.html), [*update*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserUpdateCall.html) and [*watch*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserWatchCall.html) -* [verification codes](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.VerificationCode.html) - * [*generate*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.VerificationCodeGenerateCall.html), [*invalidate*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.VerificationCodeInvalidateCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.VerificationCodeListCall.html) + * [*calendars delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ResourceCalendarDeleteCall.html), [*calendars get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ResourceCalendarGetCall.html), [*calendars insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ResourceCalendarInsertCall.html), [*calendars list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ResourceCalendarListCall.html), [*calendars patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ResourceCalendarPatchCall.html) and [*calendars update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.ResourceCalendarUpdateCall.html) +* [role assignments](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RoleAssignment.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RoleAssignmentDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RoleAssignmentGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RoleAssignmentInsertCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RoleAssignmentListCall.html) +* [roles](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Role.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RoleDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RoleGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RoleInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RoleListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RolePatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.RoleUpdateCall.html) +* [schemas](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Schema.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.SchemaDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.SchemaGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.SchemaInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.SchemaListCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.SchemaPatchCall.html) and [*update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.SchemaUpdateCall.html) +* [tokens](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.Token.html) + * [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.TokenDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.TokenGetCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.TokenListCall.html) +* [users](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.User.html) + * [*aliases delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserAliaseDeleteCall.html), [*aliases insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserAliaseInsertCall.html), [*aliases list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserAliaseListCall.html), [*aliases watch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserAliaseWatchCall.html), [*delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserDeleteCall.html), [*get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserGetCall.html), [*insert*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserInsertCall.html), [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserListCall.html), [*make admin*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserMakeAdminCall.html), [*patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserPatchCall.html), [*photos delete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserPhotoDeleteCall.html), [*photos get*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserPhotoGetCall.html), [*photos patch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserPhotoPatchCall.html), [*photos update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserPhotoUpdateCall.html), [*undelete*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserUndeleteCall.html), [*update*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserUpdateCall.html) and [*watch*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserWatchCall.html) +* [verification codes](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.VerificationCode.html) + * [*generate*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.VerificationCodeGenerateCall.html), [*invalidate*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.VerificationCodeInvalidateCall.html) and [*list*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.VerificationCodeListCall.html) Subscription supported by ... -* [*list users*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserListCall.html) -* [*watch users*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserWatchCall.html) -* [*aliases watch users*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserAliaseWatchCall.html) -* [*aliases list users*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.UserAliaseListCall.html) -* [*aliases list groups*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.GroupAliaseListCall.html) +* [*list users*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserListCall.html) +* [*watch users*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserWatchCall.html) +* [*aliases watch users*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserAliaseWatchCall.html) +* [*aliases list users*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.UserAliaseListCall.html) +* [*aliases list groups*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/struct.GroupAliaseListCall.html) @@ -67,17 +67,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/struct.Directory.html)** +* **[Hub](https://docs.rs/google-admin1_directory/1.0.4+20170419/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.4+20161124/google_admin1_directory/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-admin1_directory/1.0.4+20170419/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.4+20161124/google_admin1_directory/trait.Part.html)** + * **[Parts](https://docs.rs/google-admin1_directory/1.0.4+20170419/google_admin1_directory/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-admin1_directory/1.0.4+20161124/google_admin1_directory/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-admin1_directory/1.0.4+20170419/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. @@ -193,17 +193,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-admin1_directory/1.0.4+20161124/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.4+20170419/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.4+20161124/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.4+20170419/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.4+20161124/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.4+20170419/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.4+20161124/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.4+20170419/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")`. @@ -213,29 +213,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.4+20161124/google_admin1_directory/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-admin1_directory/1.0.4+20161124/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.4+20170419/google_admin1_directory/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-admin1_directory/1.0.4+20170419/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.4+20161124/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.4+20170419/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.4+20161124/google_admin1_directory/trait.RequestValue.html) and -[decodable](https://docs.rs/google-admin1_directory/1.0.4+20161124/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.4+20170419/google_admin1_directory/trait.RequestValue.html) and +[decodable](https://docs.rs/google-admin1_directory/1.0.4+20170419/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.4+20161124/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.4+20170419/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.4+20161124/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.4+20170419/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.4+20161124/google_admin1_directory/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-admin1_directory/1.0.4+20170419/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 bc207b77cf..845eeac78b 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.4+20161124*, where *20161124* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *directory* crate version *1.0.4+20170419*, where *20170419* is the exact revision of the *admin:directory_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *directory* *v1_directory* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/directory/). @@ -248,7 +248,7 @@ // 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 +// 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)] @@ -495,8 +495,6 @@ pub struct Directory { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Directory {} @@ -509,8 +507,6 @@ impl<'a, C, A> Directory client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/admin/directory/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -581,26 +577,6 @@ impl<'a, C, A> Directory self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/admin/directory/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1344,7 +1320,7 @@ pub struct ChromeOsDevice { /// 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 Google Apps administrator control panel (Read-only) + /// 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) @@ -1441,7 +1417,12 @@ pub struct User { /// no description provided pub addresses: Option, /// no description provided + #[serde(rename="posixAccounts")] + pub posix_accounts: Option, + /// no description provided pub phones: Option, + /// no description provided + pub locations: Option, /// Boolean indicating if the user is delegated admin (Read-only) #[serde(rename="isDelegatedAdmin")] pub is_delegated_admin: Option, @@ -1469,14 +1450,17 @@ pub struct User { /// Photo Url of the user (Read-only) #[serde(rename="thumbnailPhotoUrl")] pub thumbnail_photo_url: Option, - /// Boolean indicating if the user is admin (Read-only) - #[serde(rename="isAdmin")] - pub is_admin: Option, - /// no description provided - pub relations: Option, + /// Is enrolled in 2-step verification (Read-only) + #[serde(rename="isEnrolledIn2Sv")] + pub is_enrolled_in2_sv: Option, /// Boolean indicating if user is included in Global Address List #[serde(rename="includeInGlobalAddressList")] pub include_in_global_address_list: Option, + /// no description provided + pub relations: Option, + /// Boolean indicating if the user is admin (Read-only) + #[serde(rename="isAdmin")] + pub is_admin: Option, /// ETag of the resource. pub etag: Option, /// User's last login time. (Read-only) @@ -1494,8 +1478,14 @@ pub struct User { /// Boolean indicating if ip is whitelisted #[serde(rename="ipWhitelisted")] pub ip_whitelisted: Option, + /// no description provided + #[serde(rename="sshPublicKeys")] + pub ssh_public_keys: Option, /// Kind of resource this is. pub kind: Option, + /// Is 2-step verification enforced (Read-only) + #[serde(rename="isEnforcedIn2Sv")] + pub is_enforced_in2_sv: Option, /// Is mailbox setup (Read-only) #[serde(rename="isMailboxSetup")] pub is_mailbox_setup: Option, @@ -1515,7 +1505,7 @@ pub struct User { pub name: Option, /// no description provided pub notes: Option, - /// User's Google account creation time. (Read-only) + /// User's G Suite account creation time. (Read-only) #[serde(rename="creationTime")] pub creation_time: Option, /// no description provided @@ -1603,6 +1593,29 @@ impl NestedType for MobileDeviceApplications {} impl Part for MobileDeviceApplications {} +/// 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 {} + + /// JSON response template for List Members operation in Directory API. /// /// # Activities @@ -1662,7 +1675,7 @@ pub struct Customer { /// The customer's postal address information. #[serde(rename="postalAddress")] pub postal_address: Option, - /// The unique ID for the customer's Google account. (Readonly) + /// The unique ID for the customer's G Suite account. (Readonly) pub id: Option, } @@ -1805,6 +1818,35 @@ 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 @@ -1830,21 +1872,26 @@ pub struct MobileDevices { impl ResponseResult for MobileDevices {} -/// List of active time ranges (Read-only) +/// JSON response template to list Domains in Directory 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*). +/// +/// * [list domains](struct.DomainListCall.html) (response) /// #[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, +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 NestedType for ChromeOsDeviceActiveTimeRanges {} -impl Part for ChromeOsDeviceActiveTimeRanges {} +impl ResponseResult for Domains2 {} /// JSON template for Photo object in Directory API. @@ -1948,35 +1995,6 @@ pub struct Users { impl ResponseResult for Users {} -/// 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 template for Mobile Device resource in Directory API. /// /// # Activities @@ -1988,7 +2006,7 @@ impl ResponseResult for Alias {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MobileDevice { - /// Date and time the device was last synchronized with the policy settings in the Google Apps administrator control panel (Read-only) + /// 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, /// Mobile Device compromised status (Read-only) @@ -2005,7 +2023,7 @@ pub struct MobileDevice { /// Mobile Device user agent #[serde(rename="userAgent")] pub user_agent: Option, - /// Date and time the device was first synchronized with the policy settings in the Google Apps administrator control panel (Read-only) + /// Date and time the device was first synchronized with the policy settings in the G Suite administrator control panel (Read-only) #[serde(rename="firstSync")] pub first_sync: Option, /// List of accounts added on device (Read-only) @@ -2100,28 +2118,6 @@ impl Resource for MobileDevice {} impl ResponseResult for MobileDevice {} -/// 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 domains](struct.DomainListCall.html) (response) -/// -#[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, -} - -impl ResponseResult for Domains2 {} - - /// JSON template for token resource in Directory API. /// /// # Activities @@ -2205,6 +2201,23 @@ impl Resource for OrgUnit {} impl ResponseResult for OrgUnit {} +/// 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 @@ -2272,27 +2285,26 @@ impl NestedType for SchemaFieldSpecNumericIndexingSpec {} impl Part for SchemaFieldSpecNumericIndexingSpec {} -/// JSON response template to list aliases 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*). /// -/// * [aliases list users](struct.UserAliaseListCall.html) (response) -/// * [aliases list groups](struct.GroupAliaseListCall.html) (response) +/// * [list schemas](struct.SchemaListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Aliases { +pub struct Schemas { /// Kind of resource this is. pub kind: Option, /// ETag of the resource. pub etag: Option, - /// List of alias objects. - pub aliases: Option>, + /// List of UserSchema objects. + pub schemas: Option>, } -impl ResponseResult for Aliases {} +impl ResponseResult for Schemas {} /// JSON template for Calendar Resource List Response object in Directory API. @@ -2320,28 +2332,6 @@ pub struct CalendarResources { impl ResponseResult for CalendarResources {} -/// 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 {} - - // ################### // MethodBuilders ### @@ -2579,7 +2569,7 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account pub fn list(&self, customer_id: &str) -> OrgunitListCall<'a, C, A> { OrgunitListCall { hub: self.hub, @@ -2599,7 +2589,7 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account pub fn insert(&self, request: OrgUnit, customer_id: &str) -> OrgunitInsertCall<'a, C, A> { OrgunitInsertCall { hub: self.hub, @@ -2618,7 +2608,7 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account /// * `orgUnitPath` - Full path of the organization unit or its Id pub fn update(&self, request: OrgUnit, customer_id: &str, org_unit_path: &Vec) -> OrgunitUpdateCall<'a, C, A> { OrgunitUpdateCall { @@ -2638,7 +2628,7 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account + /// * `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 { @@ -2657,7 +2647,7 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account /// * `orgUnitPath` - Full path of the organization unit or its Id pub fn get(&self, customer_id: &str, org_unit_path: &Vec) -> OrgunitGetCall<'a, C, A> { OrgunitGetCall { @@ -2677,7 +2667,7 @@ impl<'a, C, A> OrgunitMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account /// * `orgUnitPath` - Full path of the organization unit or its Id pub fn patch(&self, request: OrgUnit, customer_id: &str, org_unit_path: &Vec) -> OrgunitPatchCall<'a, C, A> { OrgunitPatchCall { @@ -2899,7 +2889,7 @@ impl<'a, C, A> RoleMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - Immutable ID of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. /// * `roleId` - Immutable ID of the role. pub fn update(&self, request: Role, customer: &str, role_id: &str) -> RoleUpdateCall<'a, C, A> { RoleUpdateCall { @@ -2919,7 +2909,7 @@ impl<'a, C, A> RoleMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable ID of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. /// * `roleId` - Immutable ID of the role. pub fn get(&self, customer: &str, role_id: &str) -> RoleGetCall<'a, C, A> { RoleGetCall { @@ -2938,7 +2928,7 @@ impl<'a, C, A> RoleMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable ID of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. /// * `roleId` - Immutable ID of the role. pub fn delete(&self, customer: &str, role_id: &str) -> RoleDeleteCall<'a, C, A> { RoleDeleteCall { @@ -2958,7 +2948,7 @@ impl<'a, C, A> RoleMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - Immutable ID of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. /// * `roleId` - Immutable ID of the role. pub fn patch(&self, request: Role, customer: &str, role_id: &str) -> RolePatchCall<'a, C, A> { RolePatchCall { @@ -2979,7 +2969,7 @@ impl<'a, C, A> RoleMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - Immutable ID of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. pub fn insert(&self, request: Role, customer: &str) -> RoleInsertCall<'a, C, A> { RoleInsertCall { hub: self.hub, @@ -2997,7 +2987,7 @@ impl<'a, C, A> RoleMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable id of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. pub fn list(&self, customer: &str) -> RoleListCall<'a, C, A> { RoleListCall { hub: self.hub, @@ -3057,7 +3047,7 @@ impl<'a, C, A> NotificationMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - The unique ID for the customer's Google account. + /// * `customer` - The unique ID for the customer's G Suite account. pub fn list(&self, customer: &str) -> NotificationListCall<'a, C, A> { NotificationListCall { hub: self.hub, @@ -3078,7 +3068,7 @@ impl<'a, C, A> NotificationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - The unique ID for the customer's Google account. + /// * `customer` - The unique ID for the customer's G Suite account. /// * `notificationId` - The unique ID of the notification. pub fn update(&self, request: Notification, customer: &str, notification_id: &str) -> NotificationUpdateCall<'a, C, A> { NotificationUpdateCall { @@ -3098,7 +3088,7 @@ impl<'a, C, A> NotificationMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - The unique ID for the customer's Google account. The customerId is also returned as part of the Users resource. + /// * `customer` - The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource. /// * `notificationId` - The unique ID of the notification. pub fn delete(&self, customer: &str, notification_id: &str) -> NotificationDeleteCall<'a, C, A> { NotificationDeleteCall { @@ -3117,7 +3107,7 @@ impl<'a, C, A> NotificationMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - The unique ID for the customer's Google account. The customerId is also returned as part of the Users resource. + /// * `customer` - The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource. /// * `notificationId` - The unique ID of the notification. pub fn get(&self, customer: &str, notification_id: &str) -> NotificationGetCall<'a, C, A> { NotificationGetCall { @@ -3137,7 +3127,7 @@ impl<'a, C, A> NotificationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - The unique ID for the customer's Google account. + /// * `customer` - The unique ID for the customer's G Suite account. /// * `notificationId` - The unique ID of the notification. pub fn patch(&self, request: Notification, customer: &str, notification_id: &str) -> NotificationPatchCall<'a, C, A> { NotificationPatchCall { @@ -3198,7 +3188,7 @@ impl<'a, C, A> PrivilegeMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable ID of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. pub fn list(&self, customer: &str) -> PrivilegeListCall<'a, C, A> { PrivilegeListCall { hub: self.hub, @@ -3314,8 +3304,8 @@ impl<'a, C, A> MobiledeviceMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account - /// * `resourceId` - Immutable id of Mobile Device + /// * `customerId` - Immutable ID of the G Suite account + /// * `resourceId` - Immutable ID of Mobile Device pub fn get(&self, customer_id: &str, resource_id: &str) -> MobiledeviceGetCall<'a, C, A> { MobiledeviceGetCall { hub: self.hub, @@ -3334,7 +3324,7 @@ impl<'a, C, A> MobiledeviceMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account pub fn list(&self, customer_id: &str) -> MobiledeviceListCall<'a, C, A> { MobiledeviceListCall { hub: self.hub, @@ -3357,8 +3347,8 @@ impl<'a, C, A> MobiledeviceMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account - /// * `resourceId` - Immutable id of Mobile Device + /// * `customerId` - Immutable ID of the G Suite account + /// * `resourceId` - Immutable ID of Mobile Device pub fn delete(&self, customer_id: &str, resource_id: &str) -> MobiledeviceDeleteCall<'a, C, A> { MobiledeviceDeleteCall { hub: self.hub, @@ -3377,8 +3367,8 @@ impl<'a, C, A> MobiledeviceMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customerId` - Immutable id of the Google Apps account - /// * `resourceId` - Immutable id of Mobile Device + /// * `customerId` - Immutable ID of the G Suite account + /// * `resourceId` - Immutable ID of Mobile Device pub fn action(&self, request: MobileDeviceAction, customer_id: &str, resource_id: &str) -> MobiledeviceActionCall<'a, C, A> { MobiledeviceActionCall { hub: self.hub, @@ -3535,7 +3525,7 @@ impl<'a, C, A> RoleAssignmentMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - Immutable ID of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. pub fn insert(&self, request: RoleAssignment, customer: &str) -> RoleAssignmentInsertCall<'a, C, A> { RoleAssignmentInsertCall { hub: self.hub, @@ -3553,7 +3543,7 @@ impl<'a, C, A> RoleAssignmentMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable ID of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. /// * `roleAssignmentId` - Immutable ID of the role assignment. pub fn get(&self, customer: &str, role_assignment_id: &str) -> RoleAssignmentGetCall<'a, C, A> { RoleAssignmentGetCall { @@ -3572,7 +3562,7 @@ impl<'a, C, A> RoleAssignmentMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable ID of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. /// * `roleAssignmentId` - Immutable ID of the role assignment. pub fn delete(&self, customer: &str, role_assignment_id: &str) -> RoleAssignmentDeleteCall<'a, C, A> { RoleAssignmentDeleteCall { @@ -3591,7 +3581,7 @@ impl<'a, C, A> RoleAssignmentMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable ID of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. pub fn list(&self, customer: &str) -> RoleAssignmentListCall<'a, C, A> { RoleAssignmentListCall { hub: self.hub, @@ -3653,7 +3643,7 @@ impl<'a, C, A> ChromeosdeviceMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account pub fn list(&self, customer_id: &str) -> ChromeosdeviceListCall<'a, C, A> { ChromeosdeviceListCall { hub: self.hub, @@ -3677,8 +3667,8 @@ impl<'a, C, A> ChromeosdeviceMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customerId` - Immutable id of the Google Apps account - /// * `deviceId` - Immutable id of Chrome OS Device + /// * `customerId` - Immutable ID of the G Suite account + /// * `deviceId` - Immutable ID of Chrome OS Device pub fn patch(&self, request: ChromeOsDevice, customer_id: &str, device_id: &str) -> ChromeosdevicePatchCall<'a, C, A> { ChromeosdevicePatchCall { hub: self.hub, @@ -3699,8 +3689,8 @@ impl<'a, C, A> ChromeosdeviceMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customerId` - Immutable id of the Google Apps account - /// * `deviceId` - Immutable id of Chrome OS Device + /// * `customerId` - Immutable ID of the G Suite account + /// * `deviceId` - Immutable ID of Chrome OS Device pub fn update(&self, request: ChromeOsDevice, customer_id: &str, device_id: &str) -> ChromeosdeviceUpdateCall<'a, C, A> { ChromeosdeviceUpdateCall { hub: self.hub, @@ -3720,8 +3710,8 @@ impl<'a, C, A> ChromeosdeviceMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account - /// * `deviceId` - Immutable id of Chrome OS Device + /// * `customerId` - Immutable ID of the G Suite account + /// * `deviceId` - Immutable ID of Chrome OS Device pub fn get(&self, customer_id: &str, device_id: &str) -> ChromeosdeviceGetCall<'a, C, A> { ChromeosdeviceGetCall { hub: self.hub, @@ -3741,8 +3731,8 @@ impl<'a, C, A> ChromeosdeviceMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customerId` - Immutable id of the Google Apps account - /// * `resourceId` - Immutable id of Chrome OS Device + /// * `customerId` - Immutable ID of the G Suite account + /// * `resourceId` - Immutable ID of Chrome OS Device pub fn action(&self, request: ChromeOsDeviceAction, customer_id: &str, resource_id: &str) -> ChromeosdeviceActionCall<'a, C, A> { ChromeosdeviceActionCall { hub: self.hub, @@ -4100,7 +4090,7 @@ impl<'a, C, A> DomainMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable id of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. pub fn list(&self, customer: &str) -> DomainListCall<'a, C, A> { DomainListCall { hub: self.hub, @@ -4117,7 +4107,7 @@ impl<'a, C, A> DomainMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable id of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. /// * `domainName` - Name of domain to be retrieved pub fn get(&self, customer: &str, domain_name: &str) -> DomainGetCall<'a, C, A> { DomainGetCall { @@ -4137,7 +4127,7 @@ impl<'a, C, A> DomainMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - Immutable id of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. pub fn insert(&self, request: Domains, customer: &str) -> DomainInsertCall<'a, C, A> { DomainInsertCall { hub: self.hub, @@ -4155,7 +4145,7 @@ impl<'a, C, A> DomainMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable id of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. /// * `domainName` - Name of domain to be deleted pub fn delete(&self, customer: &str, domain_name: &str) -> DomainDeleteCall<'a, C, A> { DomainDeleteCall { @@ -4216,7 +4206,7 @@ impl<'a, C, A> DomainAliaseMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - Immutable id of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. pub fn insert(&self, request: DomainAlias, customer: &str) -> DomainAliaseInsertCall<'a, C, A> { DomainAliaseInsertCall { hub: self.hub, @@ -4234,7 +4224,7 @@ impl<'a, C, A> DomainAliaseMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable id of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. /// * `domainAliasName` - Name of domain alias to be retrieved. pub fn get(&self, customer: &str, domain_alias_name: &str) -> DomainAliaseGetCall<'a, C, A> { DomainAliaseGetCall { @@ -4253,7 +4243,7 @@ impl<'a, C, A> DomainAliaseMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable id of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. pub fn list(&self, customer: &str) -> DomainAliaseListCall<'a, C, A> { DomainAliaseListCall { hub: self.hub, @@ -4271,7 +4261,7 @@ impl<'a, C, A> DomainAliaseMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - Immutable id of the Google Apps account. + /// * `customer` - Immutable ID of the G Suite account. /// * `domainAliasName` - Name of domain alias to be retrieved. pub fn delete(&self, customer: &str, domain_alias_name: &str) -> DomainAliaseDeleteCall<'a, C, A> { DomainAliaseDeleteCall { @@ -4331,7 +4321,7 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account /// * `schemaKey` - Name or immutable Id of the schema pub fn get(&self, customer_id: &str, schema_key: &str) -> SchemaGetCall<'a, C, A> { SchemaGetCall { @@ -4351,7 +4341,7 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account /// * `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 { @@ -4371,7 +4361,7 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account pub fn list(&self, customer_id: &str) -> SchemaListCall<'a, C, A> { SchemaListCall { hub: self.hub, @@ -4389,7 +4379,7 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account /// * `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 { @@ -4409,7 +4399,7 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { /// /// # Arguments /// - /// * `customerId` - Immutable id of the Google Apps account + /// * `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 { @@ -4429,7 +4419,7 @@ impl<'a, C, A> SchemaMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customerId` - Immutable id of the Google Apps account + /// * `customerId` - Immutable ID of the G Suite account pub fn insert(&self, request: Schema, customer_id: &str) -> SchemaInsertCall<'a, C, A> { SchemaInsertCall { hub: self.hub, @@ -4488,7 +4478,7 @@ impl<'a, C, A> ResourceMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + /// * `customer` - The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. pub fn calendars_list(&self, customer: &str) -> ResourceCalendarListCall<'a, C, A> { ResourceCalendarListCall { hub: self.hub, @@ -4507,7 +4497,7 @@ impl<'a, C, A> ResourceMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + /// * `customer` - The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. /// * `calendarResourceId` - The unique ID of the calendar resource to retrieve. pub fn calendars_get(&self, customer: &str, calendar_resource_id: &str) -> ResourceCalendarGetCall<'a, C, A> { ResourceCalendarGetCall { @@ -4527,7 +4517,7 @@ impl<'a, C, A> ResourceMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + /// * `customer` - The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. pub fn calendars_insert(&self, request: CalendarResource, customer: &str) -> ResourceCalendarInsertCall<'a, C, A> { ResourceCalendarInsertCall { hub: self.hub, @@ -4546,7 +4536,7 @@ impl<'a, C, A> ResourceMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + /// * `customer` - The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. /// * `calendarResourceId` - The unique ID of the calendar resource to update. pub fn calendars_patch(&self, request: CalendarResource, customer: &str, calendar_resource_id: &str) -> ResourceCalendarPatchCall<'a, C, A> { ResourceCalendarPatchCall { @@ -4567,7 +4557,7 @@ impl<'a, C, A> ResourceMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `customer` - The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + /// * `customer` - The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. /// * `calendarResourceId` - The unique ID of the calendar resource to update. pub fn calendars_update(&self, request: CalendarResource, customer: &str, calendar_resource_id: &str) -> ResourceCalendarUpdateCall<'a, C, A> { ResourceCalendarUpdateCall { @@ -4587,7 +4577,7 @@ impl<'a, C, A> ResourceMethods<'a, C, A> { /// /// # Arguments /// - /// * `customer` - The unique ID for the customer's Google account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. + /// * `customer` - The unique ID for the customer's G Suite account. As an account administrator, you can also use the my_customer alias to represent your account's customer ID. /// * `calendarResourceId` - The unique ID of the calendar resource to delete. pub fn calendars_delete(&self, customer: &str, calendar_resource_id: &str) -> ResourceCalendarDeleteCall<'a, C, A> { ResourceCalendarDeleteCall { @@ -5050,7 +5040,7 @@ impl<'a, C, A> VerificationCodeGenerateCall<'a, C, A> where C: BorrowMut VerificationCodeInvalidateCall<'a, C, A> where C: BorrowMut VerificationCodeListCall<'a, C, A> where C: BorrowMut CustomerPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customers/{customerKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customers/{customerKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryCustomer.as_ref().to_string(), ()); } @@ -6000,7 +5990,7 @@ impl<'a, C, A> CustomerGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customers/{customerKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customers/{customerKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryCustomerReadonly.as_ref().to_string(), ()); } @@ -6242,7 +6232,7 @@ impl<'a, C, A> CustomerUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customers/{customerKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customers/{customerKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryCustomer.as_ref().to_string(), ()); } @@ -6511,7 +6501,7 @@ impl<'a, C, A> OrgunitListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunitReadonly.as_ref().to_string(), ()); } @@ -6614,7 +6604,7 @@ impl<'a, C, A> OrgunitListCall<'a, C, A> where C: BorrowMut, A: o } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -6767,7 +6757,7 @@ impl<'a, C, A> OrgunitInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunit.as_ref().to_string(), ()); } @@ -6894,7 +6884,7 @@ impl<'a, C, A> OrgunitInsertCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -7039,7 +7029,7 @@ impl<'a, C, A> OrgunitUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits{/orgUnitPath*}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunit.as_ref().to_string(), ()); } @@ -7166,7 +7156,7 @@ impl<'a, C, A> OrgunitUpdateCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -7314,7 +7304,7 @@ impl<'a, C, A> OrgunitDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits{/orgUnitPath*}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunit.as_ref().to_string(), ()); } @@ -7407,7 +7397,7 @@ impl<'a, C, A> OrgunitDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -7556,7 +7546,7 @@ impl<'a, C, A> OrgunitGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits{/orgUnitPath*}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunitReadonly.as_ref().to_string(), ()); } @@ -7659,7 +7649,7 @@ impl<'a, C, A> OrgunitGetCall<'a, C, A> where C: BorrowMut, A: oa } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -7815,7 +7805,7 @@ impl<'a, C, A> OrgunitPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/orgunits{/orgUnitPath*}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/orgunits{/orgUnitPath*}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryOrgunit.as_ref().to_string(), ()); } @@ -7942,7 +7932,7 @@ impl<'a, C, A> OrgunitPatchCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -8092,7 +8082,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 = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -8360,7 +8350,7 @@ 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 = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members/{memberKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -8638,7 +8628,7 @@ impl<'a, C, A> MemberUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members/{memberKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -8922,7 +8912,7 @@ impl<'a, C, A> MemberListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members"; + let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroupMemberReadonly.as_ref().to_string(), ()); } @@ -9180,7 +9170,7 @@ impl<'a, C, A> MemberGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/members/{memberKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members/{memberKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroupMemberReadonly.as_ref().to_string(), ()); } @@ -9426,7 +9416,7 @@ 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 = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/members/{memberKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -9670,7 +9660,7 @@ impl<'a, C, A> RoleUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/roles/{roleId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles/{roleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagement.as_ref().to_string(), ()); } @@ -9797,7 +9787,7 @@ impl<'a, C, A> RoleUpdateCall<'a, C, A> where C: BorrowMut, A: oa self._request = new_value; self } - /// Immutable ID of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -9941,7 +9931,7 @@ impl<'a, C, A> RoleGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/roles/{roleId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles/{roleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagementReadonly.as_ref().to_string(), ()); } @@ -10044,7 +10034,7 @@ impl<'a, C, A> RoleGetCall<'a, C, A> where C: BorrowMut, A: oauth } - /// Immutable ID of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -10187,7 +10177,7 @@ impl<'a, C, A> RoleDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "customer/{customer}/roles/{roleId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles/{roleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagement.as_ref().to_string(), ()); } @@ -10280,7 +10270,7 @@ impl<'a, C, A> RoleDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - /// Immutable ID of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -10431,7 +10421,7 @@ impl<'a, C, A> RolePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/roles/{roleId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles/{roleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagement.as_ref().to_string(), ()); } @@ -10558,7 +10548,7 @@ impl<'a, C, A> RolePatchCall<'a, C, A> where C: BorrowMut, A: oau self._request = new_value; self } - /// Immutable ID of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -10707,7 +10697,7 @@ impl<'a, C, A> RoleInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/roles"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagement.as_ref().to_string(), ()); } @@ -10834,7 +10824,7 @@ impl<'a, C, A> RoleInsertCall<'a, C, A> where C: BorrowMut, A: oa self._request = new_value; self } - /// Immutable ID of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -10976,7 +10966,7 @@ impl<'a, C, A> RoleListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/roles"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagementReadonly.as_ref().to_string(), ()); } @@ -11079,7 +11069,7 @@ impl<'a, C, A> RoleListCall<'a, C, A> where C: BorrowMut, A: oaut } - /// Immutable id of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -11240,7 +11230,7 @@ impl<'a, C, A> NotificationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/notifications"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/notifications".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryNotification.as_ref().to_string(), ()); } @@ -11343,7 +11333,7 @@ impl<'a, C, A> NotificationListCall<'a, C, A> where C: BorrowMut, } - /// The unique ID for the customer's Google account. + /// The unique ID for the customer's G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -11505,7 +11495,7 @@ impl<'a, C, A> NotificationUpdateCall<'a, C, A> where C: BorrowMut NotificationUpdateCall<'a, C, A> where C: BorrowMut NotificationDeleteCall<'a, C, A> where C: BorrowMut NotificationDeleteCall<'a, C, A> where C: BorrowMut NotificationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/notifications/{notificationId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/notifications/{notificationId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryNotification.as_ref().to_string(), ()); } @@ -12115,7 +12105,7 @@ impl<'a, C, A> NotificationGetCall<'a, C, A> where C: BorrowMut, } - /// The unique ID for the customer's Google account. The customerId is also returned as part of the Users resource. + /// The unique ID for the customer's G Suite account. The customerId is also returned as part of the Users resource. /// /// Sets the *customer* path property to the given value. /// @@ -12266,7 +12256,7 @@ impl<'a, C, A> NotificationPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/notifications/{notificationId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/notifications/{notificationId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryNotification.as_ref().to_string(), ()); } @@ -12393,7 +12383,7 @@ impl<'a, C, A> NotificationPatchCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// The unique ID for the customer's Google account. + /// The unique ID for the customer's G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -12535,7 +12525,7 @@ impl<'a, C, A> PrivilegeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/roles/ALL/privileges"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roles/ALL/privileges".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagementReadonly.as_ref().to_string(), ()); } @@ -12638,7 +12628,7 @@ impl<'a, C, A> PrivilegeListCall<'a, C, A> where C: BorrowMut, A: } - /// Immutable ID of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -12774,7 +12764,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "/admin/directory_v1/channels/stop"; + let mut url = "https://www.googleapis.com/admin/directory/v1//admin/directory_v1/channels/stop".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -12999,7 +12989,7 @@ impl<'a, C, A> MobiledeviceGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/devices/mobile/{resourceId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/devices/mobile/{resourceId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDeviceMobileReadonly.as_ref().to_string(), ()); } @@ -13102,7 +13092,7 @@ impl<'a, C, A> MobiledeviceGetCall<'a, C, A> where C: BorrowMut, } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -13112,7 +13102,7 @@ impl<'a, C, A> MobiledeviceGetCall<'a, C, A> where C: BorrowMut, self._customer_id = new_value.to_string(); self } - /// Immutable id of Mobile Device + /// Immutable ID of Mobile Device /// /// Sets the *resource id* path property to the given value. /// @@ -13281,7 +13271,7 @@ impl<'a, C, A> MobiledeviceListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/devices/mobile"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/devices/mobile".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDeviceMobileReadonly.as_ref().to_string(), ()); } @@ -13384,7 +13374,7 @@ impl<'a, C, A> MobiledeviceListCall<'a, C, A> where C: BorrowMut, } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -13559,7 +13549,7 @@ impl<'a, C, A> MobiledeviceDeleteCall<'a, C, A> where C: BorrowMut MobiledeviceDeleteCall<'a, C, A> where C: BorrowMut MobiledeviceDeleteCall<'a, C, A> where C: BorrowMut MobiledeviceActionCall<'a, C, A> where C: BorrowMut MobiledeviceActionCall<'a, C, A> where C: BorrowMut MobiledeviceActionCall<'a, C, A> where C: BorrowMut TokenGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}/tokens/{clientId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/tokens/{clientId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -14308,7 +14298,7 @@ impl<'a, C, A> TokenListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}/tokens"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/tokens".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -14544,7 +14534,7 @@ impl<'a, C, A> TokenDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "users/{userKey}/tokens/{clientId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/tokens/{clientId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -14786,7 +14776,7 @@ impl<'a, C, A> RoleAssignmentInsertCall<'a, C, A> where C: BorrowMut RoleAssignmentInsertCall<'a, C, A> where C: BorrowMut RoleAssignmentGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/roleassignments/{roleAssignmentId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/roleassignments/{roleAssignmentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryRolemanagementReadonly.as_ref().to_string(), ()); } @@ -15150,7 +15140,7 @@ impl<'a, C, A> RoleAssignmentGetCall<'a, C, A> where C: BorrowMut } - /// Immutable ID of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -15293,7 +15283,7 @@ impl<'a, C, A> RoleAssignmentDeleteCall<'a, C, A> where C: BorrowMut RoleAssignmentDeleteCall<'a, C, A> where C: BorrowMut RoleAssignmentListCall<'a, C, A> where C: BorrowMut RoleAssignmentListCall<'a, C, A> where C: BorrowMut ChromeosdeviceListCall<'a, C, A> where C: BorrowMut ChromeosdeviceListCall<'a, C, A> where C: BorrowMut ChromeosdevicePatchCall<'a, C, A> where C: BorrowMut ChromeosdevicePatchCall<'a, C, A> where C: BorrowMut ChromeosdevicePatchCall<'a, C, A> where C: BorrowMut ChromeosdeviceUpdateCall<'a, C, A> where C: BorrowMut ChromeosdeviceUpdateCall<'a, C, A> where C: BorrowMut ChromeosdeviceUpdateCall<'a, C, A> where C: BorrowMut ChromeosdeviceGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/devices/chromeos/{deviceId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/devices/chromeos/{deviceId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDeviceChromeoReadonly.as_ref().to_string(), ()); } @@ -16808,7 +16798,7 @@ impl<'a, C, A> ChromeosdeviceGetCall<'a, C, A> where C: BorrowMut } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -16818,7 +16808,7 @@ impl<'a, C, A> ChromeosdeviceGetCall<'a, C, A> where C: BorrowMut self._customer_id = new_value.to_string(); self } - /// Immutable id of Chrome OS Device + /// Immutable ID of Chrome OS Device /// /// Sets the *device id* path property to the given value. /// @@ -16965,7 +16955,7 @@ impl<'a, C, A> ChromeosdeviceActionCall<'a, C, A> where C: BorrowMut ChromeosdeviceActionCall<'a, C, A> where C: BorrowMut ChromeosdeviceActionCall<'a, C, A> where C: BorrowMut GroupDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -17471,7 +17461,7 @@ 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 = "https://www.googleapis.com/admin/directory/v1/groups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); } @@ -17581,7 +17571,7 @@ impl<'a, C, A> GroupListCall<'a, C, A> where C: BorrowMut, A: oau self._domain = Some(new_value.to_string()); self } - /// Immutable id of the Google Apps account. In case of multi-domain, to fetch all groups for a customer, fill this field instead of domain. + /// 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> { @@ -17717,7 +17707,7 @@ impl<'a, C, A> GroupUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -17981,7 +17971,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups"; + let mut url = "https://www.googleapis.com/admin/directory/v1/groups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -18216,7 +18206,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 = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/aliases".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -18475,7 +18465,7 @@ impl<'a, C, A> GroupAliaseListCall<'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 = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/aliases".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); } @@ -18710,7 +18700,7 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups/{groupKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroupReadonly.as_ref().to_string(), ()); } @@ -18952,7 +18942,7 @@ 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 = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -19212,7 +19202,7 @@ impl<'a, C, A> GroupAliaseDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "groups/{groupKey}/aliases/{alias}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/groups/{groupKey}/aliases/{alias}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryGroup.as_ref().to_string(), ()); } @@ -19449,7 +19439,7 @@ impl<'a, C, A> AspGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}/asps/{codeId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/asps/{codeId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -19695,7 +19685,7 @@ impl<'a, C, A> AspDeleteCall<'a, C, A> where C: BorrowMut, A: oau } - let mut url = self.hub._base_url.clone() + "users/{userKey}/asps/{codeId}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/asps/{codeId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -19930,7 +19920,7 @@ impl<'a, C, A> AspListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}/asps"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/asps".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserSecurity.as_ref().to_string(), ()); } @@ -20165,7 +20155,7 @@ impl<'a, C, A> DomainListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/domains"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domains".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); } @@ -20268,7 +20258,7 @@ impl<'a, C, A> DomainListCall<'a, C, A> where C: BorrowMut, A: oa } - /// Immutable id of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -20402,7 +20392,7 @@ impl<'a, C, A> DomainGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/domains/{domainName}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domains/{domainName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); } @@ -20505,7 +20495,7 @@ impl<'a, C, A> DomainGetCall<'a, C, A> where C: BorrowMut, A: oau } - /// Immutable id of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -20654,7 +20644,7 @@ impl<'a, C, A> DomainInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/domains"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domains".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomain.as_ref().to_string(), ()); } @@ -20781,7 +20771,7 @@ impl<'a, C, A> DomainInsertCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Immutable id of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -20914,7 +20904,7 @@ impl<'a, C, A> DomainDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "customer/{customer}/domains/{domainName}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domains/{domainName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomain.as_ref().to_string(), ()); } @@ -21007,7 +20997,7 @@ impl<'a, C, A> DomainDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// Immutable id of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -21156,7 +21146,7 @@ impl<'a, C, A> DomainAliaseInsertCall<'a, C, A> where C: BorrowMut DomainAliaseInsertCall<'a, C, A> where C: BorrowMut DomainAliaseGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/domainaliases/{domainAliasName}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domainaliases/{domainAliasName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); } @@ -21520,7 +21510,7 @@ impl<'a, C, A> DomainAliaseGetCall<'a, C, A> where C: BorrowMut, } - /// Immutable id of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -21667,7 +21657,7 @@ impl<'a, C, A> DomainAliaseListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customer}/domainaliases"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customer}/domainaliases".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryDomainReadonly.as_ref().to_string(), ()); } @@ -21770,7 +21760,7 @@ impl<'a, C, A> DomainAliaseListCall<'a, C, A> where C: BorrowMut, } - /// Immutable id of the Google Apps account. + /// Immutable ID of the G Suite account. /// /// Sets the *customer* path property to the given value. /// @@ -21910,7 +21900,7 @@ impl<'a, C, A> DomainAliaseDeleteCall<'a, C, A> where C: BorrowMut DomainAliaseDeleteCall<'a, C, A> where C: BorrowMut SchemaGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas/{schemaKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschemaReadonly.as_ref().to_string(), ()); } @@ -22250,7 +22240,7 @@ impl<'a, C, A> SchemaGetCall<'a, C, A> where C: BorrowMut, A: oau } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -22401,7 +22391,7 @@ impl<'a, C, A> SchemaUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas/{schemaKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschema.as_ref().to_string(), ()); } @@ -22528,7 +22518,7 @@ impl<'a, C, A> SchemaUpdateCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -22670,7 +22660,7 @@ impl<'a, C, A> SchemaListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschemaReadonly.as_ref().to_string(), ()); } @@ -22773,7 +22763,7 @@ impl<'a, C, A> SchemaListCall<'a, C, A> where C: BorrowMut, A: oa } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -22914,7 +22904,7 @@ impl<'a, C, A> SchemaPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas/{schemaKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschema.as_ref().to_string(), ()); } @@ -23041,7 +23031,7 @@ impl<'a, C, A> SchemaPatchCall<'a, C, A> where C: BorrowMut, A: o self._request = new_value; self } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -23184,7 +23174,7 @@ impl<'a, C, A> SchemaDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas/{schemaKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas/{schemaKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschema.as_ref().to_string(), ()); } @@ -23277,7 +23267,7 @@ impl<'a, C, A> SchemaDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -23426,7 +23416,7 @@ impl<'a, C, A> SchemaInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customer/{customerId}/schemas"; + let mut url = "https://www.googleapis.com/admin/directory/v1/customer/{customerId}/schemas".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserschema.as_ref().to_string(), ()); } @@ -23553,7 +23543,7 @@ impl<'a, C, A> SchemaInsertCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Immutable id of the Google Apps account + /// Immutable ID of the G Suite account /// /// Sets the *customer id* path property to the given value. /// @@ -23695,7 +23685,7 @@ impl<'a, C, A> ResourceCalendarListCall<'a, C, A> where C: BorrowMut ResourceCalendarListCall<'a, C, A> where C: BorrowMut ResourceCalendarGetCall<'a, C, A> where C: BorrowMut ResourceCalendarGetCall<'a, C, A> where C: BorrowMut ResourceCalendarInsertCall<'a, C, A> where C: BorrowMut ResourceCalendarInsertCall<'a, C, A> where C: BorrowMut ResourceCalendarPatchCall<'a, C, A> where C: BorrowMut ResourceCalendarPatchCall<'a, C, A> where C: BorrowMut ResourceCalendarUpdateCall<'a, C, A> where C: BorrowMut ResourceCalendarUpdateCall<'a, C, A> where C: BorrowMut ResourceCalendarDeleteCall<'a, C, A> where C: BorrowMut ResourceCalendarDeleteCall<'a, C, A> where C: BorrowMut UserUndeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "users/{userKey}/undelete"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/undelete".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -25503,7 +25493,7 @@ impl<'a, C, A> UserPhotoDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "users/{userKey}/photos/thumbnail"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/photos/thumbnail".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -25735,7 +25725,7 @@ impl<'a, C, A> UserPhotoPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}/photos/thumbnail"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/photos/thumbnail".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -25999,7 +25989,7 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -26239,7 +26229,7 @@ impl<'a, C, A> UserAliaseWatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases/watch"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/aliases/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -26512,7 +26502,7 @@ impl<'a, C, A> UserPhotoUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}/photos/thumbnail"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/photos/thumbnail".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -26836,7 +26826,7 @@ impl<'a, C, A> UserWatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/watch"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -27012,7 +27002,7 @@ impl<'a, C, A> UserWatchCall<'a, C, A> where C: BorrowMut, A: oau self._domain = Some(new_value.to_string()); self } - /// Immutable id of the Google Apps account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain. + /// Immutable ID of the G Suite account. In case of multi-domain, to fetch all users 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) -> UserWatchCall<'a, C, A> { @@ -27155,7 +27145,7 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -27414,7 +27404,7 @@ impl<'a, C, A> UserPhotoGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}/photos/thumbnail"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/photos/thumbnail".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserReadonly.as_ref().to_string(), ()); } @@ -27707,7 +27697,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserReadonly.as_ref().to_string(), ()); } @@ -27859,7 +27849,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut self._domain = Some(new_value.to_string()); self } - /// Immutable id of the Google Apps account. In case of multi-domain, to fetch all users for a customer, fill this field instead of domain. + /// Immutable ID of the G Suite account. In case of multi-domain, to fetch all users 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) -> UserListCall<'a, C, A> { @@ -28010,7 +28000,7 @@ impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserReadonly.as_ref().to_string(), ()); } @@ -28273,7 +28263,7 @@ impl<'a, C, A> UserAliaseInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/aliases".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -28537,7 +28527,7 @@ impl<'a, C, A> UserAliaseListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/aliases".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUserAliaReadonly.as_ref().to_string(), ()); } @@ -28785,7 +28775,7 @@ impl<'a, C, A> UserMakeAdminCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "users/{userKey}/makeAdmin"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/makeAdmin".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -29041,7 +29031,7 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -29301,7 +29291,7 @@ impl<'a, C, A> UserAliaseDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "users/{userKey}/aliases/{alias}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}/aliases/{alias}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -29535,7 +29525,7 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "users/{userKey}"; + let mut url = "https://www.googleapis.com/admin/directory/v1/users/{userKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DirectoryUser.as_ref().to_string(), ()); } @@ -29690,3 +29680,4 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa } + diff --git a/gen/admin1_reports-cli/Cargo.toml b/gen/admin1_reports-cli/Cargo.toml index cd8c29e8de..bab8152c51 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.4+20160704" +version = "1.0.4+20170320" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-admin1_reports] path = "../admin1_reports" -version = "1.0.4+20160704" +version = "1.0.4+20170320" diff --git a/gen/admin1_reports-cli/README.md b/gen/admin1_reports-cli/README.md index 7604cca73c..28140361d9 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 *20160704*. The CLI is at version *1.0.4*. +This documentation was generated from the *reports* API at revision *20170320*. The CLI is at version *1.0.4*. ```bash admin1-reports [options] diff --git a/gen/admin1_reports-cli/mkdocs.yml b/gen/admin1_reports-cli/mkdocs.yml index bc7a53bedc..837a334454 100644 --- a/gen/admin1_reports-cli/mkdocs.yml +++ b/gen/admin1_reports-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: reports v1.0.4+20160704 +site_name: reports v1.0.4+20170320 site_url: http://byron.github.io/google-apis-rs/google-admin1_reports-cli site_description: A complete library to interact with reports (protocol reports_v1) diff --git a/gen/admin1_reports-cli/src/main.rs b/gen/admin1_reports-cli/src/main.rs index 9745a9e596..dcf275accd 100644 --- a/gen/admin1_reports-cli/src/main.rs +++ b/gen/admin1_reports-cli/src/main.rs @@ -736,8 +736,8 @@ fn main() { let mut app = App::new("admin1-reports") .author("Sebastian Thiel ") - .version("1.0.4+20160704") - .about("Fetches reports for the administrators of Google Apps customers about the usage, collaboration, security, and risk for their users.") + .version("1.0.4+20170320") + .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") .long("scope") diff --git a/gen/admin1_reports/Cargo.toml b/gen/admin1_reports/Cargo.toml index 8bd39d7335..53dc66b85c 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.4+20160704" +version = "1.0.4+20170320" 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.4+20160704" +documentation = "https://docs.rs/google-admin1_reports/1.0.4+20170320" license = "MIT" keywords = ["admin", "google", "protocol", "web", "api"] diff --git a/gen/admin1_reports/README.md b/gen/admin1_reports/README.md index b2eda7cf0b..d453f030a0 100644 --- a/gen/admin1_reports/README.md +++ b/gen/admin1_reports/README.md @@ -5,28 +5,28 @@ DO NOT EDIT ! --> The `google-admin1_reports` library allows access to all features of the *Google reports* service. -This documentation was generated from *reports* crate version *1.0.4+20160704*, where *20160704* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *reports* crate version *1.0.4+20170320*, where *20170320* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20160704/google_admin1_reports/struct.Reports.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/struct.Reports.html) ... -* [activities](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/struct.Activity.html) - * [*list*](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/struct.ActivityListCall.html) and [*watch*](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/struct.ActivityWatchCall.html) -* [channels](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/struct.Channel.html) - * [*stop*](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/struct.ChannelStopCall.html) +* [activities](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/struct.Activity.html) + * [*list*](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/struct.ActivityListCall.html) and [*watch*](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/struct.ActivityWatchCall.html) +* [channels](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/struct.Channel.html) + * [*stop*](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/struct.ChannelStopCall.html) * customer usage reports - * [*get*](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/struct.CustomerUsageReportGetCall.html) + * [*get*](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/struct.CustomerUsageReportGetCall.html) * user usage report - * [*get*](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/struct.UserUsageReportGetCall.html) + * [*get*](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/struct.UserUsageReportGetCall.html) Subscription supported by ... -* [*watch activities*](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/struct.ActivityWatchCall.html) -* [*list activities*](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/struct.ActivityListCall.html) +* [*watch activities*](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/struct.ActivityWatchCall.html) +* [*list activities*](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/struct.ActivityListCall.html) @@ -34,17 +34,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/struct.Reports.html)** +* **[Hub](https://docs.rs/google-admin1_reports/1.0.4+20170320/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.4+20160704/google_admin1_reports/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-admin1_reports/1.0.4+20170320/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.4+20160704/google_admin1_reports/trait.Part.html)** + * **[Parts](https://docs.rs/google-admin1_reports/1.0.4+20170320/google_admin1_reports/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-admin1_reports/1.0.4+20160704/google_admin1_reports/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-admin1_reports/1.0.4+20170320/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. @@ -141,17 +141,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-admin1_reports/1.0.4+20160704/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.4+20170320/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.4+20160704/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.4+20170320/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.4+20160704/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.4+20170320/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.4+20160704/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.4+20170320/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")`. @@ -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-admin1_reports/1.0.4+20160704/google_admin1_reports/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-admin1_reports/1.0.4+20160704/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.4+20170320/google_admin1_reports/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-admin1_reports/1.0.4+20170320/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.4+20160704/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.4+20170320/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.4+20160704/google_admin1_reports/trait.RequestValue.html) and -[decodable](https://docs.rs/google-admin1_reports/1.0.4+20160704/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.4+20170320/google_admin1_reports/trait.RequestValue.html) and +[decodable](https://docs.rs/google-admin1_reports/1.0.4+20170320/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.4+20160704/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.4+20170320/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.4+20160704/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.4+20170320/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.4+20160704/google_admin1_reports/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-admin1_reports/1.0.4+20170320/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 26b77bf734..c807e5f895 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.4+20160704*, where *20160704* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *reports* crate version *1.0.4+20170320*, where *20170320* is the exact revision of the *admin:reports_v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *reports* *v1_reports* API can be found at the //! [official documentation site](https://developers.google.com/admin-sdk/reports/). @@ -196,7 +196,7 @@ // 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 +// 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)] @@ -241,10 +241,10 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { - /// View audit reports of Google Apps for your domain + /// View audit reports for your G Suite domain ReportAuditReadonly, - /// View usage reports of Google Apps for your domain + /// View usage reports for your G Suite domain ReportUsageReadonly, } @@ -339,8 +339,6 @@ pub struct Reports { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Reports {} @@ -353,8 +351,6 @@ impl<'a, C, A> Reports client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/admin/reports/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -380,26 +376,6 @@ impl<'a, C, A> Reports self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/admin/reports/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1095,7 +1071,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "/admin/reports_v1/channels/stop"; + let mut url = "https://www.googleapis.com/admin/reports/v1//admin/reports_v1/channels/stop".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ()); } @@ -1362,7 +1338,7 @@ impl<'a, C, A> ActivityWatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activity/users/{userKey}/applications/{applicationName}/watch"; + let mut url = "https://www.googleapis.com/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ()); } @@ -1509,7 +1485,7 @@ impl<'a, C, A> ActivityWatchCall<'a, C, A> where C: BorrowMut, A: self._application_name = new_value.to_string(); self } - /// Return events which occured at or after this time. + /// 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) -> ActivityWatchCall<'a, C, A> { @@ -1544,7 +1520,7 @@ impl<'a, C, A> ActivityWatchCall<'a, C, A> where C: BorrowMut, A: self._event_name = Some(new_value.to_string()); self } - /// Return events which occured at or before this time. + /// 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) -> ActivityWatchCall<'a, C, A> { @@ -1729,7 +1705,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activity/users/{userKey}/applications/{applicationName}"; + let mut url = "https://www.googleapis.com/admin/reports/v1/activity/users/{userKey}/applications/{applicationName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ReportAuditReadonly.as_ref().to_string(), ()); } @@ -1852,7 +1828,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: self._application_name = new_value.to_string(); self } - /// Return events which occured at or after this time. + /// 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> { @@ -1887,7 +1863,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: self._event_name = Some(new_value.to_string()); self } - /// Return events which occured at or before this time. + /// 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> { @@ -2045,7 +2021,7 @@ impl<'a, C, A> CustomerUsageReportGetCall<'a, C, A> where C: BorrowMut UserUsageReportGetCall<'a, C, A> where C: BorrowMut UserUsageReportGetCall<'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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-adsense1d4] path = "../adsense1d4" -version = "1.0.4+20161206" +version = "1.0.4+20170517" diff --git a/gen/adsense1d4-cli/README.md b/gen/adsense1d4-cli/README.md index 354e8ab15e..7af4047428 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 *20161206*. The CLI is at version *1.0.4*. +This documentation was generated from the *AdSense* API at revision *20170517*. The CLI is at version *1.0.4*. ```bash adsense1d4 [options] diff --git a/gen/adsense1d4-cli/mkdocs.yml b/gen/adsense1d4-cli/mkdocs.yml index cb73a01601..16ce95776c 100644 --- a/gen/adsense1d4-cli/mkdocs.yml +++ b/gen/adsense1d4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense v1.0.4+20161206 +site_name: AdSense v1.0.4+20170517 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 a85b7093c9..7117348707 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.4+20161206") + .version("1.0.4+20170517") .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 addf76137b..0bddfcc37f 100644 --- a/gen/adsense1d4/Cargo.toml +++ b/gen/adsense1d4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adsense1d4" -version = "1.0.4+20161206" +version = "1.0.4+20170517" 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.4+20161206" +documentation = "https://docs.rs/google-adsense1d4/1.0.4+20170517" license = "MIT" keywords = ["adsense", "google", "protocol", "web", "api"] diff --git a/gen/adsense1d4/README.md b/gen/adsense1d4/README.md index 0ca0c4b63a..31f294943f 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.4+20161206*, where *20161206* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *AdSense* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161206/google_adsense1d4/struct.AdSense.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AdSense.html) ... -* [accounts](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.Account.html) - * [*adclients list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountAdclientListCall.html), [*adunits customchannels list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountAdunitCustomchannelListCall.html), [*adunits get*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountAdunitGetAdCodeCall.html), [*adunits list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountAdunitListCall.html), [*alerts delete*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountAlertDeleteCall.html), [*alerts list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountAlertListCall.html), [*customchannels adunits list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountCustomchannelAdunitListCall.html), [*customchannels get*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountListCall.html), [*payments list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountPaymentListCall.html), [*reports generate*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountReportSavedListCall.html), [*savedadstyles get*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountSavedadstyleGetCall.html), [*savedadstyles list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountSavedadstyleListCall.html) and [*urlchannels list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountUrlchannelListCall.html) +* [accounts](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.Account.html) + * [*adclients list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountAdclientListCall.html), [*adunits customchannels list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountAdunitCustomchannelListCall.html), [*adunits get*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountAdunitGetAdCodeCall.html), [*adunits list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountAdunitListCall.html), [*alerts delete*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountAlertDeleteCall.html), [*alerts list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountAlertListCall.html), [*customchannels adunits list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountCustomchannelAdunitListCall.html), [*customchannels get*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountCustomchannelGetCall.html), [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountListCall.html), [*payments list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountPaymentListCall.html), [*reports generate*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountReportGenerateCall.html), [*reports saved generate*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountReportSavedGenerateCall.html), [*reports saved list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountReportSavedListCall.html), [*savedadstyles get*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountSavedadstyleGetCall.html), [*savedadstyles list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountSavedadstyleListCall.html) and [*urlchannels list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AccountUrlchannelListCall.html) * adclients - * [*list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AdclientListCall.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AdclientListCall.html) * adunits - * [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AdunitCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AdunitGetCall.html), [*get ad code*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AdunitGetAdCodeCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AdunitListCall.html) -* [alerts](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.Alert.html) - * [*delete*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AlertDeleteCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AlertListCall.html) + * [*customchannels list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AdunitCustomchannelListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AdunitGetCall.html), [*get ad code*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AdunitGetAdCodeCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AdunitListCall.html) +* [alerts](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.Alert.html) + * [*delete*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AlertDeleteCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.AlertListCall.html) * customchannels - * [*adunits list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.CustomchannelAdunitListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.CustomchannelGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.CustomchannelListCall.html) -* [metadata](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.Metadata.html) - * [*dimensions list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.MetadataDimensionListCall.html) and [*metrics list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.MetadataMetricListCall.html) -* [payments](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.Payment.html) - * [*list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.PaymentListCall.html) + * [*adunits list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.CustomchannelAdunitListCall.html), [*get*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.CustomchannelGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.CustomchannelListCall.html) +* [metadata](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.Metadata.html) + * [*dimensions list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.MetadataDimensionListCall.html) and [*metrics list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.MetadataMetricListCall.html) +* [payments](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.Payment.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.PaymentListCall.html) * reports - * [*generate*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.ReportGenerateCall.html), [*saved generate*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.ReportSavedGenerateCall.html) and [*saved list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.ReportSavedListCall.html) + * [*generate*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.ReportGenerateCall.html), [*saved generate*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.ReportSavedGenerateCall.html) and [*saved list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.ReportSavedListCall.html) * savedadstyles - * [*get*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.SavedadstyleGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.SavedadstyleListCall.html) + * [*get*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.SavedadstyleGetCall.html) and [*list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.SavedadstyleListCall.html) * urlchannels - * [*list*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.UrlchannelListCall.html) + * [*list*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.UrlchannelListCall.html) Download supported by ... -* [*generate reports*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.ReportGenerateCall.html) -* [*reports generate accounts*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/struct.AccountReportGenerateCall.html) +* [*generate reports*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/struct.ReportGenerateCall.html) +* [*reports generate accounts*](https://docs.rs/google-adsense1d4/1.0.4+20170517/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.4+20161206/google_adsense1d4/struct.AdSense.html)** +* **[Hub](https://docs.rs/google-adsense1d4/1.0.4+20170517/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.4+20161206/google_adsense1d4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adsense1d4/1.0.4+20170517/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.4+20161206/google_adsense1d4/trait.Part.html)** + * **[Parts](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adsense1d4/1.0.4+20170517/google_adsense1d4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -165,17 +165,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-adsense1d4/1.0.4+20161206/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.4+20170517/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.4+20161206/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.4+20170517/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.4+20161206/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.4+20170517/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.4+20161206/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.4+20170517/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")`. @@ -185,29 +185,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-adsense1d4/1.0.4+20161206/google_adsense1d4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adsense1d4/1.0.4+20161206/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.4+20170517/google_adsense1d4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adsense1d4/1.0.4+20170517/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.4+20161206/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.4+20170517/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.4+20161206/google_adsense1d4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adsense1d4/1.0.4+20161206/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.4+20170517/google_adsense1d4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adsense1d4/1.0.4+20170517/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.4+20161206/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.4+20170517/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.4+20161206/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.4+20170517/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.4+20161206/google_adsense1d4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adsense1d4/1.0.4+20170517/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 a244eb8a19..a892b6a04d 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.4+20161206*, where *20161206* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *AdSense* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *adsense:v1.4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *AdSense* *v1d4* API can be found at the //! [official documentation site](https://developers.google.com/adsense/management/). @@ -220,7 +220,7 @@ // 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 +// 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)] @@ -358,8 +358,6 @@ pub struct AdSense { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for AdSense {} @@ -372,8 +370,6 @@ impl<'a, C, A> AdSense client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/adsense/v1.4/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -417,26 +413,6 @@ impl<'a, C, A> AdSense self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/adsense/v1.4/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -2460,7 +2436,7 @@ impl<'a, C, A> UrlchannelListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/urlchannels"; + let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/urlchannels".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2721,7 +2697,7 @@ impl<'a, C, A> AdunitCustomchannelListCall<'a, C, A> where C: BorrowMut AdunitGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/adunits/{adUnitId}"; + let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3242,7 +3218,7 @@ impl<'a, C, A> AdunitListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/adunits"; + let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/adunits".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3500,7 +3476,7 @@ impl<'a, C, A> AdunitGetAdCodeCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/adunits/{adUnitId}/adcode"; + let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/adunits/{adUnitId}/adcode".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3753,7 +3729,7 @@ impl<'a, C, A> AdclientListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients"; + let mut url = "https://www.googleapis.com/adsense/v1.4/adclients".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3970,7 +3946,7 @@ impl<'a, C, A> AlertDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "alerts/{alertId}"; + let mut url = "https://www.googleapis.com/adsense/v1.4/alerts/{alertId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4198,7 +4174,7 @@ impl<'a, C, A> AlertListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "alerts"; + let mut url = "https://www.googleapis.com/adsense/v1.4/alerts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4417,7 +4393,7 @@ impl<'a, C, A> SavedadstyleListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "savedadstyles"; + let mut url = "https://www.googleapis.com/adsense/v1.4/savedadstyles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4635,7 +4611,7 @@ impl<'a, C, A> SavedadstyleGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "savedadstyles/{savedAdStyleId}"; + let mut url = "https://www.googleapis.com/adsense/v1.4/savedadstyles/{savedAdStyleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4878,7 +4854,7 @@ impl<'a, C, A> ReportSavedListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "reports/saved"; + let mut url = "https://www.googleapis.com/adsense/v1.4/reports/saved".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5179,7 +5155,7 @@ impl<'a, C, A> ReportGenerateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "reports"; + let mut url = "https://www.googleapis.com/adsense/v1.4/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5493,7 +5469,7 @@ impl<'a, C, A> ReportSavedGenerateCall<'a, C, A> where C: BorrowMut AccountAlertDeleteCall<'a, C, A> where C: BorrowMut AccountAlertListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/alerts"; + let mut url = "https://www.googleapis.com/adsense/v1.4/accounts/{accountId}/alerts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6249,7 +6225,7 @@ impl<'a, C, A> AccountReportSavedGenerateCall<'a, C, A> where C: BorrowMut AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts"; + let mut url = "https://www.googleapis.com/adsense/v1.4/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6741,7 +6717,7 @@ impl<'a, C, A> AccountPaymentListCall<'a, C, A> where C: BorrowMut AccountSavedadstyleGetCall<'a, C, A> where C: BorrowMut AccountAdunitGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}"; + let mut url = "https://www.googleapis.com/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7486,7 +7462,7 @@ impl<'a, C, A> AccountCustomchannelGetCall<'a, C, A> where C: BorrowMut AccountCustomchannelAdunitListCall<'a, C, A> where C: BorrowMut AccountReportSavedListCall<'a, C, A> where C: BorrowMut AccountUrlchannelListCall<'a, C, A> where C: BorrowMut AccountAdunitListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/adclients/{adClientId}/adunits"; + let mut url = "https://www.googleapis.com/adsense/v1.4/accounts/{accountId}/adclients/{adClientId}/adunits".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8927,7 +8903,7 @@ impl<'a, C, A> AccountReportGenerateCall<'a, C, A> where C: BorrowMut AccountAdclientListCall<'a, C, A> where C: BorrowMut AccountCustomchannelListCall<'a, C, A> where C: BorrowMut AccountSavedadstyleListCall<'a, C, A> where C: BorrowMut AccountAdunitGetAdCodeCall<'a, C, A> where C: BorrowMut AccountAdunitCustomchannelListCall<'a, C, A> where C: BorrowMut AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; + let mut url = "https://www.googleapis.com/adsense/v1.4/accounts/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10825,7 +10801,7 @@ impl<'a, C, A> PaymentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "payments"; + let mut url = "https://www.googleapis.com/adsense/v1.4/payments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11027,7 +11003,7 @@ impl<'a, C, A> MetadataDimensionListCall<'a, C, A> where C: BorrowMut MetadataMetricListCall<'a, C, A> where C: BorrowMut CustomchannelGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/customchannels/{customChannelId}"; + let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/customchannels/{customChannelId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11690,7 +11666,7 @@ impl<'a, C, A> CustomchannelListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/customchannels"; + let mut url = "https://www.googleapis.com/adsense/v1.4/adclients/{adClientId}/customchannels".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11956,7 +11932,7 @@ impl<'a, C, A> CustomchannelAdunitListCall<'a, C, A> where C: BorrowMut CustomchannelAdunitListCall<'a, C, A> where C: BorrowMut"] 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-adsensehost4d1] path = "../adsensehost4d1" -version = "1.0.4+20161206" +version = "1.0.4+20170517" diff --git a/gen/adsensehost4d1-cli/README.md b/gen/adsensehost4d1-cli/README.md index 3d870f8d68..145796ab78 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 *20161206*. The CLI is at version *1.0.4*. +This documentation was generated from the *AdSense Host* API at revision *20170517*. The CLI is at version *1.0.4*. ```bash adsensehost4d1 [options] diff --git a/gen/adsensehost4d1-cli/mkdocs.yml b/gen/adsensehost4d1-cli/mkdocs.yml index 1fee6fc148..43c01fede0 100644 --- a/gen/adsensehost4d1-cli/mkdocs.yml +++ b/gen/adsensehost4d1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: AdSense Host v1.0.4+20161206 +site_name: AdSense Host v1.0.4+20170517 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 5c179d404a..32ec723680 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.4+20161206") + .version("1.0.4+20170517") .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 07997e656a..e52a48297f 100644 --- a/gen/adsensehost4d1/Cargo.toml +++ b/gen/adsensehost4d1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-adsensehost4d1" -version = "1.0.4+20161206" +version = "1.0.4+20170517" 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.4+20161206" +documentation = "https://docs.rs/google-adsensehost4d1/1.0.4+20170517" license = "MIT" keywords = ["adsensehost", "google", "protocol", "web", "api"] diff --git a/gen/adsensehost4d1/README.md b/gen/adsensehost4d1/README.md index 56b7fb4291..6ea304f2d3 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.4+20161206*, where *20161206* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *AdSense Host* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161206/google_adsensehost4d1/struct.AdSenseHost.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AdSenseHost.html) ... -* [accounts](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.Account.html) - * [*adclients get*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountAdclientGetCall.html), [*adclients list*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountAdclientListCall.html), [*adunits delete*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountAdunitDeleteCall.html), [*adunits get*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountAdunitGetAdCodeCall.html), [*adunits insert*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountAdunitInsertCall.html), [*adunits list*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountAdunitListCall.html), [*adunits patch*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountAdunitPatchCall.html), [*adunits update*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountAdunitUpdateCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountListCall.html) and [*reports generate*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AccountReportGenerateCall.html) +* [accounts](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.Account.html) + * [*adclients get*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountAdclientGetCall.html), [*adclients list*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountAdclientListCall.html), [*adunits delete*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountAdunitDeleteCall.html), [*adunits get*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountAdunitGetCall.html), [*adunits get ad code*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountAdunitGetAdCodeCall.html), [*adunits insert*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountAdunitInsertCall.html), [*adunits list*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountAdunitListCall.html), [*adunits patch*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountAdunitPatchCall.html), [*adunits update*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountAdunitUpdateCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountGetCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountListCall.html) and [*reports generate*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AccountReportGenerateCall.html) * adclients - * [*get*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AdclientGetCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AdclientListCall.html) + * [*get*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AdclientGetCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AdclientListCall.html) * associationsessions - * [*start*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AssociationsessionStartCall.html) and [*verify*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.AssociationsessionVerifyCall.html) + * [*start*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AssociationsessionStartCall.html) and [*verify*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.AssociationsessionVerifyCall.html) * customchannels - * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.CustomchannelDeleteCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.CustomchannelGetCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.CustomchannelInsertCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.CustomchannelListCall.html), [*patch*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.CustomchannelPatchCall.html) and [*update*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.CustomchannelUpdateCall.html) -* [reports](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.Report.html) - * [*generate*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.ReportGenerateCall.html) + * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.CustomchannelDeleteCall.html), [*get*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.CustomchannelGetCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.CustomchannelInsertCall.html), [*list*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.CustomchannelListCall.html), [*patch*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.CustomchannelPatchCall.html) and [*update*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.CustomchannelUpdateCall.html) +* [reports](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.Report.html) + * [*generate*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.ReportGenerateCall.html) * urlchannels - * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.UrlchannelDeleteCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.UrlchannelInsertCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/struct.UrlchannelListCall.html) + * [*delete*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.UrlchannelDeleteCall.html), [*insert*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/struct.UrlchannelInsertCall.html) and [*list*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/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.4+20161206/google_adsensehost4d1/struct.AdSenseHost.html)** +* **[Hub](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/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.4+20161206/google_adsensehost4d1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/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.4+20161206/google_adsensehost4d1/trait.Part.html)** + * **[Parts](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/google_adsensehost4d1/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-adsensehost4d1/1.0.4+20161206/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.4+20170517/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.4+20161206/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.4+20170517/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.4+20161206/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.4+20170517/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.4+20161206/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.4+20170517/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")`. @@ -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-adsensehost4d1/1.0.4+20161206/google_adsensehost4d1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/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.4+20170517/google_adsensehost4d1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/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.4+20161206/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.4+20170517/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.4+20161206/google_adsensehost4d1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-adsensehost4d1/1.0.4+20161206/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.4+20170517/google_adsensehost4d1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/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.4+20161206/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.4+20170517/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.4+20161206/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.4+20170517/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.4+20161206/google_adsensehost4d1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-adsensehost4d1/1.0.4+20170517/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 a770eab82d..a3950ce8ef 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.4+20161206*, where *20161206* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *AdSense Host* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *adsensehost:v4.1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *AdSense Host* *v4d1* API can be found at the //! [official documentation site](https://developers.google.com/adsense/host/). @@ -198,7 +198,7 @@ // 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 +// 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)] @@ -330,8 +330,6 @@ pub struct AdSenseHost { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for AdSenseHost {} @@ -344,8 +342,6 @@ impl<'a, C, A> AdSenseHost client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/adsensehost/v4.1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -377,26 +373,6 @@ impl<'a, C, A> AdSenseHost self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/adsensehost/v4.1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1781,7 +1757,7 @@ impl<'a, C, A> UrlchannelInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/urlchannels"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}/urlchannels".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2042,7 +2018,7 @@ impl<'a, C, A> UrlchannelDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/urlchannels/{urlChannelId}"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}/urlchannels/{urlChannelId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2297,7 +2273,7 @@ impl<'a, C, A> UrlchannelListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/urlchannels"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}/urlchannels".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2554,7 +2530,7 @@ impl<'a, C, A> AdclientListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2772,7 +2748,7 @@ impl<'a, C, A> AdclientGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3023,7 +2999,7 @@ impl<'a, C, A> AssociationsessionStartCall<'a, C, A> where C: BorrowMut AssociationsessionVerifyCall<'a, C, A> where C: BorrowMut ReportGenerateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "reports"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3815,7 +3791,7 @@ impl<'a, C, A> AccountAdunitListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/adclients/{adClientId}/adunits"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4085,7 +4061,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4311,7 +4287,7 @@ impl<'a, C, A> AccountAdunitGetAdCodeCall<'a, C, A> where C: BorrowMut AccountReportGenerateCall<'a, C, A> where C: BorrowMut AccountAdunitDeleteCall<'a, C, A> where C: BorrowMut AccountAdclientListCall<'a, C, A> where C: BorrowMut AccountAdunitPatchCall<'a, C, A> where C: BorrowMut AccountAdclientGetCall<'a, C, A> where C: BorrowMut AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/accounts/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6228,7 +6204,7 @@ impl<'a, C, A> AccountAdunitInsertCall<'a, C, A> where C: BorrowMut AccountAdunitGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/accounts/{accountId}/adclients/{adClientId}/adunits/{adUnitId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6765,7 +6741,7 @@ impl<'a, C, A> AccountAdunitUpdateCall<'a, C, A> where C: BorrowMut CustomchannelGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/customchannels/{customChannelId}"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}/customchannels/{customChannelId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7283,7 +7259,7 @@ impl<'a, C, A> CustomchannelDeleteCall<'a, C, A> where C: BorrowMut CustomchannelUpdateCall<'a, C, A> where C: BorrowMut CustomchannelListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "adclients/{adClientId}/customchannels"; + let mut url = "https://www.googleapis.com/adsensehost/v4.1/adclients/{adClientId}/customchannels".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8062,7 +8038,7 @@ impl<'a, C, A> CustomchannelPatchCall<'a, C, A> where C: BorrowMut CustomchannelInsertCall<'a, C, A> where C: BorrowMut CustomchannelInsertCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with analytics (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analytics3-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-analytics3] path = "../analytics3" -version = "1.0.4+20161004" +version = "1.0.4+20170321" diff --git a/gen/analytics3-cli/README.md b/gen/analytics3-cli/README.md index c81578f16e..42e2d14ba8 100644 --- a/gen/analytics3-cli/README.md +++ b/gen/analytics3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *analytics* API at revision *20161004*. The CLI is at version *1.0.4*. +This documentation was generated from the *analytics* API at revision *20170321*. The CLI is at version *1.0.4*. ```bash analytics3 [options] @@ -84,6 +84,7 @@ analytics3 [options] profiles-list [-p ]... [-o ] profiles-patch (-r )... [-p ]... [-o ] profiles-update (-r )... [-p ]... [-o ] + remarketing-audience-delete [-p ]... remarketing-audience-get [-p ]... [-o ] remarketing-audience-insert (-r )... [-p ]... [-o ] remarketing-audience-list [-p ]... [-o ] diff --git a/gen/analytics3-cli/mkdocs.yml b/gen/analytics3-cli/mkdocs.yml index 63d92d10be..12018babb5 100644 --- a/gen/analytics3-cli/mkdocs.yml +++ b/gen/analytics3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: analytics v1.0.4+20161004 +site_name: analytics v1.0.4+20170321 site_url: http://byron.github.io/google-apis-rs/google-analytics3-cli site_description: A complete library to interact with analytics (protocol v3) @@ -62,6 +62,7 @@ pages: - ['management_profiles-list.md', 'Management', 'Profiles List'] - ['management_profiles-patch.md', 'Management', 'Profiles Patch'] - ['management_profiles-update.md', 'Management', 'Profiles Update'] +- ['management_remarketing-audience-delete.md', 'Management', 'Remarketing Audience Delete'] - ['management_remarketing-audience-get.md', 'Management', 'Remarketing Audience Get'] - ['management_remarketing-audience-insert.md', 'Management', 'Remarketing Audience Insert'] - ['management_remarketing-audience-list.md', 'Management', 'Remarketing Audience List'] diff --git a/gen/analytics3-cli/src/main.rs b/gen/analytics3-cli/src/main.rs index f0f154b7c7..994dd60949 100644 --- a/gen/analytics3-cli/src/main.rs +++ b/gen/analytics3-cli/src/main.rs @@ -4329,6 +4329,50 @@ impl<'n> Engine<'n> { } } + fn _management_remarketing_audience_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.management().remarketing_audience_delete(opt.value_of("account-id").unwrap_or(""), opt.value_of("web-property-id").unwrap_or(""), opt.value_of("remarketing-audience-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.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 _management_remarketing_audience_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.management().remarketing_audience_get(opt.value_of("account-id").unwrap_or(""), opt.value_of("web-property-id").unwrap_or(""), opt.value_of("remarketing-audience-id").unwrap_or("")); @@ -6877,6 +6921,9 @@ impl<'n> Engine<'n> { ("profiles-update", Some(opt)) => { call_result = self._management_profiles_update(opt, dry_run, &mut err); }, + ("remarketing-audience-delete", Some(opt)) => { + call_result = self._management_remarketing_audience_delete(opt, dry_run, &mut err); + }, ("remarketing-audience-get", Some(opt)) => { call_result = self._management_remarketing_audience_get(opt, dry_run, &mut err); }, @@ -7186,7 +7233,7 @@ fn main() { ]), ]), - ("management", "methods: 'account-summaries-list', 'account-user-links-delete', 'account-user-links-insert', 'account-user-links-list', 'account-user-links-update', 'accounts-list', 'custom-data-sources-list', 'custom-dimensions-get', 'custom-dimensions-insert', 'custom-dimensions-list', 'custom-dimensions-patch', 'custom-dimensions-update', 'custom-metrics-get', 'custom-metrics-insert', 'custom-metrics-list', 'custom-metrics-patch', 'custom-metrics-update', 'experiments-delete', 'experiments-get', 'experiments-insert', 'experiments-list', 'experiments-patch', 'experiments-update', 'filters-delete', 'filters-get', 'filters-insert', 'filters-list', 'filters-patch', 'filters-update', 'goals-get', 'goals-insert', 'goals-list', 'goals-patch', 'goals-update', 'profile-filter-links-delete', 'profile-filter-links-get', 'profile-filter-links-insert', 'profile-filter-links-list', 'profile-filter-links-patch', 'profile-filter-links-update', 'profile-user-links-delete', 'profile-user-links-insert', 'profile-user-links-list', 'profile-user-links-update', 'profiles-delete', 'profiles-get', 'profiles-insert', 'profiles-list', 'profiles-patch', 'profiles-update', 'remarketing-audience-get', 'remarketing-audience-insert', 'remarketing-audience-list', 'remarketing-audience-patch', 'remarketing-audience-update', 'segments-list', 'unsampled-reports-delete', 'unsampled-reports-get', 'unsampled-reports-insert', 'unsampled-reports-list', 'uploads-delete-upload-data', 'uploads-get', 'uploads-list', 'uploads-upload-data', 'web-property-ad-words-links-delete', 'web-property-ad-words-links-get', 'web-property-ad-words-links-insert', 'web-property-ad-words-links-list', 'web-property-ad-words-links-patch', 'web-property-ad-words-links-update', 'webproperties-get', 'webproperties-insert', 'webproperties-list', 'webproperties-patch', 'webproperties-update', 'webproperty-user-links-delete', 'webproperty-user-links-insert', 'webproperty-user-links-list' and 'webproperty-user-links-update'", vec![ + ("management", "methods: 'account-summaries-list', 'account-user-links-delete', 'account-user-links-insert', 'account-user-links-list', 'account-user-links-update', 'accounts-list', 'custom-data-sources-list', 'custom-dimensions-get', 'custom-dimensions-insert', 'custom-dimensions-list', 'custom-dimensions-patch', 'custom-dimensions-update', 'custom-metrics-get', 'custom-metrics-insert', 'custom-metrics-list', 'custom-metrics-patch', 'custom-metrics-update', 'experiments-delete', 'experiments-get', 'experiments-insert', 'experiments-list', 'experiments-patch', 'experiments-update', 'filters-delete', 'filters-get', 'filters-insert', 'filters-list', 'filters-patch', 'filters-update', 'goals-get', 'goals-insert', 'goals-list', 'goals-patch', 'goals-update', 'profile-filter-links-delete', 'profile-filter-links-get', 'profile-filter-links-insert', 'profile-filter-links-list', 'profile-filter-links-patch', 'profile-filter-links-update', 'profile-user-links-delete', 'profile-user-links-insert', 'profile-user-links-list', 'profile-user-links-update', 'profiles-delete', 'profiles-get', 'profiles-insert', 'profiles-list', 'profiles-patch', 'profiles-update', 'remarketing-audience-delete', 'remarketing-audience-get', 'remarketing-audience-insert', 'remarketing-audience-list', 'remarketing-audience-patch', 'remarketing-audience-update', 'segments-list', 'unsampled-reports-delete', 'unsampled-reports-get', 'unsampled-reports-insert', 'unsampled-reports-list', 'uploads-delete-upload-data', 'uploads-get', 'uploads-list', 'uploads-upload-data', 'web-property-ad-words-links-delete', 'web-property-ad-words-links-get', 'web-property-ad-words-links-insert', 'web-property-ad-words-links-list', 'web-property-ad-words-links-patch', 'web-property-ad-words-links-update', 'webproperties-get', 'webproperties-insert', 'webproperties-list', 'webproperties-patch', 'webproperties-update', 'webproperty-user-links-delete', 'webproperty-user-links-insert', 'webproperty-user-links-list' and 'webproperty-user-links-update'", vec![ ("account-summaries-list", Some(r##"Lists account summaries (lightweight tree comprised of accounts/properties/profiles) to which the user has access."##), "Details at http://byron.github.io/google-apis-rs/google_analytics3_cli/management_account-summaries-list", @@ -8923,6 +8970,34 @@ fn main() { Some(false), Some(false)), ]), + ("remarketing-audience-delete", + Some(r##"Delete a remarketing audience."##), + "Details at http://byron.github.io/google-apis-rs/google_analytics3_cli/management_remarketing-audience-delete", + vec![ + (Some(r##"account-id"##), + None, + Some(r##"Account ID to which the remarketing audience belongs."##), + Some(true), + Some(false)), + + (Some(r##"web-property-id"##), + None, + Some(r##"Web property ID to which the remarketing audience belongs."##), + Some(true), + Some(false)), + + (Some(r##"remarketing-audience-id"##), + None, + Some(r##"The ID of the remarketing audience to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + ]), ("remarketing-audience-get", Some(r##"Gets a remarketing audience to which the user has access."##), "Details at http://byron.github.io/google-apis-rs/google_analytics3_cli/management_remarketing-audience-get", @@ -9947,7 +10022,7 @@ fn main() { let mut app = App::new("analytics3") .author("Sebastian Thiel ") - .version("1.0.4+20161004") + .version("1.0.4+20170321") .about("Views and manages your Google Analytics data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_analytics3_cli") .arg(Arg::with_name("url") diff --git a/gen/analytics3/Cargo.toml b/gen/analytics3/Cargo.toml index eb43d32528..5edace07b9 100644 --- a/gen/analytics3/Cargo.toml +++ b/gen/analytics3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-analytics3" -version = "1.0.4+20161004" +version = "1.0.4+20170321" authors = ["Sebastian Thiel "] description = "A complete library to interact with analytics (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/analytics3" homepage = "https://developers.google.com/analytics/" -documentation = "https://docs.rs/google-analytics3/1.0.4+20161004" +documentation = "https://docs.rs/google-analytics3/1.0.4+20170321" license = "MIT" keywords = ["analytics", "google", "protocol", "web", "api"] diff --git a/gen/analytics3/README.md b/gen/analytics3/README.md index 6868c6ad22..4dd41432a1 100644 --- a/gen/analytics3/README.md +++ b/gen/analytics3/README.md @@ -5,27 +5,27 @@ DO NOT EDIT ! --> The `google-analytics3` library allows access to all features of the *Google analytics* service. -This documentation was generated from *analytics* crate version *1.0.4+20161004*, where *20161004* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *analytics* crate version *1.0.4+20170321*, where *20170321* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *analytics* *v3* API can be found at the [official documentation site](https://developers.google.com/analytics/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.Analytics.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.Analytics.html) ... * data - * [*ga get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.DataGaGetCall.html), [*mcf get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.DataMcfGetCall.html) and [*realtime get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.DataRealtimeGetCall.html) + * [*ga get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.DataGaGetCall.html), [*mcf get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.DataMcfGetCall.html) and [*realtime get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.DataRealtimeGetCall.html) * management - * [*account summaries list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementAccountSummaryListCall.html), [*account user links delete*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementAccountUserLinkDeleteCall.html), [*account user links insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementAccountUserLinkInsertCall.html), [*account user links list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementAccountUserLinkListCall.html), [*account user links update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementAccountUserLinkUpdateCall.html), [*accounts list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementAccountListCall.html), [*custom data sources list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomDataSourceListCall.html), [*custom dimensions get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomDimensionGetCall.html), [*custom dimensions insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomDimensionInsertCall.html), [*custom dimensions list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomDimensionListCall.html), [*custom dimensions patch*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomDimensionPatchCall.html), [*custom dimensions update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomDimensionUpdateCall.html), [*custom metrics get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomMetricGetCall.html), [*custom metrics insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomMetricInsertCall.html), [*custom metrics list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomMetricListCall.html), [*custom metrics patch*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomMetricPatchCall.html), [*custom metrics update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementCustomMetricUpdateCall.html), [*experiments delete*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementExperimentDeleteCall.html), [*experiments get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementExperimentGetCall.html), [*experiments insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementExperimentInsertCall.html), [*experiments list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementExperimentListCall.html), [*experiments patch*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementExperimentPatchCall.html), [*experiments update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementExperimentUpdateCall.html), [*filters delete*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementFilterDeleteCall.html), [*filters get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementFilterGetCall.html), [*filters insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementFilterInsertCall.html), [*filters list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementFilterListCall.html), [*filters patch*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementFilterPatchCall.html), [*filters update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementFilterUpdateCall.html), [*goals get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementGoalGetCall.html), [*goals insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementGoalInsertCall.html), [*goals list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementGoalListCall.html), [*goals patch*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementGoalPatchCall.html), [*goals update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementGoalUpdateCall.html), [*profile filter links delete*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileFilterLinkDeleteCall.html), [*profile filter links get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileFilterLinkGetCall.html), [*profile filter links insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileFilterLinkInsertCall.html), [*profile filter links list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileFilterLinkListCall.html), [*profile filter links patch*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileFilterLinkPatchCall.html), [*profile filter links update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileFilterLinkUpdateCall.html), [*profile user links delete*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileUserLinkDeleteCall.html), [*profile user links insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileUserLinkInsertCall.html), [*profile user links list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileUserLinkListCall.html), [*profile user links update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileUserLinkUpdateCall.html), [*profiles delete*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileDeleteCall.html), [*profiles get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileGetCall.html), [*profiles insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileInsertCall.html), [*profiles list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileListCall.html), [*profiles patch*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfilePatchCall.html), [*profiles update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementProfileUpdateCall.html), [*remarketing audience get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementRemarketingAudienceGetCall.html), [*remarketing audience insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementRemarketingAudienceInsertCall.html), [*remarketing audience list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementRemarketingAudienceListCall.html), [*remarketing audience patch*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementRemarketingAudiencePatchCall.html), [*remarketing audience update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementRemarketingAudienceUpdateCall.html), [*segments list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementSegmentListCall.html), [*unsampled reports delete*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementUnsampledReportDeleteCall.html), [*unsampled reports get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementUnsampledReportGetCall.html), [*unsampled reports insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementUnsampledReportInsertCall.html), [*unsampled reports list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementUnsampledReportListCall.html), [*uploads delete upload data*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementUploadDeleteUploadDataCall.html), [*uploads get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementUploadGetCall.html), [*uploads list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementUploadListCall.html), [*uploads upload data*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementUploadUploadDataCall.html), [*web property ad words links delete*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebPropertyAdWordsLinkDeleteCall.html), [*web property ad words links get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebPropertyAdWordsLinkGetCall.html), [*web property ad words links insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebPropertyAdWordsLinkInsertCall.html), [*web property ad words links list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebPropertyAdWordsLinkListCall.html), [*web property ad words links patch*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebPropertyAdWordsLinkPatchCall.html), [*web property ad words links update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebPropertyAdWordsLinkUpdateCall.html), [*webproperties get*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebpropertyGetCall.html), [*webproperties insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebpropertyInsertCall.html), [*webproperties list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebpropertyListCall.html), [*webproperties patch*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebpropertyPatchCall.html), [*webproperties update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebpropertyUpdateCall.html), [*webproperty user links delete*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebpropertyUserLinkDeleteCall.html), [*webproperty user links insert*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebpropertyUserLinkInsertCall.html), [*webproperty user links list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebpropertyUserLinkListCall.html) and [*webproperty user links update*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementWebpropertyUserLinkUpdateCall.html) + * [*account summaries list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementAccountSummaryListCall.html), [*account user links delete*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementAccountUserLinkDeleteCall.html), [*account user links insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementAccountUserLinkInsertCall.html), [*account user links list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementAccountUserLinkListCall.html), [*account user links update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementAccountUserLinkUpdateCall.html), [*accounts list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementAccountListCall.html), [*custom data sources list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomDataSourceListCall.html), [*custom dimensions get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomDimensionGetCall.html), [*custom dimensions insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomDimensionInsertCall.html), [*custom dimensions list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomDimensionListCall.html), [*custom dimensions patch*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomDimensionPatchCall.html), [*custom dimensions update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomDimensionUpdateCall.html), [*custom metrics get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomMetricGetCall.html), [*custom metrics insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomMetricInsertCall.html), [*custom metrics list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomMetricListCall.html), [*custom metrics patch*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomMetricPatchCall.html), [*custom metrics update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementCustomMetricUpdateCall.html), [*experiments delete*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementExperimentDeleteCall.html), [*experiments get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementExperimentGetCall.html), [*experiments insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementExperimentInsertCall.html), [*experiments list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementExperimentListCall.html), [*experiments patch*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementExperimentPatchCall.html), [*experiments update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementExperimentUpdateCall.html), [*filters delete*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementFilterDeleteCall.html), [*filters get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementFilterGetCall.html), [*filters insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementFilterInsertCall.html), [*filters list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementFilterListCall.html), [*filters patch*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementFilterPatchCall.html), [*filters update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementFilterUpdateCall.html), [*goals get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementGoalGetCall.html), [*goals insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementGoalInsertCall.html), [*goals list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementGoalListCall.html), [*goals patch*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementGoalPatchCall.html), [*goals update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementGoalUpdateCall.html), [*profile filter links delete*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileFilterLinkDeleteCall.html), [*profile filter links get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileFilterLinkGetCall.html), [*profile filter links insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileFilterLinkInsertCall.html), [*profile filter links list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileFilterLinkListCall.html), [*profile filter links patch*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileFilterLinkPatchCall.html), [*profile filter links update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileFilterLinkUpdateCall.html), [*profile user links delete*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileUserLinkDeleteCall.html), [*profile user links insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileUserLinkInsertCall.html), [*profile user links list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileUserLinkListCall.html), [*profile user links update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileUserLinkUpdateCall.html), [*profiles delete*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileDeleteCall.html), [*profiles get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileGetCall.html), [*profiles insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileInsertCall.html), [*profiles list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileListCall.html), [*profiles patch*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfilePatchCall.html), [*profiles update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementProfileUpdateCall.html), [*remarketing audience delete*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementRemarketingAudienceDeleteCall.html), [*remarketing audience get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementRemarketingAudienceGetCall.html), [*remarketing audience insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementRemarketingAudienceInsertCall.html), [*remarketing audience list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementRemarketingAudienceListCall.html), [*remarketing audience patch*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementRemarketingAudiencePatchCall.html), [*remarketing audience update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementRemarketingAudienceUpdateCall.html), [*segments list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementSegmentListCall.html), [*unsampled reports delete*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementUnsampledReportDeleteCall.html), [*unsampled reports get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementUnsampledReportGetCall.html), [*unsampled reports insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementUnsampledReportInsertCall.html), [*unsampled reports list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementUnsampledReportListCall.html), [*uploads delete upload data*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementUploadDeleteUploadDataCall.html), [*uploads get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementUploadGetCall.html), [*uploads list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementUploadListCall.html), [*uploads upload data*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementUploadUploadDataCall.html), [*web property ad words links delete*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkDeleteCall.html), [*web property ad words links get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkGetCall.html), [*web property ad words links insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkInsertCall.html), [*web property ad words links list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkListCall.html), [*web property ad words links patch*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkPatchCall.html), [*web property ad words links update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebPropertyAdWordsLinkUpdateCall.html), [*webproperties get*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebpropertyGetCall.html), [*webproperties insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebpropertyInsertCall.html), [*webproperties list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebpropertyListCall.html), [*webproperties patch*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebpropertyPatchCall.html), [*webproperties update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebpropertyUpdateCall.html), [*webproperty user links delete*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebpropertyUserLinkDeleteCall.html), [*webproperty user links insert*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebpropertyUserLinkInsertCall.html), [*webproperty user links list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebpropertyUserLinkListCall.html) and [*webproperty user links update*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementWebpropertyUserLinkUpdateCall.html) * metadata - * [*columns list*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.MetadataColumnListCall.html) + * [*columns list*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.MetadataColumnListCall.html) * provisioning - * [*create account ticket*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ProvisioningCreateAccountTicketCall.html) + * [*create account ticket*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ProvisioningCreateAccountTicketCall.html) Upload supported by ... -* [*uploads upload data management*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.ManagementUploadUploadDataCall.html) +* [*uploads upload data management*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.ManagementUploadUploadDataCall.html) @@ -33,17 +33,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/struct.Analytics.html)** +* **[Hub](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/struct.Analytics.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.Part.html)** + * **[Parts](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.ResponseResult.html), it will return that by default. You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making this call: `.param("alt", "media")`. @@ -156,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-analytics3/1.0.4+20161004/google_analytics3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-analytics3/1.0.4+20161004/google_analytics3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-analytics3/1.0.4+20170321/google_analytics3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/analytics3/src/lib.rs b/gen/analytics3/src/lib.rs index 4d6fb1ba47..2e9bb62c73 100644 --- a/gen/analytics3/src/lib.rs +++ b/gen/analytics3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *analytics* crate version *1.0.4+20161004*, where *20161004* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *analytics* crate version *1.0.4+20170321*, where *20170321* is the exact revision of the *analytics:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *analytics* *v3* API can be found at the //! [official documentation site](https://developers.google.com/analytics/). @@ -14,7 +14,7 @@ //! * data //! * [*ga get*](struct.DataGaGetCall.html), [*mcf get*](struct.DataMcfGetCall.html) and [*realtime get*](struct.DataRealtimeGetCall.html) //! * management -//! * [*account summaries list*](struct.ManagementAccountSummaryListCall.html), [*account user links delete*](struct.ManagementAccountUserLinkDeleteCall.html), [*account user links insert*](struct.ManagementAccountUserLinkInsertCall.html), [*account user links list*](struct.ManagementAccountUserLinkListCall.html), [*account user links update*](struct.ManagementAccountUserLinkUpdateCall.html), [*accounts list*](struct.ManagementAccountListCall.html), [*custom data sources list*](struct.ManagementCustomDataSourceListCall.html), [*custom dimensions get*](struct.ManagementCustomDimensionGetCall.html), [*custom dimensions insert*](struct.ManagementCustomDimensionInsertCall.html), [*custom dimensions list*](struct.ManagementCustomDimensionListCall.html), [*custom dimensions patch*](struct.ManagementCustomDimensionPatchCall.html), [*custom dimensions update*](struct.ManagementCustomDimensionUpdateCall.html), [*custom metrics get*](struct.ManagementCustomMetricGetCall.html), [*custom metrics insert*](struct.ManagementCustomMetricInsertCall.html), [*custom metrics list*](struct.ManagementCustomMetricListCall.html), [*custom metrics patch*](struct.ManagementCustomMetricPatchCall.html), [*custom metrics update*](struct.ManagementCustomMetricUpdateCall.html), [*experiments delete*](struct.ManagementExperimentDeleteCall.html), [*experiments get*](struct.ManagementExperimentGetCall.html), [*experiments insert*](struct.ManagementExperimentInsertCall.html), [*experiments list*](struct.ManagementExperimentListCall.html), [*experiments patch*](struct.ManagementExperimentPatchCall.html), [*experiments update*](struct.ManagementExperimentUpdateCall.html), [*filters delete*](struct.ManagementFilterDeleteCall.html), [*filters get*](struct.ManagementFilterGetCall.html), [*filters insert*](struct.ManagementFilterInsertCall.html), [*filters list*](struct.ManagementFilterListCall.html), [*filters patch*](struct.ManagementFilterPatchCall.html), [*filters update*](struct.ManagementFilterUpdateCall.html), [*goals get*](struct.ManagementGoalGetCall.html), [*goals insert*](struct.ManagementGoalInsertCall.html), [*goals list*](struct.ManagementGoalListCall.html), [*goals patch*](struct.ManagementGoalPatchCall.html), [*goals update*](struct.ManagementGoalUpdateCall.html), [*profile filter links delete*](struct.ManagementProfileFilterLinkDeleteCall.html), [*profile filter links get*](struct.ManagementProfileFilterLinkGetCall.html), [*profile filter links insert*](struct.ManagementProfileFilterLinkInsertCall.html), [*profile filter links list*](struct.ManagementProfileFilterLinkListCall.html), [*profile filter links patch*](struct.ManagementProfileFilterLinkPatchCall.html), [*profile filter links update*](struct.ManagementProfileFilterLinkUpdateCall.html), [*profile user links delete*](struct.ManagementProfileUserLinkDeleteCall.html), [*profile user links insert*](struct.ManagementProfileUserLinkInsertCall.html), [*profile user links list*](struct.ManagementProfileUserLinkListCall.html), [*profile user links update*](struct.ManagementProfileUserLinkUpdateCall.html), [*profiles delete*](struct.ManagementProfileDeleteCall.html), [*profiles get*](struct.ManagementProfileGetCall.html), [*profiles insert*](struct.ManagementProfileInsertCall.html), [*profiles list*](struct.ManagementProfileListCall.html), [*profiles patch*](struct.ManagementProfilePatchCall.html), [*profiles update*](struct.ManagementProfileUpdateCall.html), [*remarketing audience get*](struct.ManagementRemarketingAudienceGetCall.html), [*remarketing audience insert*](struct.ManagementRemarketingAudienceInsertCall.html), [*remarketing audience list*](struct.ManagementRemarketingAudienceListCall.html), [*remarketing audience patch*](struct.ManagementRemarketingAudiencePatchCall.html), [*remarketing audience update*](struct.ManagementRemarketingAudienceUpdateCall.html), [*segments list*](struct.ManagementSegmentListCall.html), [*unsampled reports delete*](struct.ManagementUnsampledReportDeleteCall.html), [*unsampled reports get*](struct.ManagementUnsampledReportGetCall.html), [*unsampled reports insert*](struct.ManagementUnsampledReportInsertCall.html), [*unsampled reports list*](struct.ManagementUnsampledReportListCall.html), [*uploads delete upload data*](struct.ManagementUploadDeleteUploadDataCall.html), [*uploads get*](struct.ManagementUploadGetCall.html), [*uploads list*](struct.ManagementUploadListCall.html), [*uploads upload data*](struct.ManagementUploadUploadDataCall.html), [*web property ad words links delete*](struct.ManagementWebPropertyAdWordsLinkDeleteCall.html), [*web property ad words links get*](struct.ManagementWebPropertyAdWordsLinkGetCall.html), [*web property ad words links insert*](struct.ManagementWebPropertyAdWordsLinkInsertCall.html), [*web property ad words links list*](struct.ManagementWebPropertyAdWordsLinkListCall.html), [*web property ad words links patch*](struct.ManagementWebPropertyAdWordsLinkPatchCall.html), [*web property ad words links update*](struct.ManagementWebPropertyAdWordsLinkUpdateCall.html), [*webproperties get*](struct.ManagementWebpropertyGetCall.html), [*webproperties insert*](struct.ManagementWebpropertyInsertCall.html), [*webproperties list*](struct.ManagementWebpropertyListCall.html), [*webproperties patch*](struct.ManagementWebpropertyPatchCall.html), [*webproperties update*](struct.ManagementWebpropertyUpdateCall.html), [*webproperty user links delete*](struct.ManagementWebpropertyUserLinkDeleteCall.html), [*webproperty user links insert*](struct.ManagementWebpropertyUserLinkInsertCall.html), [*webproperty user links list*](struct.ManagementWebpropertyUserLinkListCall.html) and [*webproperty user links update*](struct.ManagementWebpropertyUserLinkUpdateCall.html) +//! * [*account summaries list*](struct.ManagementAccountSummaryListCall.html), [*account user links delete*](struct.ManagementAccountUserLinkDeleteCall.html), [*account user links insert*](struct.ManagementAccountUserLinkInsertCall.html), [*account user links list*](struct.ManagementAccountUserLinkListCall.html), [*account user links update*](struct.ManagementAccountUserLinkUpdateCall.html), [*accounts list*](struct.ManagementAccountListCall.html), [*custom data sources list*](struct.ManagementCustomDataSourceListCall.html), [*custom dimensions get*](struct.ManagementCustomDimensionGetCall.html), [*custom dimensions insert*](struct.ManagementCustomDimensionInsertCall.html), [*custom dimensions list*](struct.ManagementCustomDimensionListCall.html), [*custom dimensions patch*](struct.ManagementCustomDimensionPatchCall.html), [*custom dimensions update*](struct.ManagementCustomDimensionUpdateCall.html), [*custom metrics get*](struct.ManagementCustomMetricGetCall.html), [*custom metrics insert*](struct.ManagementCustomMetricInsertCall.html), [*custom metrics list*](struct.ManagementCustomMetricListCall.html), [*custom metrics patch*](struct.ManagementCustomMetricPatchCall.html), [*custom metrics update*](struct.ManagementCustomMetricUpdateCall.html), [*experiments delete*](struct.ManagementExperimentDeleteCall.html), [*experiments get*](struct.ManagementExperimentGetCall.html), [*experiments insert*](struct.ManagementExperimentInsertCall.html), [*experiments list*](struct.ManagementExperimentListCall.html), [*experiments patch*](struct.ManagementExperimentPatchCall.html), [*experiments update*](struct.ManagementExperimentUpdateCall.html), [*filters delete*](struct.ManagementFilterDeleteCall.html), [*filters get*](struct.ManagementFilterGetCall.html), [*filters insert*](struct.ManagementFilterInsertCall.html), [*filters list*](struct.ManagementFilterListCall.html), [*filters patch*](struct.ManagementFilterPatchCall.html), [*filters update*](struct.ManagementFilterUpdateCall.html), [*goals get*](struct.ManagementGoalGetCall.html), [*goals insert*](struct.ManagementGoalInsertCall.html), [*goals list*](struct.ManagementGoalListCall.html), [*goals patch*](struct.ManagementGoalPatchCall.html), [*goals update*](struct.ManagementGoalUpdateCall.html), [*profile filter links delete*](struct.ManagementProfileFilterLinkDeleteCall.html), [*profile filter links get*](struct.ManagementProfileFilterLinkGetCall.html), [*profile filter links insert*](struct.ManagementProfileFilterLinkInsertCall.html), [*profile filter links list*](struct.ManagementProfileFilterLinkListCall.html), [*profile filter links patch*](struct.ManagementProfileFilterLinkPatchCall.html), [*profile filter links update*](struct.ManagementProfileFilterLinkUpdateCall.html), [*profile user links delete*](struct.ManagementProfileUserLinkDeleteCall.html), [*profile user links insert*](struct.ManagementProfileUserLinkInsertCall.html), [*profile user links list*](struct.ManagementProfileUserLinkListCall.html), [*profile user links update*](struct.ManagementProfileUserLinkUpdateCall.html), [*profiles delete*](struct.ManagementProfileDeleteCall.html), [*profiles get*](struct.ManagementProfileGetCall.html), [*profiles insert*](struct.ManagementProfileInsertCall.html), [*profiles list*](struct.ManagementProfileListCall.html), [*profiles patch*](struct.ManagementProfilePatchCall.html), [*profiles update*](struct.ManagementProfileUpdateCall.html), [*remarketing audience delete*](struct.ManagementRemarketingAudienceDeleteCall.html), [*remarketing audience get*](struct.ManagementRemarketingAudienceGetCall.html), [*remarketing audience insert*](struct.ManagementRemarketingAudienceInsertCall.html), [*remarketing audience list*](struct.ManagementRemarketingAudienceListCall.html), [*remarketing audience patch*](struct.ManagementRemarketingAudiencePatchCall.html), [*remarketing audience update*](struct.ManagementRemarketingAudienceUpdateCall.html), [*segments list*](struct.ManagementSegmentListCall.html), [*unsampled reports delete*](struct.ManagementUnsampledReportDeleteCall.html), [*unsampled reports get*](struct.ManagementUnsampledReportGetCall.html), [*unsampled reports insert*](struct.ManagementUnsampledReportInsertCall.html), [*unsampled reports list*](struct.ManagementUnsampledReportListCall.html), [*uploads delete upload data*](struct.ManagementUploadDeleteUploadDataCall.html), [*uploads get*](struct.ManagementUploadGetCall.html), [*uploads list*](struct.ManagementUploadListCall.html), [*uploads upload data*](struct.ManagementUploadUploadDataCall.html), [*web property ad words links delete*](struct.ManagementWebPropertyAdWordsLinkDeleteCall.html), [*web property ad words links get*](struct.ManagementWebPropertyAdWordsLinkGetCall.html), [*web property ad words links insert*](struct.ManagementWebPropertyAdWordsLinkInsertCall.html), [*web property ad words links list*](struct.ManagementWebPropertyAdWordsLinkListCall.html), [*web property ad words links patch*](struct.ManagementWebPropertyAdWordsLinkPatchCall.html), [*web property ad words links update*](struct.ManagementWebPropertyAdWordsLinkUpdateCall.html), [*webproperties get*](struct.ManagementWebpropertyGetCall.html), [*webproperties insert*](struct.ManagementWebpropertyInsertCall.html), [*webproperties list*](struct.ManagementWebpropertyListCall.html), [*webproperties patch*](struct.ManagementWebpropertyPatchCall.html), [*webproperties update*](struct.ManagementWebpropertyUpdateCall.html), [*webproperty user links delete*](struct.ManagementWebpropertyUserLinkDeleteCall.html), [*webproperty user links insert*](struct.ManagementWebpropertyUserLinkInsertCall.html), [*webproperty user links list*](struct.ManagementWebpropertyUserLinkListCall.html) and [*webproperty user links update*](struct.ManagementWebpropertyUserLinkUpdateCall.html) //! * metadata //! * [*columns list*](struct.MetadataColumnListCall.html) //! * provisioning @@ -191,7 +191,7 @@ // 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 +// 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)] @@ -342,8 +342,6 @@ pub struct Analytics { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Analytics {} @@ -356,8 +354,6 @@ impl<'a, C, A> Analytics client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/analytics/v3/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -383,26 +379,6 @@ impl<'a, C, A> Analytics self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/analytics/v3/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -3539,7 +3515,7 @@ impl Part for ProfileChildLink {} /// ::default(), None); /// let mut hub = Analytics::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `account_summaries_list(...)`, `account_user_links_delete(...)`, `account_user_links_insert(...)`, `account_user_links_list(...)`, `account_user_links_update(...)`, `accounts_list(...)`, `custom_data_sources_list(...)`, `custom_dimensions_get(...)`, `custom_dimensions_insert(...)`, `custom_dimensions_list(...)`, `custom_dimensions_patch(...)`, `custom_dimensions_update(...)`, `custom_metrics_get(...)`, `custom_metrics_insert(...)`, `custom_metrics_list(...)`, `custom_metrics_patch(...)`, `custom_metrics_update(...)`, `experiments_delete(...)`, `experiments_get(...)`, `experiments_insert(...)`, `experiments_list(...)`, `experiments_patch(...)`, `experiments_update(...)`, `filters_delete(...)`, `filters_get(...)`, `filters_insert(...)`, `filters_list(...)`, `filters_patch(...)`, `filters_update(...)`, `goals_get(...)`, `goals_insert(...)`, `goals_list(...)`, `goals_patch(...)`, `goals_update(...)`, `profile_filter_links_delete(...)`, `profile_filter_links_get(...)`, `profile_filter_links_insert(...)`, `profile_filter_links_list(...)`, `profile_filter_links_patch(...)`, `profile_filter_links_update(...)`, `profile_user_links_delete(...)`, `profile_user_links_insert(...)`, `profile_user_links_list(...)`, `profile_user_links_update(...)`, `profiles_delete(...)`, `profiles_get(...)`, `profiles_insert(...)`, `profiles_list(...)`, `profiles_patch(...)`, `profiles_update(...)`, `remarketing_audience_get(...)`, `remarketing_audience_insert(...)`, `remarketing_audience_list(...)`, `remarketing_audience_patch(...)`, `remarketing_audience_update(...)`, `segments_list(...)`, `unsampled_reports_delete(...)`, `unsampled_reports_get(...)`, `unsampled_reports_insert(...)`, `unsampled_reports_list(...)`, `uploads_delete_upload_data(...)`, `uploads_get(...)`, `uploads_list(...)`, `uploads_upload_data(...)`, `web_property_ad_words_links_delete(...)`, `web_property_ad_words_links_get(...)`, `web_property_ad_words_links_insert(...)`, `web_property_ad_words_links_list(...)`, `web_property_ad_words_links_patch(...)`, `web_property_ad_words_links_update(...)`, `webproperties_get(...)`, `webproperties_insert(...)`, `webproperties_list(...)`, `webproperties_patch(...)`, `webproperties_update(...)`, `webproperty_user_links_delete(...)`, `webproperty_user_links_insert(...)`, `webproperty_user_links_list(...)` and `webproperty_user_links_update(...)` +/// // like `account_summaries_list(...)`, `account_user_links_delete(...)`, `account_user_links_insert(...)`, `account_user_links_list(...)`, `account_user_links_update(...)`, `accounts_list(...)`, `custom_data_sources_list(...)`, `custom_dimensions_get(...)`, `custom_dimensions_insert(...)`, `custom_dimensions_list(...)`, `custom_dimensions_patch(...)`, `custom_dimensions_update(...)`, `custom_metrics_get(...)`, `custom_metrics_insert(...)`, `custom_metrics_list(...)`, `custom_metrics_patch(...)`, `custom_metrics_update(...)`, `experiments_delete(...)`, `experiments_get(...)`, `experiments_insert(...)`, `experiments_list(...)`, `experiments_patch(...)`, `experiments_update(...)`, `filters_delete(...)`, `filters_get(...)`, `filters_insert(...)`, `filters_list(...)`, `filters_patch(...)`, `filters_update(...)`, `goals_get(...)`, `goals_insert(...)`, `goals_list(...)`, `goals_patch(...)`, `goals_update(...)`, `profile_filter_links_delete(...)`, `profile_filter_links_get(...)`, `profile_filter_links_insert(...)`, `profile_filter_links_list(...)`, `profile_filter_links_patch(...)`, `profile_filter_links_update(...)`, `profile_user_links_delete(...)`, `profile_user_links_insert(...)`, `profile_user_links_list(...)`, `profile_user_links_update(...)`, `profiles_delete(...)`, `profiles_get(...)`, `profiles_insert(...)`, `profiles_list(...)`, `profiles_patch(...)`, `profiles_update(...)`, `remarketing_audience_delete(...)`, `remarketing_audience_get(...)`, `remarketing_audience_insert(...)`, `remarketing_audience_list(...)`, `remarketing_audience_patch(...)`, `remarketing_audience_update(...)`, `segments_list(...)`, `unsampled_reports_delete(...)`, `unsampled_reports_get(...)`, `unsampled_reports_insert(...)`, `unsampled_reports_list(...)`, `uploads_delete_upload_data(...)`, `uploads_get(...)`, `uploads_list(...)`, `uploads_upload_data(...)`, `web_property_ad_words_links_delete(...)`, `web_property_ad_words_links_get(...)`, `web_property_ad_words_links_insert(...)`, `web_property_ad_words_links_list(...)`, `web_property_ad_words_links_patch(...)`, `web_property_ad_words_links_update(...)`, `webproperties_get(...)`, `webproperties_insert(...)`, `webproperties_list(...)`, `webproperties_patch(...)`, `webproperties_update(...)`, `webproperty_user_links_delete(...)`, `webproperty_user_links_insert(...)`, `webproperty_user_links_list(...)` and `webproperty_user_links_update(...)` /// // to build up your call. /// let rb = hub.management(); /// # } @@ -4554,6 +4530,27 @@ impl<'a, C, A> ManagementMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates an existing web property. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `accountId` - Account ID to which the web property belongs + /// * `webPropertyId` - Web property ID + pub fn webproperties_patch(&self, request: Webproperty, account_id: &str, web_property_id: &str) -> ManagementWebpropertyPatchCall<'a, C, A> { + ManagementWebpropertyPatchCall { + hub: self.hub, + _request: request, + _account_id: account_id.to_string(), + _web_property_id: web_property_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// List uploads to which the user has access. @@ -4885,19 +4882,19 @@ impl<'a, C, A> ManagementMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates an existing web property. This method supports patch semantics. + /// Delete a remarketing audience. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `accountId` - Account ID to which the web property belongs - /// * `webPropertyId` - Web property ID - pub fn webproperties_patch(&self, request: Webproperty, account_id: &str, web_property_id: &str) -> ManagementWebpropertyPatchCall<'a, C, A> { - ManagementWebpropertyPatchCall { + /// * `accountId` - Account ID to which the remarketing audience belongs. + /// * `webPropertyId` - Web property ID to which the remarketing audience belongs. + /// * `remarketingAudienceId` - The ID of the remarketing audience to delete. + pub fn remarketing_audience_delete(&self, account_id: &str, web_property_id: &str, remarketing_audience_id: &str) -> ManagementRemarketingAudienceDeleteCall<'a, C, A> { + ManagementRemarketingAudienceDeleteCall { hub: self.hub, - _request: request, _account_id: account_id.to_string(), _web_property_id: web_property_id.to_string(), + _remarketing_audience_id: remarketing_audience_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5596,7 +5593,7 @@ impl<'a, C, A> ManagementWebpropertyInsertCall<'a, C, A> where C: BorrowMut ManagementProfileGetCall<'a, C, A> where C: BorrowMut ManagementAccountListCall<'a, C, A> where C: BorrowMut ManagementProfileFilterLinkPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -6645,7 +6642,7 @@ impl<'a, C, A> ManagementWebpropertyUserLinkDeleteCall<'a, C, A> where C: Borrow } - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -6895,7 +6892,7 @@ impl<'a, C, A> ManagementProfileUserLinkDeleteCall<'a, C, A> where C: BorrowMut< } - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -7163,7 +7160,7 @@ impl<'a, C, A> ManagementProfileUserLinkUpdateCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks/{linkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -7459,7 +7456,7 @@ impl<'a, C, A> ManagementFilterInsertCall<'a, C, A> where C: BorrowMut ManagementAccountUserLinkUpdateCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/entityUserLinks/{linkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/entityUserLinks/{linkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -8002,7 +7999,7 @@ impl<'a, C, A> ManagementProfileFilterLinkGetCall<'a, C, A> where C: BorrowMut ManagementWebpropertyUserLinkUpdateCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks/{linkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -8568,7 +8565,7 @@ impl<'a, C, A> ManagementUnsampledReportInsertCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8852,7 +8849,7 @@ impl<'a, C, A> ManagementProfileFilterLinkDeleteCall<'a, C, A> where C: BorrowMu } - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -9118,7 +9115,7 @@ impl<'a, C, A> ManagementRemarketingAudienceUpdateCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -9401,7 +9398,7 @@ impl<'a, C, A> ManagementCustomMetricGetCall<'a, C, A> where C: BorrowMut ManagementUploadGetCall<'a, C, A> where C: BorrowMut ManagementExperimentPatchCall<'a, C, A> where C: BorrowMut ManagementWebpropertyUserLinkListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUserReadonly.as_ref().to_string(), ()); } @@ -10513,7 +10510,7 @@ impl<'a, C, A> ManagementProfileFilterLinkUpdateCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks/{linkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -10808,7 +10805,7 @@ impl<'a, C, A> ManagementExperimentGetCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionUpdateCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions/{customDimensionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -11381,7 +11378,7 @@ impl<'a, C, A> ManagementUnsampledReportGetCall<'a, C, A> where C: BorrowMut ManagementProfileFilterLinkInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -11945,7 +11942,7 @@ impl<'a, C, A> ManagementFilterUpdateCall<'a, C, A> where C: BorrowMut ManagementUploadUploadDataCall<'a, C, A> where C: BorrowMut ManagementWebPropertyAdWordsLinkListCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12864,7 +12861,7 @@ impl<'a, C, A> ManagementExperimentInsertCall<'a, C, A> where C: BorrowMut ManagementSegmentListCall<'a, C, A> where C: BorrowMut ManagementProfileDeleteCall<'a, C, A> where C: BorrowMut ManagementGoalPatchCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionPatchCall<'a, C, A> where C: BorrowMut ManagementWebPropertyAdWordsLinkGetCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -14494,7 +14491,7 @@ impl<'a, C, A> ManagementExperimentListCall<'a, C, A> where C: BorrowMut ManagementProfileListCall<'a, C, A> where C: BorrowMut ManagementGoalListCall<'a, C, A> where C: BorrowMut ManagementGoalInsertCall<'a, C, A> where C: BorrowMut ManagementCustomMetricPatchCall<'a, C, A> where C: BorrowMut ManagementProfileFilterLinkListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/profileFilterLinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -16199,7 +16196,7 @@ impl<'a, C, A> ManagementAccountUserLinkInsertCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/entityUserLinks"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/entityUserLinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -16467,7 +16464,7 @@ impl<'a, C, A> ManagementWebpropertyUserLinkInsertCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityUserLinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -16745,7 +16742,7 @@ impl<'a, C, A> ManagementCustomMetricInsertCall<'a, C, A> where C: BorrowMut ManagementUnsampledReportDeleteCall<'a, C, A> where C: BorrowMut< } - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/unsampledReports/{unsampledReportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -17285,7 +17282,7 @@ impl<'a, C, A> ManagementProfilePatchCall<'a, C, A> where C: BorrowMut ManagementFilterGetCall<'a, C, A> where C: BorrowMut ManagementAccountSummaryListCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionListCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Analytics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Webproperty::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.management().webproperties_patch(req, "accountId", "webPropertyId") +/// .doit(); +/// # } +/// ``` +pub struct ManagementWebpropertyPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Analytics, + _request: Webproperty, + _account_id: String, + _web_property_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ManagementWebpropertyPatchCall<'a, C, A> {} + +impl<'a, C, A> ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Webproperty)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "analytics.management.webproperties.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("accountId", self._account_id.to_string())); + params.push(("webPropertyId", self._web_property_id.to_string())); + for &field in ["alt", "accountId", "webPropertyId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{accountId}", "accountId"), ("{webPropertyId}", "webPropertyId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["webPropertyId", "accountId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: Webproperty) -> ManagementWebpropertyPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Account ID to which the web property belongs + /// + /// Sets the *account id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn account_id(mut self, new_value: &str) -> ManagementWebpropertyPatchCall<'a, C, A> { + self._account_id = new_value.to_string(); + self + } + /// Web property ID + /// + /// Sets the *web property id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn web_property_id(mut self, new_value: &str) -> ManagementWebpropertyPatchCall<'a, C, A> { + self._web_property_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ManagementWebpropertyPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ManagementWebpropertyPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Edit`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ManagementWebpropertyPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// List uploads to which the user has access. /// /// A builder for the *uploads.list* method supported by a *management* resource. @@ -18265,8 +18540,8 @@ impl<'a, C, A> ManagementCustomDimensionListCall<'a, C, A> where C: BorrowMut ManagementUploadListCall<'a, C, A> where C: BorrowMut ManagementUploadListCall<'a, C, A> where C: BorrowMut ManagementProfileUserLinkListCall<'a, C, A> where C: BorrowMut ManagementRemarketingAudienceInsertCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -19155,7 +19430,7 @@ impl<'a, C, A> ManagementWebPropertyAdWordsLinkDeleteCall<'a, C, A> where C: Bor } - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -19410,7 +19685,7 @@ impl<'a, C, A> ManagementUploadDeleteUploadDataCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDataSources/{customDataSourceId}/deleteUploadData".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19688,7 +19963,7 @@ impl<'a, C, A> ManagementWebPropertyAdWordsLinkInsertCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -19962,7 +20237,7 @@ impl<'a, C, A> ManagementExperimentDeleteCall<'a, C, A> where C: BorrowMut ManagementGoalUpdateCall<'a, C, A> where C: BorrowMut ManagementGoalUpdateCall<'a, C, A> where C: BorrowMut ManagementCustomDataSourceListCall<'a, C, A> where C: BorrowMut ManagementCustomDataSourceListCall<'a, C, A> where C: BorrowMut ManagementCustomMetricListCall<'a, C, A> where C: BorrowMut ManagementCustomMetricListCall<'a, C, A> where C: BorrowMut ManagementUnsampledReportListCall<'a, C, A> where C: BorrowMut ManagementWebpropertyGetCall<'a, C, A> where C: BorrowMut ManagementProfileUpdateCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionGetCall<'a, C, A> where C: BorrowMut ManagementRemarketingAudienceGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -22329,9 +22604,9 @@ impl<'a, C, A> ManagementRemarketingAudienceGetCall<'a, C, A> where C: BorrowMut } -/// Updates an existing web property. This method supports patch semantics. +/// Delete a remarketing audience. /// -/// A builder for the *webproperties.patch* method supported by a *management* resource. +/// A builder for the *remarketingAudience.delete* method supported by a *management* resource. /// It is not used directly, but through a `ManagementMethods` instance. /// /// # Example @@ -22342,7 +22617,6 @@ impl<'a, C, A> ManagementRemarketingAudienceGetCall<'a, C, A> where C: BorrowMut /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_analytics3 as analytics3; -/// use analytics3::Webproperty; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -22353,37 +22627,32 @@ impl<'a, C, A> ManagementRemarketingAudienceGetCall<'a, C, A> where C: BorrowMut /// # hyper::Client::new(), /// # ::default(), None); /// # let mut hub = Analytics::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = Webproperty::default(); -/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.management().webproperties_patch(req, "accountId", "webPropertyId") +/// let result = hub.management().remarketing_audience_delete("accountId", "webPropertyId", "remarketingAudienceId") /// .doit(); /// # } /// ``` -pub struct ManagementWebpropertyPatchCall<'a, C, A> +pub struct ManagementRemarketingAudienceDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Analytics, - _request: Webproperty, _account_id: String, _web_property_id: String, + _remarketing_audience_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ManagementWebpropertyPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ManagementRemarketingAudienceDeleteCall<'a, C, A> {} -impl<'a, C, A> ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ManagementRemarketingAudienceDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Webproperty)> { + pub fn doit(mut self) -> Result { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -22391,12 +22660,13 @@ impl<'a, C, A> ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "analytics.management.webproperties.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: "analytics.management.remarketingAudience.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("accountId", self._account_id.to_string())); params.push(("webPropertyId", self._web_property_id.to_string())); - for &field in ["alt", "accountId", "webPropertyId"].iter() { + params.push(("remarketingAudienceId", self._remarketing_audience_id.to_string())); + for &field in ["accountId", "webPropertyId", "remarketingAudienceId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -22406,14 +22676,13 @@ impl<'a, C, A> ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -22424,8 +22693,8 @@ impl<'a, C, A> ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["webPropertyId", "accountId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["remarketingAudienceId", "webPropertyId", "accountId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -22440,17 +22709,6 @@ impl<'a, C, A> ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut Err(Error::BadRequest(serr)) } } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; + let result_value = res; dlg.finished(true); return Ok(result_value) @@ -22526,42 +22770,43 @@ impl<'a, C, A> ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut ManagementWebpropertyPatchCall<'a, C, A> { - self._request = new_value; - self - } - /// Account ID to which the web property belongs + /// Account ID to which the remarketing audience belongs. /// /// Sets the *account id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> ManagementWebpropertyPatchCall<'a, C, A> { + pub fn account_id(mut self, new_value: &str) -> ManagementRemarketingAudienceDeleteCall<'a, C, A> { self._account_id = new_value.to_string(); self } - /// Web property ID + /// Web property ID to which the remarketing audience belongs. /// /// Sets the *web property id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn web_property_id(mut self, new_value: &str) -> ManagementWebpropertyPatchCall<'a, C, A> { + pub fn web_property_id(mut self, new_value: &str) -> ManagementRemarketingAudienceDeleteCall<'a, C, A> { self._web_property_id = new_value.to_string(); self } + /// The ID of the remarketing audience to delete. + /// + /// Sets the *remarketing audience id* path property to 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_audience_id(mut self, new_value: &str) -> ManagementRemarketingAudienceDeleteCall<'a, C, A> { + self._remarketing_audience_id = new_value.to_string(); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ManagementWebpropertyPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ManagementRemarketingAudienceDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -22582,7 +22827,7 @@ impl<'a, C, A> ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ManagementWebpropertyPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ManagementRemarketingAudienceDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -22599,7 +22844,7 @@ impl<'a, C, A> ManagementWebpropertyPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ManagementWebpropertyPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ManagementRemarketingAudienceDeleteCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -22686,7 +22931,7 @@ impl<'a, C, A> ManagementWebpropertyUpdateCall<'a, C, A> where C: BorrowMut ManagementCustomDimensionInsertCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/customDimensions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -23234,7 +23479,7 @@ impl<'a, C, A> ManagementAccountUserLinkDeleteCall<'a, C, A> where C: BorrowMut< } - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/entityUserLinks/{linkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/entityUserLinks/{linkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -23480,7 +23725,7 @@ impl<'a, C, A> ManagementProfileUserLinkInsertCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/entityUserLinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageUser.as_ref().to_string(), ()); } @@ -23772,7 +24017,7 @@ impl<'a, C, A> ManagementExperimentUpdateCall<'a, C, A> where C: BorrowMut ManagementExperimentUpdateCall<'a, C, A> where C: BorrowMut ManagementWebpropertyListCall<'a, C, A> where C: BorrowMut ManagementWebPropertyAdWordsLinkPatchCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -24616,7 +24861,7 @@ impl<'a, C, A> ManagementGoalGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/profiles/{profileId}/goals/{goalId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -24897,7 +25142,7 @@ impl<'a, C, A> ManagementCustomMetricUpdateCall<'a, C, A> where C: BorrowMut ManagementRemarketingAudiencePatchCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences/{remarketingAudienceId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -25484,7 +25729,7 @@ impl<'a, C, A> ManagementWebPropertyAdWordsLinkUpdateCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/entityAdWordsLinks/{webPropertyAdWordsLinkId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Edit.as_ref().to_string(), ()); } @@ -25772,7 +26017,7 @@ impl<'a, C, A> ManagementFilterPatchCall<'a, C, A> where C: BorrowMut ManagementFilterPatchCall<'a, C, A> where C: BorrowMut ManagementFilterListCall<'a, C, A> where C: BorrowMut ManagementFilterDeleteCall<'a, C, A> where C: BorrowMut ManagementProfileInsertCall<'a, C, A> where C: BorrowMut ManagementProfileInsertCall<'a, C, A> where C: BorrowMut ManagementAccountUserLinkListCall<'a, C, A> where C: BorrowMut ManagementAccountUserLinkListCall<'a, C, A> where C: BorrowMut ManagementRemarketingAudienceListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences"; + let mut url = "https://www.googleapis.com/analytics/v3/management/accounts/{accountId}/webproperties/{webPropertyId}/remarketingAudiences".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -27323,12 +27568,12 @@ impl<'a, C, A> ManagementRemarketingAudienceListCall<'a, C, A> where C: BorrowMu /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.data().mcf_get("ids", "start-date", "end-date", "metrics") -/// .start_index(-68) +/// .start_index(-47) /// .sort("aliquyam") -/// .sampling_level("nonumy") -/// .max_results(-47) -/// .filters("aliquyam") -/// .dimensions("sadipscing") +/// .sampling_level("sadipscing") +/// .max_results(-32) +/// .filters("gubergren") +/// .dimensions("sit") /// .doit(); /// # } /// ``` @@ -27402,7 +27647,7 @@ impl<'a, C, A> DataMcfGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "data/mcf"; + let mut url = "https://www.googleapis.com/analytics/v3/data/mcf".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -27645,15 +27890,15 @@ impl<'a, C, A> DataMcfGetCall<'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.data().ga_get("ids", "start-date", "end-date", "metrics") -/// .start_index(-2) -/// .sort("amet") -/// .segment("eirmod") -/// .sampling_level("sanctus") -/// .output("Lorem") -/// .max_results(-1) +/// .start_index(-58) +/// .sort("Lorem") +/// .segment("amet.") +/// .sampling_level("diam") +/// .output("eirmod") +/// .max_results(-45) /// .include_empty_rows(true) -/// .filters("eirmod") -/// .dimensions("sadipscing") +/// .filters("sed") +/// .dimensions("sit") /// .doit(); /// # } /// ``` @@ -27739,7 +27984,7 @@ impl<'a, C, A> DataGaGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "data/ga"; + let mut url = "https://www.googleapis.com/analytics/v3/data/ga".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -28003,10 +28248,10 @@ impl<'a, C, A> DataGaGetCall<'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.data().realtime_get("ids", "metrics") -/// .sort("sit") -/// .max_results(-33) -/// .filters("et") -/// .dimensions("At") +/// .sort("At") +/// .max_results(-98) +/// .filters("ut") +/// .dimensions("diam") /// .doit(); /// # } /// ``` @@ -28068,7 +28313,7 @@ impl<'a, C, A> DataRealtimeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "data/realtime"; + let mut url = "https://www.googleapis.com/analytics/v3/data/realtime".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -28325,7 +28570,7 @@ impl<'a, C, A> ProvisioningCreateAccountTicketCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "provisioning/createAccountTicket"; + let mut url = "https://www.googleapis.com/analytics/v3/provisioning/createAccountTicket".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Provision.as_ref().to_string(), ()); } @@ -28553,7 +28798,7 @@ impl<'a, C, A> MetadataColumnListCall<'a, C, A> where C: BorrowMut MetadataColumnListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Android Enterprise (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/androidenterprise1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-androidenterprise1] path = "../androidenterprise1" -version = "1.0.4+20161207" +version = "1.0.4+20170516" diff --git a/gen/androidenterprise1-cli/README.md b/gen/androidenterprise1-cli/README.md index 116b9d4250..5733fdba2d 100644 --- a/gen/androidenterprise1-cli/README.md +++ b/gen/androidenterprise1-cli/README.md @@ -25,23 +25,10 @@ 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 *20161207*. The CLI is at version *1.0.4*. +This documentation was generated from the *Android Enterprise* API at revision *20170516*. The CLI is at version *1.0.4*. ```bash androidenterprise1 [options] - collections - delete [-p ]... - get [-p ]... [-o ] - insert (-r )... [-p ]... [-o ] - list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] - update (-r )... [-p ]... [-o ] - collectionviewers - delete [-p ]... - get [-p ]... [-o ] - list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] - update (-r )... [-p ]... [-o ] devices get [-p ]... [-o ] get-state [-p ]... [-o ] @@ -103,7 +90,6 @@ androidenterprise1 [options] get-permissions [-p ]... [-o ] list [-p ]... [-o ] unapprove [-p ]... - update-permissions (-r )... [-p ]... [-o ] serviceaccountkeys delete [-p ]... insert (-r )... [-p ]... [-o ] diff --git a/gen/androidenterprise1-cli/mkdocs.yml b/gen/androidenterprise1-cli/mkdocs.yml index cd55ef72e9..fb709d698f 100644 --- a/gen/androidenterprise1-cli/mkdocs.yml +++ b/gen/androidenterprise1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Enterprise v1.0.4+20161207 +site_name: Android Enterprise v1.0.4+20170516 site_url: http://byron.github.io/google-apis-rs/google-androidenterprise1-cli site_description: A complete library to interact with Android Enterprise (protocol v1) @@ -9,17 +9,6 @@ site_dir: build_html pages: - ['index.md', 'Home'] -- ['collections_delete.md', 'Collections', 'Delete'] -- ['collections_get.md', 'Collections', 'Get'] -- ['collections_insert.md', 'Collections', 'Insert'] -- ['collections_list.md', 'Collections', 'List'] -- ['collections_patch.md', 'Collections', 'Patch'] -- ['collections_update.md', 'Collections', 'Update'] -- ['collectionviewers_delete.md', 'Collectionviewers', 'Delete'] -- ['collectionviewers_get.md', 'Collectionviewers', 'Get'] -- ['collectionviewers_list.md', 'Collectionviewers', 'List'] -- ['collectionviewers_patch.md', 'Collectionviewers', 'Patch'] -- ['collectionviewers_update.md', 'Collectionviewers', 'Update'] - ['devices_get.md', 'Devices', 'Get'] - ['devices_get-state.md', 'Devices', 'Get State'] - ['devices_list.md', 'Devices', 'List'] @@ -71,7 +60,6 @@ pages: - ['products_get-permissions.md', 'Products', 'Get Permissions'] - ['products_list.md', 'Products', 'List'] - ['products_unapprove.md', 'Products', 'Unapprove'] -- ['products_update-permissions.md', 'Products', 'Update Permissions'] - ['serviceaccountkeys_delete.md', 'Serviceaccountkeys', 'Delete'] - ['serviceaccountkeys_insert.md', 'Serviceaccountkeys', 'Insert'] - ['serviceaccountkeys_list.md', 'Serviceaccountkeys', 'List'] diff --git a/gen/androidenterprise1-cli/src/main.rs b/gen/androidenterprise1-cli/src/main.rs index 82d493cf33..3e78e569d4 100644 --- a/gen/androidenterprise1-cli/src/main.rs +++ b/gen/androidenterprise1-cli/src/main.rs @@ -46,751 +46,6 @@ struct Engine<'n> { impl<'n> Engine<'n> { - fn _collections_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.collections().delete(opt.value_of("enterprise-id").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 { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.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 _collections_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.collections().get(opt.value_of("enterprise-id").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 { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _collections_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 })), - "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "visibility" => Some(("visibility", 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", "kind", "name", "product-id", "visibility"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::Collection = json::value::from_value(object).unwrap(); - let mut call = self.hub.collections().insert(request, opt.value_of("enterprise-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _collections_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.collections().list(opt.value_of("enterprise-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _collections_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 })), - "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "visibility" => Some(("visibility", 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", "kind", "name", "product-id", "visibility"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::Collection = json::value::from_value(object).unwrap(); - let mut call = self.hub.collections().patch(request, opt.value_of("enterprise-id").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 { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _collections_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 })), - "product-id" => Some(("productId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "visibility" => Some(("visibility", 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", "kind", "name", "product-id", "visibility"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::Collection = json::value::from_value(object).unwrap(); - let mut call = self.hub.collections().update(request, opt.value_of("enterprise-id").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 { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _collectionviewers_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.collectionviewers().delete(opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("collection-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 _collectionviewers_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.collectionviewers().get(opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("collection-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); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _collectionviewers_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.collectionviewers().list(opt.value_of("enterprise-id").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 { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _collectionviewers_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 })), - "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "account-identifier" => Some(("accountIdentifier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "management-type" => Some(("managementType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "primary-email" => Some(("primaryEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "account-type" => Some(("accountType", 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!["account-identifier", "account-type", "display-name", "id", "kind", "management-type", "primary-email"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::User = json::value::from_value(object).unwrap(); - let mut call = self.hub.collectionviewers().patch(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("collection-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); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _collectionviewers_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 })), - "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "account-identifier" => Some(("accountIdentifier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "management-type" => Some(("managementType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "primary-email" => Some(("primaryEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "account-type" => Some(("accountType", 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!["account-identifier", "account-type", "display-name", "id", "kind", "management-type", "primary-email"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::User = json::value::from_value(object).unwrap(); - let mut call = self.hub.collectionviewers().update(request, opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("collection-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); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_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_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.devices().get(opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("user-id").unwrap_or(""), opt.value_of("device-id").unwrap_or("")); @@ -3569,10 +2824,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "approved-permissions" => Some(("approvedPermissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "approval-url-info.kind" => Some(("approvalUrlInfo.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "approval-url-info.approval-url" => Some(("approvalUrlInfo.approvalUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["approval-url", "approval-url-info", "kind"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["approval-url", "approval-url-info", "approved-permissions", "kind"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3956,92 +3212,6 @@ impl<'n> Engine<'n> { } } - fn _products_update_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()[..] { - "kind" => Some(("kind", 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"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::ProductPermissions = json::value::from_value(object).unwrap(); - let mut call = self.hub.products().update_permissions(request, 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 _serviceaccountkeys_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.serviceaccountkeys().delete(opt.value_of("enterprise-id").unwrap_or(""), opt.value_of("key-id").unwrap_or("")); @@ -5761,55 +4931,6 @@ impl<'n> Engine<'n> { let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { - ("collections", Some(opt)) => { - match opt.subcommand() { - ("delete", Some(opt)) => { - call_result = self._collections_delete(opt, dry_run, &mut err); - }, - ("get", Some(opt)) => { - call_result = self._collections_get(opt, dry_run, &mut err); - }, - ("insert", Some(opt)) => { - call_result = self._collections_insert(opt, dry_run, &mut err); - }, - ("list", Some(opt)) => { - call_result = self._collections_list(opt, dry_run, &mut err); - }, - ("patch", Some(opt)) => { - call_result = self._collections_patch(opt, dry_run, &mut err); - }, - ("update", Some(opt)) => { - call_result = self._collections_update(opt, dry_run, &mut err); - }, - _ => { - err.issues.push(CLIError::MissingMethodError("collections".to_string())); - writeln!(io::stderr(), "{}\n", opt.usage()).ok(); - } - } - }, - ("collectionviewers", Some(opt)) => { - match opt.subcommand() { - ("delete", Some(opt)) => { - call_result = self._collectionviewers_delete(opt, dry_run, &mut err); - }, - ("get", Some(opt)) => { - call_result = self._collectionviewers_get(opt, dry_run, &mut err); - }, - ("list", Some(opt)) => { - call_result = self._collectionviewers_list(opt, dry_run, &mut err); - }, - ("patch", Some(opt)) => { - call_result = self._collectionviewers_patch(opt, dry_run, &mut err); - }, - ("update", Some(opt)) => { - call_result = self._collectionviewers_update(opt, dry_run, &mut err); - }, - _ => { - err.issues.push(CLIError::MissingMethodError("collectionviewers".to_string())); - writeln!(io::stderr(), "{}\n", opt.usage()).ok(); - } - } - }, ("devices", Some(opt)) => { match opt.subcommand() { ("get", Some(opt)) => { @@ -6037,9 +5158,6 @@ impl<'n> Engine<'n> { ("unapprove", Some(opt)) => { call_result = self._products_unapprove(opt, dry_run, &mut err); }, - ("update-permissions", Some(opt)) => { - call_result = self._products_update_permissions(opt, dry_run, &mut err); - }, _ => { err.issues.push(CLIError::MissingMethodError("products".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -6238,350 +5356,6 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("collections", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ - ("delete", - Some(r##"Deletes a collection."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collections_delete", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"collection-id"##), - None, - Some(r##"The ID of the collection."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - ]), - ("get", - Some(r##"Retrieves the details of a collection."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collections_get", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"collection-id"##), - None, - Some(r##"The ID of the collection."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("insert", - Some(r##"Creates a new collection."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collections_insert", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("list", - Some(r##"Retrieves the IDs of all the collections for an enterprise."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collections_list", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Updates a collection. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collections_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"collection-id"##), - None, - Some(r##"The ID of the collection."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(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 collection."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collections_update", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"collection-id"##), - None, - Some(r##"The ID of the collection."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ]), - - ("collectionviewers", "methods: 'delete', 'get', 'list', 'patch' and 'update'", vec![ - ("delete", - Some(r##"Removes the user from the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collectionviewers_delete", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"collection-id"##), - None, - Some(r##"The ID of the collection."##), - 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)), - ]), - ("get", - Some(r##"Retrieves the ID of the user if they have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collectionviewers_get", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"collection-id"##), - None, - Some(r##"The ID of the collection."##), - 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)), - - (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 IDs of the users who have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collectionviewers_list", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"collection-id"##), - None, - Some(r##"The ID of the collection."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("patch", - Some(r##"Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collectionviewers_patch", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"collection-id"##), - None, - Some(r##"The ID of the collection."##), - Some(true), - Some(false)), - - (Some(r##"user-id"##), - None, - Some(r##"The ID of the 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)), - ]), - ("update", - Some(r##"Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/collectionviewers_update", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"collection-id"##), - None, - Some(r##"The ID of the collection."##), - Some(true), - Some(false)), - - (Some(r##"user-id"##), - None, - Some(r##"The ID of the 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)), - ]), - ]), - ("devices", "methods: 'get', 'get-state', 'list' and 'set-state'", vec![ ("get", Some(r##"Retrieves the details of a device."##), @@ -6749,7 +5523,7 @@ fn main() { Some(false)), ]), ("create-web-token", - Some(r##"Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the Play for Work javascript API. Each token may only be used to start one UI session. See the javascript API documentation for further information."##), + Some(r##"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."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/enterprises_create-web-token", vec![ (Some(r##"enterprise-id"##), @@ -6777,7 +5551,7 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes the binding between the EMM and enterprise. This is now deprecated; use this to unenroll customers that were previously enrolled with the 'insert' call, then enroll them again with the 'enroll' call."##), + Some(r##"Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled with the insert call, then enroll them again with the enroll call."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/enterprises_delete", vec![ (Some(r##"enterprise-id"##), @@ -6887,7 +5661,7 @@ fn main() { Some(false)), ]), ("get-store-layout", - Some(r##"Returns the store layout for the enterprise. If the store layout has not been set, or if the store layout has no homepageId set, returns a NOT_FOUND error."##), + Some(r##"Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/enterprises_get-store-layout", vec![ (Some(r##"enterprise-id"##), @@ -6960,7 +5734,7 @@ fn main() { ]), ("pull-notification-set", Some(r##"Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. - A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises​.AcknowledgeNotificationSet, unless the notification set is empty. + A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty. Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending. If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available."##), @@ -7001,7 +5775,7 @@ fn main() { Some(false)), ]), ("set-account", - Some(r##"Set the account that will be used to authenticate to the API as the enterprise."##), + Some(r##"Sets the account that will be used to authenticate to the API as the enterprise."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/enterprises_set-account", vec![ (Some(r##"enterprise-id"##), @@ -7029,7 +5803,7 @@ fn main() { Some(false)), ]), ("set-store-layout", - Some(r##"Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the administrator, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom"), the basic store layout is disabled."##), + Some(r##"Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/enterprises_set-store-layout", vec![ (Some(r##"enterprise-id"##), @@ -7076,7 +5850,7 @@ fn main() { ("entitlements", "methods: 'delete', 'get', 'list', 'patch' and 'update'", vec![ ("delete", - Some(r##"Removes an entitlement to an app for a user and uninstalls it."##), + Some(r##"Removes an entitlement to an app for a user."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/entitlements_delete", vec![ (Some(r##"enterprise-id"##), @@ -7138,7 +5912,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"List of all entitlements for the specified user. Only the ID is set."##), + Some(r##"Lists all entitlements for the specified user. Only the ID is set."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/entitlements_list", vec![ (Some(r##"enterprise-id"##), @@ -7441,7 +6215,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary. This method supports patch semantics."##), + Some(r##"Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/installs_patch", vec![ (Some(r##"enterprise-id"##), @@ -7487,7 +6261,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary."##), + Some(r##"Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/installs_update", vec![ (Some(r##"enterprise-id"##), @@ -7935,11 +6709,11 @@ fn main() { ]), ]), - ("products", "methods: 'approve', 'generate-approval-url', 'get', 'get-app-restrictions-schema', 'get-permissions', 'list', 'unapprove' and 'update-permissions'", vec![ + ("products", "methods: 'approve', 'generate-approval-url', 'get', 'get-app-restrictions-schema', 'get-permissions', 'list' and 'unapprove'", vec![ ("approve", Some(r##"Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000. - To learn how to use Google Play for Work to design and create a store layout to display approved products to your users, see Store Layout Design."##), + To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/products_approve", vec![ (Some(r##"enterprise-id"##), @@ -8025,7 +6799,7 @@ fn main() { Some(false)), ]), ("get-app-restrictions-schema", - Some(r##"Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an administrator to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play."##), + Some(r##"Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/products_get-app-restrictions-schema", vec![ (Some(r##"enterprise-id"##), @@ -8124,42 +6898,6 @@ fn main() { Some(false), Some(true)), ]), - ("update-permissions", - Some(r##"This method has been deprecated. To programmatically approve applications, you must use the iframe mechanism via the generateApprovalUrl and approve methods of the Products resource. For more information, see the Play EMM API usage requirements. - - The updatePermissions method (deprecated) updates the set of Android app permissions for this app that have been accepted by the enterprise."##), - "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/products_update-permissions", - vec![ - (Some(r##"enterprise-id"##), - None, - Some(r##"The ID of the enterprise."##), - Some(true), - Some(false)), - - (Some(r##"product-id"##), - None, - Some(r##"The ID of the product."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), ]), ("serviceaccountkeys", "methods: 'delete', 'insert' and 'list'", vec![ @@ -8671,7 +7409,7 @@ fn main() { Some(false)), ]), ("generate-token", - Some(r##"Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token. + Some(r##"Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token. This call only works with Google managed accounts."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/users_generate-token", @@ -8874,7 +7612,7 @@ fn main() { Some(true)), ]), ("set-available-product-set", - Some(r##"Modifies the set of products a user is entitled to access."##), + Some(r##"Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that were previously approved (products with revoked approval) can be whitelisted."##), "Details at http://byron.github.io/google-apis-rs/google_androidenterprise1_cli/users_set-available-product-set", vec![ (Some(r##"enterprise-id"##), @@ -8949,7 +7687,7 @@ fn main() { let mut app = App::new("androidenterprise1") .author("Sebastian Thiel ") - .version("1.0.4+20161207") + .version("1.0.4+20170516") .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 a0628bb385..2501ce0901 100644 --- a/gen/androidenterprise1/Cargo.toml +++ b/gen/androidenterprise1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidenterprise1" -version = "1.0.4+20161207" +version = "1.0.4+20170516" 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.4+20161207" +documentation = "https://docs.rs/google-androidenterprise1/1.0.4+20170516" license = "MIT" keywords = ["androidenterprise", "google", "protocol", "web", "api"] diff --git a/gen/androidenterprise1/README.md b/gen/androidenterprise1/README.md index 881002a9d6..5249e26bc5 100644 --- a/gen/androidenterprise1/README.md +++ b/gen/androidenterprise1/README.md @@ -5,46 +5,42 @@ DO NOT EDIT ! --> The `google-androidenterprise1` library allows access to all features of the *Google Android Enterprise* service. -This documentation was generated from *Android Enterprise* crate version *1.0.4+20161207*, where *20161207* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Android Enterprise* crate version *1.0.4+20170516*, where *20170516* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161207/google_androidenterprise1/struct.AndroidEnterprise.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.AndroidEnterprise.html) ... -* [collections](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.Collection.html) - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionUpdateCall.html) -* collectionviewers - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionviewerDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionviewerGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionviewerListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionviewerPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.CollectionviewerUpdateCall.html) -* [devices](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.Device.html) - * [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.DeviceGetCall.html), [*get state*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.DeviceGetStateCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.DeviceListCall.html) and [*set state*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.DeviceSetStateCall.html) -* [enterprises](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.Enterprise.html) - * [*acknowledge notification set*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseAcknowledgeNotificationSetCall.html), [*complete signup*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseCompleteSignupCall.html), [*create web token*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseCreateWebTokenCall.html), [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseDeleteCall.html), [*enroll*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseEnrollCall.html), [*generate signup url*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseGenerateSignupUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseGetCall.html), [*get service account*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseGetServiceAccountCall.html), [*get store layout*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseGetStoreLayoutCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseListCall.html), [*pull notification set*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterprisePullNotificationSetCall.html), [*send test push notification*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseSendTestPushNotificationCall.html), [*set account*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseSetAccountCall.html), [*set store layout*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseSetStoreLayoutCall.html) and [*unenroll*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EnterpriseUnenrollCall.html) -* [entitlements](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.Entitlement.html) - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EntitlementDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EntitlementGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EntitlementListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EntitlementPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.EntitlementUpdateCall.html) +* [devices](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.Device.html) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.DeviceGetCall.html), [*get state*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.DeviceGetStateCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.DeviceListCall.html) and [*set state*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.DeviceSetStateCall.html) +* [enterprises](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.Enterprise.html) + * [*acknowledge notification set*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseAcknowledgeNotificationSetCall.html), [*complete signup*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseCompleteSignupCall.html), [*create web token*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseCreateWebTokenCall.html), [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseDeleteCall.html), [*enroll*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseEnrollCall.html), [*generate signup url*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseGenerateSignupUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseGetCall.html), [*get service account*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseGetServiceAccountCall.html), [*get store layout*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseGetStoreLayoutCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseListCall.html), [*pull notification set*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterprisePullNotificationSetCall.html), [*send test push notification*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseSendTestPushNotificationCall.html), [*set account*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseSetAccountCall.html), [*set store layout*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseSetStoreLayoutCall.html) and [*unenroll*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EnterpriseUnenrollCall.html) +* [entitlements](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.Entitlement.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EntitlementDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EntitlementGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EntitlementListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EntitlementPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.EntitlementUpdateCall.html) * grouplicenses - * [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.GrouplicenseGetCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.GrouplicenseListCall.html) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.GrouplicenseGetCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.GrouplicenseListCall.html) * grouplicenseusers - * [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.GrouplicenseuserListCall.html) -* [installs](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.Install.html) - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.InstallDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.InstallGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.InstallListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.InstallPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.InstallUpdateCall.html) + * [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.GrouplicenseuserListCall.html) +* [installs](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.Install.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.InstallDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.InstallGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.InstallListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.InstallPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.InstallUpdateCall.html) * managedconfigurationsfordevice - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ManagedconfigurationsfordeviceDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ManagedconfigurationsfordeviceGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ManagedconfigurationsfordeviceListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ManagedconfigurationsfordevicePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ManagedconfigurationsfordeviceUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ManagedconfigurationsfordeviceDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ManagedconfigurationsfordeviceGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ManagedconfigurationsfordeviceListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ManagedconfigurationsfordevicePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ManagedconfigurationsfordeviceUpdateCall.html) * managedconfigurationsforuser - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ManagedconfigurationsforuserDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ManagedconfigurationsforuserGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ManagedconfigurationsforuserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ManagedconfigurationsforuserPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ManagedconfigurationsforuserUpdateCall.html) -* [permissions](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.Permission.html) - * [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.PermissionGetCall.html) -* [products](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.Product.html) - * [*approve*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ProductApproveCall.html), [*generate approval url*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ProductGenerateApprovalUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ProductGetCall.html), [*get app restrictions schema*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ProductGetPermissionCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ProductListCall.html), [*unapprove*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ProductUnapproveCall.html) and [*update permissions*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ProductUpdatePermissionCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ManagedconfigurationsforuserDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ManagedconfigurationsforuserGetCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ManagedconfigurationsforuserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ManagedconfigurationsforuserPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ManagedconfigurationsforuserUpdateCall.html) +* [permissions](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.Permission.html) + * [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.PermissionGetCall.html) +* [products](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.Product.html) + * [*approve*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ProductApproveCall.html), [*generate approval url*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ProductGenerateApprovalUrlCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ProductGetCall.html), [*get app restrictions schema*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ProductGetPermissionCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ProductListCall.html) and [*unapprove*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ProductUnapproveCall.html) * serviceaccountkeys - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ServiceaccountkeyDeleteCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ServiceaccountkeyInsertCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.ServiceaccountkeyListCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ServiceaccountkeyDeleteCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ServiceaccountkeyInsertCall.html) and [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.ServiceaccountkeyListCall.html) * storelayoutclusters - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutclusterDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutclusterGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutclusterInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutclusterListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutclusterPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutclusterUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutclusterDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutclusterGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutclusterInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutclusterListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutclusterPatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutclusterUpdateCall.html) * storelayoutpages - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutpageDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutpageGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutpageInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutpageListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutpagePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.StorelayoutpageUpdateCall.html) -* [users](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.User.html) - * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserDeleteCall.html), [*generate authentication token*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserGenerateTokenCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserGetCall.html), [*get available product set*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserGetAvailableProductSetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserPatchCall.html), [*revoke token*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserRevokeTokenCall.html), [*set available product set*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserSetAvailableProductSetCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.UserUpdateCall.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutpageDeleteCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutpageGetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutpageInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutpageListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutpagePatchCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.StorelayoutpageUpdateCall.html) +* [users](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.User.html) + * [*delete*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserDeleteCall.html), [*generate authentication token*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserGenerateAuthenticationTokenCall.html), [*generate token*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserGenerateTokenCall.html), [*get*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserGetCall.html), [*get available product set*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserGetAvailableProductSetCall.html), [*insert*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserInsertCall.html), [*list*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserListCall.html), [*patch*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserPatchCall.html), [*revoke token*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserRevokeTokenCall.html), [*set available product set*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserSetAvailableProductSetCall.html) and [*update*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/struct.UserUpdateCall.html) @@ -53,17 +49,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/struct.AndroidEnterprise.html)** +* **[Hub](https://docs.rs/google-androidenterprise1/1.0.4+20170516/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.4+20161207/google_androidenterprise1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidenterprise1/1.0.4+20170516/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.4+20161207/google_androidenterprise1/trait.Part.html)** + * **[Parts](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androidenterprise1/1.0.4+20161207/google_androidenterprise1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androidenterprise1/1.0.4+20170516/google_androidenterprise1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -161,17 +157,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-androidenterprise1/1.0.4+20161207/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.4+20170516/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.4+20161207/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.4+20170516/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.4+20161207/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.4+20170516/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.4+20161207/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.4+20170516/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")`. @@ -181,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-androidenterprise1/1.0.4+20161207/google_androidenterprise1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-androidenterprise1/1.0.4+20161207/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.4+20170516/google_androidenterprise1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidenterprise1/1.0.4+20170516/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.4+20161207/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.4+20170516/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.4+20161207/google_androidenterprise1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-androidenterprise1/1.0.4+20161207/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.4+20170516/google_androidenterprise1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidenterprise1/1.0.4+20170516/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.4+20161207/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.4+20170516/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.4+20161207/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.4+20170516/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.4+20161207/google_androidenterprise1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androidenterprise1/1.0.4+20170516/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 73c02b30e2..a12135c9e2 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.4+20161207*, where *20161207* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Android Enterprise* crate version *1.0.4+20170516*, where *20170516* is the exact revision of the *androidenterprise:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! 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). @@ -11,10 +11,6 @@ //! //! Handle the following *Resources* with ease from the central [hub](struct.AndroidEnterprise.html) ... //! -//! * [collections](struct.Collection.html) -//! * [*delete*](struct.CollectionDeleteCall.html), [*get*](struct.CollectionGetCall.html), [*insert*](struct.CollectionInsertCall.html), [*list*](struct.CollectionListCall.html), [*patch*](struct.CollectionPatchCall.html) and [*update*](struct.CollectionUpdateCall.html) -//! * collectionviewers -//! * [*delete*](struct.CollectionviewerDeleteCall.html), [*get*](struct.CollectionviewerGetCall.html), [*list*](struct.CollectionviewerListCall.html), [*patch*](struct.CollectionviewerPatchCall.html) and [*update*](struct.CollectionviewerUpdateCall.html) //! * [devices](struct.Device.html) //! * [*get*](struct.DeviceGetCall.html), [*get state*](struct.DeviceGetStateCall.html), [*list*](struct.DeviceListCall.html) and [*set state*](struct.DeviceSetStateCall.html) //! * [enterprises](struct.Enterprise.html) @@ -34,7 +30,7 @@ //! * [permissions](struct.Permission.html) //! * [*get*](struct.PermissionGetCall.html) //! * [products](struct.Product.html) -//! * [*approve*](struct.ProductApproveCall.html), [*generate approval url*](struct.ProductGenerateApprovalUrlCall.html), [*get*](struct.ProductGetCall.html), [*get app restrictions schema*](struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](struct.ProductGetPermissionCall.html), [*list*](struct.ProductListCall.html), [*unapprove*](struct.ProductUnapproveCall.html) and [*update permissions*](struct.ProductUpdatePermissionCall.html) +//! * [*approve*](struct.ProductApproveCall.html), [*generate approval url*](struct.ProductGenerateApprovalUrlCall.html), [*get*](struct.ProductGetCall.html), [*get app restrictions schema*](struct.ProductGetAppRestrictionsSchemaCall.html), [*get permissions*](struct.ProductGetPermissionCall.html), [*list*](struct.ProductListCall.html) and [*unapprove*](struct.ProductUnapproveCall.html) //! * serviceaccountkeys //! * [*delete*](struct.ServiceaccountkeyDeleteCall.html), [*insert*](struct.ServiceaccountkeyInsertCall.html) and [*list*](struct.ServiceaccountkeyListCall.html) //! * storelayoutclusters @@ -216,7 +212,7 @@ // 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 +// 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)] @@ -342,8 +338,6 @@ pub struct AndroidEnterprise { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for AndroidEnterprise {} @@ -356,17 +350,9 @@ impl<'a, C, A> AndroidEnterprise client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/androidenterprise/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } - pub fn collections(&'a self) -> CollectionMethods<'a, C, A> { - CollectionMethods { hub: &self } - } - pub fn collectionviewers(&'a self) -> CollectionviewerMethods<'a, C, A> { - CollectionviewerMethods { hub: &self } - } pub fn devices(&'a self) -> DeviceMethods<'a, C, A> { DeviceMethods { hub: &self } } @@ -419,26 +405,6 @@ impl<'a, C, A> AndroidEnterprise self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/androidenterprise/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -505,15 +471,15 @@ pub struct EnterprisesListResponse { impl ResponseResult for EnterprisesListResponse {} -/// The existence of an entitlement resource means that a user has the right to use a particular app on any of their devices. This might be because the app is free or because they have been allocated a license to the app from a group license purchased by the enterprise. +/// The presence of an Entitlements resource indicates that a user has the right to use a particular app. Entitlements are user specific, not device specific. This allows a user with an entitlement to an app to install the app on all their devices. It's also possible for a user to hold an entitlement to an app without installing the app on any device. /// -/// It should always be true that a user has an app installed on one of their devices only if they have an entitlement to it. So if an entitlement is deleted, the app will be uninstalled from all devices. Similarly if the user installs an app (and is permitted to do so), or the EMM triggers an install of the app, an entitlement to that app is automatically created. If this is impossible - e.g. the enterprise has not purchased sufficient licenses - then installation fails. +/// The API can be used to create an entitlement. As an option, you can also use the API to trigger the installation of an app on all a user's managed devices at the same time the entitlement is created. /// -/// Note that entitlements are always user specific, not device specific; a user may have an entitlement even though they have not installed the app anywhere. Once they have an entitlement they can install the app on multiple devices. +/// If the app is free, creating the entitlement also creates a group license for that app. For paid apps, creating the entitlement consumes one license, and that license remains consumed until the entitlement is removed. If the enterprise hasn't purchased enough licenses, then no entitlement is created and the installation fails. An entitlement is also not created for an app if the app requires permissions that the enterprise hasn't accepted. /// -/// The API can be used to create an entitlement. If the app is a free app, a group license for that app is created. If it's a paid app, creating the entitlement consumes one license; it remains consumed until the entitlement is removed. Optionally an installation of the app on all the user's managed devices can be triggered at the time the entitlement is created. An entitlement cannot be created for an app if the app requires permissions that the enterprise has not yet accepted. +/// If an entitlement is deleted, the app may be uninstalled from a user's device. As a best practice, uninstall the app by calling Installs.delete() before deleting the entitlement. /// -/// Entitlements for paid apps that are due to purchases by the user on a non-managed profile will have "userPurchase" as entitlement reason; those entitlements cannot be removed via the API. +/// Entitlements for apps that a user pays for on an unmanaged profile have "userPurchase" as the entitlement reason. These entitlements cannot be removed via the API. /// /// # Activities /// @@ -530,9 +496,9 @@ impl ResponseResult for EnterprisesListResponse {} pub struct Entitlement { /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#entitlement". pub kind: Option, - /// The reason for the entitlement, e.g. "free" for free apps. This is temporary, it will be replaced by the acquisition kind field of group licenses. + /// The reason for the entitlement. For example, "free" for free apps. This property is temporary: it will be replaced by the acquisition kind field of group licenses. pub reason: Option, - /// The ID of the product that the entitlement is for, e.g. "app:com.google.android.gm". + /// The ID of the product that the entitlement is for. For example, "app:com.google.android.gm". #[serde(rename="productId")] pub product_id: Option, } @@ -600,7 +566,7 @@ pub struct ProductSet { /// The list of product IDs making up the set of products. #[serde(rename="productId")] pub product_id: Option>, - /// The interpretation of this product set. "unknown" should never be sent and ignored if received. "whitelist" means that this product set constitutes a whitelist. "includeAll" means that all products are accessible, including products that are approved, not approved, and even products where approval has been revoked. If the value is "includeAll", the value of the productId field is therefore ignored. If a value is not supplied, it is interpreted to be "whitelist" for backwards compatibility. + /// The interpretation of this product set. "unknown" should never be sent and is ignored if received. "whitelist" means that the user is entitled to access the product set. "includeAll" means that all products are accessible, including products that are approved, products with revoked approval, and products that have never been approved. "allApproved" means that the user is entitled to access all products that are approved for the enterprise. If the value is "allApproved" or "includeAll", the productId field is ignored. If no value is provided, it is interpreted as "whitelist" for backwards compatibility. #[serde(rename="productSetBehavior")] pub product_set_behavior: Option, } @@ -609,71 +575,31 @@ impl RequestValue for ProductSet {} impl ResponseResult for ProductSet {} -/// Information about the permissions required by a specific app and whether they have been accepted by the enterprise. +/// An event generated when a new device is ready to be managed. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [update permissions products](struct.ProductUpdatePermissionCall.html) (request|response) -/// * [get permissions products](struct.ProductGetPermissionCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ProductPermissions { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productPermissions". - pub kind: Option, - /// The permissions required by the app. - pub permission: Option>, - /// The ID of the app that the permissions relate to, e.g. "app:com.google.android.gm". - #[serde(rename="productId")] - pub product_id: Option, -} - -impl RequestValue for ProductPermissions {} -impl ResponseResult for ProductPermissions {} - - -/// A collection resource defines a named set of apps that is visible to a set of users in the Google Play Store app running on those users' managed devices. Those users can then install any of those apps if they wish (which will trigger creation of install and entitlement resources). A user cannot install an app on a managed device unless the app is listed in at least one collection that is visible to that user. -/// -/// Note that the API can be used to directly install an app regardless of whether it is in any collection - so an enterprise has a choice of either directly pushing apps to users, or allowing users to install apps if they want. Which is appropriate will depend on the enterprise's policies and the purpose of the apps concerned. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list collections](struct.CollectionListCall.html) (none) -/// * [patch collections](struct.CollectionPatchCall.html) (request|response) -/// * [insert collections](struct.CollectionInsertCall.html) (request|response) -/// * [get collections](struct.CollectionGetCall.html) (response) -/// * [delete collections](struct.CollectionDeleteCall.html) (none) -/// * [update collections](struct.CollectionUpdateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Collection { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collection". - pub kind: Option, - /// Arbitrary unique ID, allocated by the API on creation. - #[serde(rename="collectionId")] - pub collection_id: Option, - /// A user-friendly name for the collection (should be unique), e.g. "Accounting apps". - pub name: Option, - /// Whether this collection is visible to all users, or only to the users that have been granted access through the "Collectionviewers" API. With the launch of the "setAvailableProductSet" API, this property should always be set to "viewersOnly", as the "allUsers" option will bypass the "availableProductSet" for all users within a domain. +pub struct NewDeviceEvent { + /// The ID of the user. This field will always be present. + #[serde(rename="userId")] + pub user_id: Option, + /// The Android ID of the device. This field will always be present. + #[serde(rename="deviceId")] + pub device_id: Option, + /// Identifies the extent to which the device is controlled by an Android EMM in various deployment configurations. /// - /// The "allUsers" setting is deprecated, and will be removed. - pub visibility: Option, - /// The IDs of the products in the collection, in the order in which they should be displayed. - #[serde(rename="productId")] - pub product_id: Option>, + /// Possible values include: + /// - "managedDevice", a device where the DPC is set as device owner, + /// - "managedProfile", a device where the DPC is set as profile owner. + #[serde(rename="managementType")] + pub management_type: Option, } -impl RequestValue for Collection {} -impl Resource for Collection {} -impl ResponseResult for Collection {} +impl Part for NewDeviceEvent {} -/// Definition of a Google Play for Work store page, made of a localized name and links to other pages. A page also contains clusters defined as a subcollection. +/// 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 /// @@ -744,13 +670,13 @@ pub struct ProductPermission { impl Part for ProductPermission {} -/// This represents an enterprise administrator who can manage the enterprise in the Google Play for Work Store. +/// 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 administrator's email address. + /// The admin's email address. pub email: Option, } @@ -778,9 +704,9 @@ pub struct ManagedConfigurationsForDeviceListResponse { impl ResponseResult for ManagedConfigurationsForDeviceListResponse {} -/// A permission 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. +/// 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 EMM user interface when obtaining consent from the enterprise. +/// 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 /// @@ -794,7 +720,7 @@ pub struct Permission { /// An opaque string uniquely identifying the permission. #[serde(rename="permissionId")] pub permission_id: Option, - /// A longer description of the permissions giving more details of what it affects. + /// 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, @@ -861,6 +787,9 @@ pub struct Notification { /// Notifications about new app permissions. #[serde(rename="newPermissionsEvent")] pub new_permissions_event: Option, + /// Type of the notification. + #[serde(rename="notificationType")] + pub notification_type: Option, /// Notifications about product availability changes. #[serde(rename="productAvailabilityChangeEvent")] pub product_availability_change_event: Option, @@ -870,6 +799,9 @@ pub struct Notification { /// The ID of the enterprise for which the notification is sent. This will always be present. #[serde(rename="enterpriseId")] pub enterprise_id: Option, + /// Notifications about new devices. + #[serde(rename="newDeviceEvent")] + pub new_device_event: Option, /// Notifications about changes to a product's approval status. #[serde(rename="productApprovalEvent")] pub product_approval_event: Option, @@ -988,24 +920,40 @@ pub struct LocalizedText { impl Part for LocalizedText {} -/// An AuthenticationToken is used by the EMM's device policy client on a device to provision the given EMM-managed user on that device. +/// 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. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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) +/// * [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) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AuthenticationToken { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#authenticationToken". +pub struct Device { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#device". 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 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 ResponseResult for AuthenticationToken {} +impl Resource for Device {} +impl ResponseResult for Device {} /// There is no detailed description. @@ -1229,7 +1177,7 @@ impl Part for TokenPagination {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProductsListResponse { - /// Information about a product (e.g. an app) in the Google Play Store, for display to an enterprise admin. + /// Information about a product (e.g. an app) in the Google Play store, for display to an enterprise admin. pub product: Option>, /// Pagination information for token pagination. #[serde(rename="tokenPagination")] @@ -1253,7 +1201,7 @@ 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"). + /// 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, } @@ -1261,40 +1209,24 @@ pub struct AppVersion { impl Part for AppVersion {} -/// A device 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, e.g. "123456789abcdef0". - #[serde(rename="androidId")] - pub android_id: Option, - /// Identifies the extent to which the device is controlled by an Android for Work 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 work profile managed by the DPC (DPC is profile owner) in addition to a separate, personal profile that is unavailable to the DPC, - /// - "containerApp", a device running the Android for Work App. The Android for Work App is managed by the DPC, - /// - "unmanagedProfile", a device that has been allowed (by the domain's admin, using the Admin Console to enable the privilege) to use Android for Work apps or Google Apps for Work, 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 {} /// A resource returned by the GenerateSignupUrl API, which contains the Signup URL and Completion Token. @@ -1340,13 +1272,13 @@ pub struct DevicesListResponse { impl ResponseResult for DevicesListResponse {} -/// The existence of an install resource indicates that an app is installed on a particular device (or that an install is pending). +/// The existence of an Installs resource indicates that an app is installed on a particular device (or that an install is pending). /// -/// The API can be used to create an install resource using the update method. This triggers the actual install of the app on the device. If the user does not already have an entitlement for the app then an attempt is made to create one. If this fails (e.g. because the app is not free and there is no available license) then the creation of the install fails. +/// The API can be used to create an install resource using the update method. This triggers the actual install of the app on the device. If the user does not already have an entitlement for the app, then an attempt is made to create one. If this fails (for example, because the app is not free and there is no available license), then the creation of the install fails. /// -/// The API can also be used to update an installed app. If the update method is used on an existing install then the app will be updated to the latest available version. +/// The API can also be used to update an installed app. If the update method is used on an existing install, then the app will be updated to the latest available version. /// -/// Note that it is not possible to force the installation of a specific version of an app; the version code is read-only. +/// Note that it is not possible to force the installation of a specific version of an app: the version code is read-only. /// /// If a user installs an app themselves (as permitted by the enterprise), then again an install resource and possibly an entitlement resource are automatically created. /// @@ -1373,7 +1305,7 @@ pub struct Install { pub version_code: Option, /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#install". pub kind: Option, - /// The ID of the product that the install is for, e.g. "app:com.google.android.gm". + /// The ID of the product that the install is for. For example, "app:com.google.android.gm". #[serde(rename="productId")] pub product_id: Option, } @@ -1385,7 +1317,7 @@ impl ResponseResult for Install {} /// An Enterprises resource represents the binding between an EMM and a specific organization. That binding can be instantiated in one of two different ways using this API as follows: /// - For Google managed domain customers, the process involves using Enterprises.enroll and Enterprises.setAccount (in conjunction with artifacts obtained from the Admin console and the Google API Console) and submitted to the EMM through a more-or-less manual process. -/// - For Android for Work Accounts customers, the process involves using Enterprises.generateSignupUrl and Enterprises.completeSignup in conjunction with the Android for Work Sign-up UI (Google-provided mechanism) to create the binding without manual steps. As an EMM, you can support either or both approaches in your EMM console. See Create an Enterprise for details. +/// - For managed Google Play Accounts customers, the process involves using Enterprises.generateSignupUrl and Enterprises.completeSignup in conjunction with the managed Google Play sign-up UI (Google-provided mechanism) to create the binding without manual steps. As an EMM, you can support either or both approaches in your EMM console. See Create an Enterprise for details. /// /// # Activities /// @@ -1411,7 +1343,7 @@ impl ResponseResult for Install {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Enterprise { - /// Administrators of the enterprise. This is only supported for enterprises created via the EMM-initiated flow. + /// Admins of the enterprise. This is only supported for enterprises created via the EMM-initiated flow. pub administrator: Option>, /// The enterprise's primary domain, such as "example.com". #[serde(rename="primaryDomain")] @@ -1455,7 +1387,7 @@ pub struct InstallFailureEvent { impl Part for InstallFailureEvent {} -/// A UserToken is used by a user when setting up a managed device or profile with their work account on a device. When the user enters their email address and token (activation code) the appropriate EMM app can be automatically downloaded. +/// 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 /// @@ -1514,7 +1446,7 @@ pub struct AppUpdateEvent { impl Part for AppUpdateEvent {} -/// A token authorizing an administrator to access an iframe. +/// A token authorizing an admin to access an iframe. /// /// # Activities /// @@ -1534,27 +1466,28 @@ pub struct AdministratorWebToken { impl ResponseResult for AdministratorWebToken {} -/// The user resources for the collection. +/// The grouplicense resources for the enterprise. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list collectionviewers](struct.CollectionviewerListCall.html) (response) +/// * [list grouplicenses](struct.GrouplicenseListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CollectionViewersListResponse { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collectionViewersListResponse". +pub struct GroupLicensesListResponse { + /// A group license for a product approved for use in the enterprise. + #[serde(rename="groupLicense")] + pub group_license: Option>, + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicensesListResponse". pub kind: Option, - /// A user of an enterprise. - pub user: Option>, } -impl ResponseResult for CollectionViewersListResponse {} +impl ResponseResult for GroupLicensesListResponse {} -/// Definition of a Google Play for Work store cluster, a list of products displayed as part of a store page. +/// Definition of a managed Google Play store cluster, a list of products displayed as part of a store page. /// /// # Activities /// @@ -1608,7 +1541,7 @@ pub struct UsersListResponse { impl ResponseResult for UsersListResponse {} -/// General setting for the Google Play for Work store layout, currently only specifying the page to display the first time the store is opened. +/// General setting for the managed Google Play store layout, currently only specifying the page to display the first time the store is opened. /// /// # Activities /// @@ -1620,16 +1553,14 @@ impl ResponseResult for UsersListResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct StoreLayout { - /// The ID of the store page to be used as the homepage. The homepage will be used as the first page shown in the Google Play for Work store. + /// 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. /// - /// If a homepage has not been set, the Play store shown on devices will be empty. Not specifying a homepage on a store layout effectively empties the store. - /// - /// If there exists at least one page, this field must be set to the ID of a valid page. + /// 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 set to "custom", "homepageId" must be specified. If set to "basic", the layout will consist of all approved apps accessible by the user, split in pages of 100 each; in this case, "homepageId" must not be specified. The "basic" setting takes precedence over any existing collections setup for this enterprise (if any). Should the enterprise use collectionViewers for controlling access rights, these will still be respected. + /// 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, } @@ -1668,7 +1599,7 @@ 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.) +/// 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. /// @@ -1677,7 +1608,6 @@ impl ResponseResult for ServiceAccountKey {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [update permissions products](struct.ProductUpdatePermissionCall.html) (none) /// * [get permissions products](struct.ProductGetPermissionCall.html) (none) /// * [get products](struct.ProductGetCall.html) (response) /// * [approve products](struct.ProductApproveCall.html) (none) @@ -1693,12 +1623,12 @@ pub struct Product { pub small_icon_url: Option, /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#product". pub kind: Option, - /// How and to whom the package is made available. 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. + /// 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 Google Play for Work details page for the product, for use by an Enterprise administrator. + /// A link to the managed Google Play details page for the product, for use by an Enterprise admin. #[serde(rename="workDetailsUrl")] pub work_details_url: Option, /// App versions currently available for this product. The returned list contains only public versions. Alpha and beta versions are not included. @@ -1710,10 +1640,10 @@ pub struct Product { /// 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 (e.g. the app developer). + /// The name of the author of the product (for example, the app developer). #[serde(rename="authorName")] pub author_name: Option, - /// Whether this app can only be installed on devices using the Android for Work container app. + /// Deprecated. #[serde(rename="requiresContainerApp")] pub requires_container_app: Option, /// A link to the (consumer) Google Play details page for the product. @@ -1739,6 +1669,9 @@ impl ResponseResult for Product {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProductsApproveRequest { + /// Sets how new permission requests for the product are handled. "allPermissions" automatically approves all current and future permissions for the product. "currentPermissionsOnly" approves the current set of permissions for the product, but any future permissions added through updates will require manual reapproval. If not specified, only the current set of permissions will be approved. + #[serde(rename="approvedPermissions")] + pub approved_permissions: Option, /// The approval URL that was shown to the user. Only the permissions shown to the user with that URL will be accepted, which may not be the product's entire set of permissions. For example, the URL may only display new permissions from an update after the product was approved, or not include new permissions if the product was updated since the URL was generated. #[serde(rename="approvalUrlInfo")] pub approval_url_info: Option, @@ -1747,24 +1680,27 @@ pub struct ProductsApproveRequest { impl RequestValue for ProductsApproveRequest {} -/// The collection resources for the enterprise. +/// Information about the permissions required by a specific app and whether they have been accepted by the enterprise. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [list collections](struct.CollectionListCall.html) (response) +/// * [get permissions products](struct.ProductGetPermissionCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CollectionsListResponse { - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#collectionsListResponse". +pub struct ProductPermissions { + /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#productPermissions". pub kind: Option, - /// An ordered collection of products which can be made visible on the Google Play Store to a selected group of users. - pub collection: Option>, + /// The permissions required by the app. + pub permission: Option>, + /// The ID of the app that the permissions relate to, e.g. "app:com.google.android.gm". + #[serde(rename="productId")] + pub product_id: Option, } -impl ResponseResult for CollectionsListResponse {} +impl ResponseResult for ProductPermissions {} /// A managed property of a managed configuration. The property must match one of the properties in the app restrictions schema of the product. Exactly one of the value fields must be populated, and it must match the property's type in the app restrictions schema. @@ -1798,9 +1734,9 @@ pub struct ManagedProperty { impl Part for ManagedProperty {} -/// A Users resource represents an account associated with an enterprise. The account may be specific to a device or to an individual user (who can then use the account across multiple devices). The account may provide access to Google Play for Work only, or to other Google services, depending on the identity model: -/// - Google managed domain identity model requires synchronization to Google account sources (via primaryEmail). -/// - Android for Work Accounts identity model provides a dynamic means for enterprises to create user or device accounts as needed. These accounts provide access to Google Play for Work only. +/// A Users resource represents an account associated with an enterprise. The account may be specific to a device or to an individual user (who can then use the account across multiple devices). The account may provide access to managed Google Play only, or to other Google services, depending on the identity model: +/// - The Google managed domain identity model requires synchronization to Google account sources (via primaryEmail). +/// - The managed Google Play Accounts identity model provides a dynamic means for enterprises to create user or device accounts as needed. These accounts provide access to managed Google Play. /// /// # Activities /// @@ -1809,12 +1745,9 @@ impl Part for ManagedProperty {} /// /// * [revoke token users](struct.UserRevokeTokenCall.html) (none) /// * [delete users](struct.UserDeleteCall.html) (none) -/// * [update collectionviewers](struct.CollectionviewerUpdateCall.html) (request|response) -/// * [patch collectionviewers](struct.CollectionviewerPatchCall.html) (request|response) /// * [generate authentication token users](struct.UserGenerateAuthenticationTokenCall.html) (none) /// * [list users](struct.UserListCall.html) (none) /// * [update users](struct.UserUpdateCall.html) (request|response) -/// * [get collectionviewers](struct.CollectionviewerGetCall.html) (response) /// * [patch users](struct.UserPatchCall.html) (request|response) /// * [set available product set users](struct.UserSetAvailableProductSetCall.html) (none) /// * [insert users](struct.UserInsertCall.html) (request|response) @@ -1897,18 +1830,23 @@ impl Part for ManagedPropertyBundle {} pub struct GroupLicense { /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicense". pub kind: Option, - /// The number of purchased licenses (possibly in multiple purchases). If this field is omitted then there is no limit on the number of licenses that can be provisioned (e.g. if the acquisition kind is "free"). + /// The number of purchased licenses (possibly in multiple purchases). If this field is omitted, then there is no limit on the number of licenses that can be provisioned (for example, if the acquisition kind is "free"). #[serde(rename="numPurchased")] pub num_purchased: Option, /// The total number of provisioned licenses for this product. Returned by read operations, but ignored in write operations. #[serde(rename="numProvisioned")] pub num_provisioned: Option, - /// How this group license was acquired. "bulkPurchase" means that this group license object was created because the enterprise purchased licenses for this product; this is "free" otherwise (for free products). + /// How this group license was acquired. "bulkPurchase" means that this Grouplicenses resource was created because the enterprise purchased licenses for this product; otherwise, the value is "free" (for free products). #[serde(rename="acquisitionKind")] pub acquisition_kind: Option, - /// Whether the product to which this group license relates is currently approved by the enterprise, as either "approved" or "unapproved". Products are approved when a group license is first created, but this approval may be revoked by an enterprise admin via Google Play. Unapproved products will not be visible to end users in collections and new entitlements to them should not normally be created. + /// Whether the product to which this group license relates is currently approved by the enterprise. Products are approved when a group license is first created, but this approval may be revoked by an enterprise admin via Google Play. Unapproved products will not be visible to end users in collections, and new entitlements to them should not normally be created. pub approval: Option, - /// The ID of the product that the license is for, e.g. "app:com.google.android.gm". + /// The permission approval status of the product. This field is only set if the product is approved. Possible states are: + /// - "currentApproved", the current set of permissions is approved, but additional permissions will require the administrator to reapprove the product (If the product was approved without specifying the approved permissions setting, then this is the default behavior.), + /// - "needsReapproval", the product has unapproved permissions. No additional product licenses can be assigned until the product is reapproved, + /// - "allCurrentAndFutureApproved", the current permissions are approved and any future permission updates will be automatically approved without administrator review. + pub permissions: Option, + /// The ID of the product that the license is for. For example, "app:com.google.android.gm". #[serde(rename="productId")] pub product_id: Option, } @@ -1952,27 +1890,6 @@ pub struct ApprovalUrlInfo { impl Part for ApprovalUrlInfo {} -/// The grouplicense resources for the enterprise. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list grouplicenses](struct.GrouplicenseListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GroupLicensesListResponse { - /// A group license for a product approved for use in the enterprise. - #[serde(rename="groupLicense")] - pub group_license: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "androidenterprise#groupLicensesListResponse". - pub kind: Option, -} - -impl ResponseResult for GroupLicensesListResponse {} - - // ################### // MethodBuilders ### @@ -2018,14 +1935,31 @@ impl<'a, C, A> StorelayoutpageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a store page. + /// Retrieves the details of all pages in the store. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn list(&self, enterprise_id: &str) -> StorelayoutpageListCall<'a, C, A> { + StorelayoutpageListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves details of a store page. /// /// # Arguments /// /// * `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 get(&self, enterprise_id: &str, page_id: &str) -> StorelayoutpageGetCall<'a, C, A> { + StorelayoutpageGetCall { hub: self.hub, _enterprise_id: enterprise_id.to_string(), _page_id: page_id.to_string(), @@ -2037,15 +1971,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. This method supports patch semantics. + /// 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 patch(&self, request: StorePage, enterprise_id: &str, page_id: &str) -> StorelayoutpagePatchCall<'a, C, A> { - StorelayoutpagePatchCall { + 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(), @@ -2077,15 +2011,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. + /// Updates the content of a store page. This method supports patch semantics. /// /// # 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 patch(&self, request: StorePage, enterprise_id: &str, page_id: &str) -> StorelayoutpagePatchCall<'a, C, A> { + StorelayoutpagePatchCall { hub: self.hub, _request: request, _enterprise_id: enterprise_id.to_string(), @@ -2098,14 +2032,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(), @@ -2114,171 +2048,6 @@ impl<'a, C, A> StorelayoutpageMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the details of all pages in the store. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - pub fn list(&self, enterprise_id: &str) -> StorelayoutpageListCall<'a, C, A> { - StorelayoutpageListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *collectionviewer* 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 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::new(), -/// ::default(), None); -/// let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `list(...)`, `patch(...)` and `update(...)` -/// // to build up your call. -/// let rb = hub.collectionviewers(); -/// # } -/// ``` -pub struct CollectionviewerMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, -} - -impl<'a, C, A> MethodsBuilder for CollectionviewerMethods<'a, C, A> {} - -impl<'a, C, A> CollectionviewerMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the ID of the user if they have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `collectionId` - The ID of the collection. - /// * `userId` - The ID of the user. - pub fn get(&self, enterprise_id: &str, collection_id: &str, user_id: &str) -> CollectionviewerGetCall<'a, C, A> { - CollectionviewerGetCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _collection_id: collection_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `collectionId` - The ID of the collection. - /// * `userId` - The ID of the user. - pub fn patch(&self, request: User, enterprise_id: &str, collection_id: &str, user_id: &str) -> CollectionviewerPatchCall<'a, C, A> { - CollectionviewerPatchCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _collection_id: collection_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: - /// - /// Retrieves the IDs of the users who have been specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only these users will see the collection. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `collectionId` - The ID of the collection. - pub fn list(&self, enterprise_id: &str, collection_id: &str) -> CollectionviewerListCall<'a, C, A> { - CollectionviewerListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _collection_id: collection_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Removes the user from the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `collectionId` - The ID of the collection. - /// * `userId` - The ID of the user. - pub fn delete(&self, enterprise_id: &str, collection_id: &str, user_id: &str) -> CollectionviewerDeleteCall<'a, C, A> { - CollectionviewerDeleteCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _collection_id: collection_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `collectionId` - The ID of the collection. - /// * `userId` - The ID of the user. - pub fn update(&self, request: User, enterprise_id: &str, collection_id: &str, user_id: &str) -> CollectionviewerUpdateCall<'a, C, A> { - CollectionviewerUpdateCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _collection_id: collection_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -2363,6 +2132,84 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Retrieves a user's details. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn get(&self, enterprise_id: &str, user_id: &str) -> UserGetCall<'a, C, A> { + UserGetCall { + 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. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn delete(&self, enterprise_id: &str, user_id: &str) -> UserDeleteCall<'a, C, A> { + UserDeleteCall { + 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: + /// + /// Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. + /// + /// This call only works with EMM-managed accounts. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn generate_authentication_token(&self, enterprise_id: &str, user_id: &str) -> UserGenerateAuthenticationTokenCall<'a, C, A> { + UserGenerateAuthenticationTokenCall { + 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: + /// + /// Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `email` - The exact primary email address of the user to look up. + pub fn list(&self, enterprise_id: &str, email: &str) -> UserListCall<'a, C, A> { + UserListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _email: email.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates the details of an EMM-managed user. @@ -2386,65 +2233,6 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Modifies the set of products a user is entitled to access. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn set_available_product_set(&self, request: ProductSet, enterprise_id: &str, user_id: &str) -> UserSetAvailableProductSetCall<'a, C, A> { - UserSetAvailableProductSetCall { - hub: self.hub, - _request: request, - _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: - /// - /// Retrieves the set of products a user is entitled to access. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn get_available_product_set(&self, enterprise_id: &str, user_id: &str) -> UserGetAvailableProductSetCall<'a, C, A> { - UserGetAvailableProductSetCall { - 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: - /// - /// Retrieves a user's details. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn get(&self, enterprise_id: &str, user_id: &str) -> UserGetCall<'a, C, A> { - UserGetCall { - 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: /// /// Creates a new EMM-managed user. @@ -2469,7 +2257,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token. + /// Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token. /// /// This call only works with Google managed accounts. /// @@ -2490,15 +2278,17 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deleted an EMM-managed user. + /// Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that were previously approved (products with revoked approval) can be whitelisted. /// /// # Arguments /// + /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. /// * `userId` - The ID of the user. - pub fn delete(&self, enterprise_id: &str, user_id: &str) -> UserDeleteCall<'a, C, A> { - UserDeleteCall { + pub fn set_available_product_set(&self, request: ProductSet, enterprise_id: &str, user_id: &str) -> UserSetAvailableProductSetCall<'a, C, A> { + UserSetAvailableProductSetCall { hub: self.hub, + _request: request, _enterprise_id: enterprise_id.to_string(), _user_id: user_id.to_string(), _delegate: Default::default(), @@ -2509,35 +2299,14 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `email` - The exact primary email address of the user to look up. - pub fn list(&self, enterprise_id: &str, email: &str) -> UserListCall<'a, C, A> { - UserListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _email: email.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. - /// - /// This call only works with EMM-managed accounts. + /// Retrieves the set of products a user is entitled to access. /// /// # Arguments /// /// * `enterpriseId` - The ID of the enterprise. /// * `userId` - The ID of the user. - pub fn generate_authentication_token(&self, enterprise_id: &str, user_id: &str) -> UserGenerateAuthenticationTokenCall<'a, C, A> { - UserGenerateAuthenticationTokenCall { + pub fn get_available_product_set(&self, enterprise_id: &str, user_id: &str) -> UserGetAvailableProductSetCall<'a, C, A> { + UserGetAvailableProductSetCall { hub: self.hub, _enterprise_id: enterprise_id.to_string(), _user_id: user_id.to_string(), @@ -2590,7 +2359,7 @@ impl<'a, C, A> InstallMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary. This method supports patch semantics. + /// Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. This method supports patch semantics. /// /// # Arguments /// @@ -2613,29 +2382,6 @@ impl<'a, C, A> InstallMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - /// * `deviceId` - The Android ID of the device. - /// * `installId` - The ID of the product represented by the install, e.g. "app:com.google.android.gm". - pub fn delete(&self, enterprise_id: &str, user_id: &str, device_id: &str, install_id: &str) -> InstallDeleteCall<'a, C, A> { - InstallDeleteCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _device_id: device_id.to_string(), - _install_id: install_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves details of an installation of an app on a device. @@ -2682,7 +2428,30 @@ impl<'a, C, A> InstallMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary. + /// Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + /// * `deviceId` - The Android ID of the device. + /// * `installId` - The ID of the product represented by the install, e.g. "app:com.google.android.gm". + pub fn delete(&self, enterprise_id: &str, user_id: &str, device_id: &str, install_id: &str) -> InstallDeleteCall<'a, C, A> { + InstallDeleteCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _device_id: device_id.to_string(), + _install_id: install_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. /// /// # Arguments /// @@ -2825,44 +2594,17 @@ impl<'a, C, A> ManagedconfigurationsfordeviceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Adds or updates a per-device managed configuration for an app for the specified device. + /// Removes a per-device managed configuration for an app for the specified device. /// /// # Arguments /// - /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. /// * `userId` - The ID of the user. /// * `deviceId` - The Android ID of the device. /// * `managedConfigurationForDeviceId` - The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - pub fn update(&self, request: ManagedConfiguration, enterprise_id: &str, user_id: &str, device_id: &str, managed_configuration_for_device_id: &str) -> ManagedconfigurationsfordeviceUpdateCall<'a, C, A> { - ManagedconfigurationsfordeviceUpdateCall { + pub fn delete(&self, enterprise_id: &str, user_id: &str, device_id: &str, managed_configuration_for_device_id: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { + ManagedconfigurationsfordeviceDeleteCall { hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _device_id: device_id.to_string(), - _managed_configuration_for_device_id: managed_configuration_for_device_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - /// * `deviceId` - The Android ID of the device. - /// * `managedConfigurationForDeviceId` - The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - pub fn patch(&self, request: ManagedConfiguration, enterprise_id: &str, user_id: &str, device_id: &str, managed_configuration_for_device_id: &str) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> { - ManagedconfigurationsfordevicePatchCall { - hub: self.hub, - _request: request, _enterprise_id: enterprise_id.to_string(), _user_id: user_id.to_string(), _device_id: device_id.to_string(), @@ -2896,17 +2638,19 @@ impl<'a, C, A> ManagedconfigurationsfordeviceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Removes a per-device managed configuration for an app for the specified device. + /// Adds or updates a per-device managed configuration for an app for the specified device. /// /// # Arguments /// + /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. /// * `userId` - The ID of the user. /// * `deviceId` - The Android ID of the device. /// * `managedConfigurationForDeviceId` - The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - pub fn delete(&self, enterprise_id: &str, user_id: &str, device_id: &str, managed_configuration_for_device_id: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - ManagedconfigurationsfordeviceDeleteCall { + pub fn update(&self, request: ManagedConfiguration, enterprise_id: &str, user_id: &str, device_id: &str, managed_configuration_for_device_id: &str) -> ManagedconfigurationsfordeviceUpdateCall<'a, C, A> { + ManagedconfigurationsfordeviceUpdateCall { hub: self.hub, + _request: request, _enterprise_id: enterprise_id.to_string(), _user_id: user_id.to_string(), _device_id: device_id.to_string(), @@ -2939,6 +2683,31 @@ impl<'a, C, A> ManagedconfigurationsfordeviceMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + /// * `deviceId` - The Android ID of the device. + /// * `managedConfigurationForDeviceId` - The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + pub fn patch(&self, request: ManagedConfiguration, enterprise_id: &str, user_id: &str, device_id: &str, managed_configuration_for_device_id: &str) -> ManagedconfigurationsfordevicePatchCall<'a, C, A> { + ManagedconfigurationsfordevicePatchCall { + hub: self.hub, + _request: request, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _device_id: device_id.to_string(), + _managed_configuration_for_device_id: managed_configuration_for_device_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -3004,27 +2773,6 @@ impl<'a, C, A> DeviceMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Retrieves the details of a device. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - /// * `deviceId` - The ID of the device. - pub fn get(&self, enterprise_id: &str, user_id: &str, device_id: &str) -> DeviceGetCall<'a, C, A> { - DeviceGetCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _user_id: user_id.to_string(), - _device_id: device_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. @@ -3064,6 +2812,27 @@ impl<'a, C, A> DeviceMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves the details of a device. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + /// * `deviceId` - The ID of the device. + pub fn get(&self, enterprise_id: &str, user_id: &str, device_id: &str) -> DeviceGetCall<'a, C, A> { + DeviceGetCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _device_id: device_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -3106,6 +2875,36 @@ impl<'a, C, A> MethodsBuilder for EnterpriseMethods<'a, C, A> {} impl<'a, C, A> EnterpriseMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. + pub fn acknowledge_notification_set(&self) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { + EnterpriseAcknowledgeNotificationSetCall { + hub: self.hub, + _notification_set_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Unenrolls an enterprise from the calling EMM. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn unenroll(&self, enterprise_id: &str) -> EnterpriseUnenrollCall<'a, C, A> { + EnterpriseUnenrollCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead. @@ -3127,7 +2926,58 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the administrator, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom"), the basic store layout is disabled. + /// Sends a test push notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn send_test_push_notification(&self, enterprise_id: &str) -> EnterpriseSendTestPushNotificationCall<'a, C, A> { + EnterpriseSendTestPushNotificationCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call. + /// + /// # Arguments + /// + /// * `domain` - The exact primary domain name of the enterprise to look up. + pub fn list(&self, domain: &str) -> EnterpriseListCall<'a, C, A> { + EnterpriseListCall { + hub: self.hub, + _domain: domain.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn get_store_layout(&self, enterprise_id: &str) -> EnterpriseGetStoreLayoutCall<'a, C, A> { + EnterpriseGetStoreLayoutCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled. /// /// # Arguments /// @@ -3144,10 +2994,24 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token. + pub fn complete_signup(&self) -> EnterpriseCompleteSignupCall<'a, C, A> { + EnterpriseCompleteSignupCall { + hub: self.hub, + _enterprise_token: Default::default(), + _completion_token: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. - /// A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises​.AcknowledgeNotificationSet, unless the notification set is empty. + /// A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty. /// Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. /// Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending. /// If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available. @@ -3182,68 +3046,13 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Set the account that will be used to authenticate to the API as the enterprise. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - pub fn set_account(&self, request: EnterpriseAccount, enterprise_id: &str) -> EnterpriseSetAccountCall<'a, C, A> { - EnterpriseSetAccountCall { - 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: - /// - /// Returns a unique token to access an embeddable UI. To generate a web UI, pass the generated token into the Play for Work 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: - /// - /// Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call. - /// - /// # Arguments - /// - /// * `domain` - The exact primary domain name of the enterprise to look up. - pub fn list(&self, domain: &str) -> EnterpriseListCall<'a, C, A> { - EnterpriseListCall { - hub: self.hub, - _domain: domain.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the store layout for the enterprise. If the store layout has not been set, or if the store layout has no homepageId set, returns a NOT_FOUND error. + /// Retrieves the name and domain of an enterprise. /// /// # Arguments /// /// * `enterpriseId` - The ID of the enterprise. - pub fn get_store_layout(&self, enterprise_id: &str) -> EnterpriseGetStoreLayoutCall<'a, C, A> { - EnterpriseGetStoreLayoutCall { + pub fn get(&self, enterprise_id: &str) -> EnterpriseGetCall<'a, C, A> { + EnterpriseGetCall { hub: self.hub, _enterprise_id: enterprise_id.to_string(), _delegate: Default::default(), @@ -3252,20 +3061,6 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token. - pub fn complete_signup(&self) -> EnterpriseCompleteSignupCall<'a, C, A> { - EnterpriseCompleteSignupCall { - hub: self.hub, - _enterprise_token: Default::default(), - _completion_token: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. @@ -3292,27 +3087,16 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Acknowledges notifications that were received from Enterprises.PullNotificationSet to prevent subsequent calls from returning the same notifications. - pub fn acknowledge_notification_set(&self) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { - EnterpriseAcknowledgeNotificationSetCall { - hub: self.hub, - _notification_set_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Unenrolls an enterprise from the calling EMM. + /// Sets the account that will be used to authenticate to the API as the enterprise. /// /// # Arguments /// + /// * `request` - No description provided. /// * `enterpriseId` - The ID of the enterprise. - pub fn unenroll(&self, enterprise_id: &str) -> EnterpriseUnenrollCall<'a, C, A> { - EnterpriseUnenrollCall { + pub fn set_account(&self, request: EnterpriseAccount, enterprise_id: &str) -> EnterpriseSetAccountCall<'a, C, A> { + EnterpriseSetAccountCall { hub: self.hub, + _request: request, _enterprise_id: enterprise_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -3322,41 +3106,7 @@ impl<'a, C, A> EnterpriseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sends a test push notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - pub fn send_test_push_notification(&self, enterprise_id: &str) -> EnterpriseSendTestPushNotificationCall<'a, C, A> { - EnterpriseSendTestPushNotificationCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the name and domain of an enterprise. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - pub fn get(&self, enterprise_id: &str) -> EnterpriseGetCall<'a, C, A> { - EnterpriseGetCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Deletes the binding between the EMM and enterprise. This is now deprecated; use this to unenroll customers that were previously enrolled with the 'insert' call, then enroll them again with the 'enroll' call. + /// Deletes the binding between the EMM and enterprise. This is now deprecated. Use this method only to unenroll customers that were previously enrolled with the insert call, then enroll them again with the enroll call. /// /// # Arguments /// @@ -3383,6 +3133,25 @@ 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(), + } + } } @@ -3425,25 +3194,6 @@ impl<'a, C, A> MethodsBuilder for StorelayoutclusterMethods<'a, C, A> {} impl<'a, C, A> StorelayoutclusterMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Retrieves the details of all clusters on the specified page. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `pageId` - The ID of the page. - pub fn list(&self, enterprise_id: &str, page_id: &str) -> StorelayoutclusterListCall<'a, C, A> { - StorelayoutclusterListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _page_id: page_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 cluster. This method supports patch semantics. @@ -3467,6 +3217,67 @@ impl<'a, C, A> StorelayoutclusterMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes a cluster. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `pageId` - The ID of the page. + /// * `clusterId` - The ID of the cluster. + pub fn delete(&self, enterprise_id: &str, page_id: &str, cluster_id: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { + StorelayoutclusterDeleteCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _page_id: page_id.to_string(), + _cluster_id: cluster_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Inserts a new cluster in a page. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `enterpriseId` - The ID of the enterprise. + /// * `pageId` - The ID of the page. + pub fn insert(&self, request: StoreCluster, enterprise_id: &str, page_id: &str) -> StorelayoutclusterInsertCall<'a, C, A> { + StorelayoutclusterInsertCall { + hub: self.hub, + _request: request, + _enterprise_id: enterprise_id.to_string(), + _page_id: page_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 details of all clusters on the specified page. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `pageId` - The ID of the page. + pub fn list(&self, enterprise_id: &str, page_id: &str) -> StorelayoutclusterListCall<'a, C, A> { + StorelayoutclusterListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _page_id: page_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 cluster. @@ -3510,48 +3321,6 @@ impl<'a, C, A> StorelayoutclusterMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Inserts a new cluster in a page. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `pageId` - The ID of the page. - pub fn insert(&self, request: StoreCluster, enterprise_id: &str, page_id: &str) -> StorelayoutclusterInsertCall<'a, C, A> { - StorelayoutclusterInsertCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _page_id: page_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 cluster. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `pageId` - The ID of the page. - /// * `clusterId` - The ID of the cluster. - pub fn delete(&self, enterprise_id: &str, page_id: &str, cluster_id: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { - StorelayoutclusterDeleteCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _page_id: page_id.to_string(), - _cluster_id: cluster_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -3579,7 +3348,7 @@ impl<'a, C, A> StorelayoutclusterMethods<'a, C, A> { /// ::default(), None); /// let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `approve(...)`, `generate_approval_url(...)`, `get(...)`, `get_app_restrictions_schema(...)`, `get_permissions(...)`, `list(...)`, `unapprove(...)` and `update_permissions(...)` +/// // like `approve(...)`, `generate_approval_url(...)`, `get(...)`, `get_app_restrictions_schema(...)`, `get_permissions(...)`, `list(...)` and `unapprove(...)` /// // to build up your call. /// let rb = hub.products(); /// # } @@ -3632,11 +3401,53 @@ impl<'a, C, A> ProductMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. + /// + /// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `productId` - The ID of the product. + pub fn generate_approval_url(&self, enterprise_id: &str, product_id: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + ProductGenerateApprovalUrlCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _product_id: product_id.to_string(), + _language_code: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves details of a product for display to an enterprise admin. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `productId` - The ID of the product, e.g. "app:com.google.android.gm". + pub fn get(&self, enterprise_id: &str, product_id: &str) -> ProductGetCall<'a, C, A> { + ProductGetCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _product_id: product_id.to_string(), + _language: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000. /// - /// To learn how to use Google Play for Work to design and create a store layout to display approved products to your users, see Store Layout Design. + /// To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. /// /// # Arguments /// @@ -3657,30 +3468,7 @@ impl<'a, C, A> ProductMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// This method has been deprecated. To programmatically approve applications, you must use the iframe mechanism via the generateApprovalUrl and approve methods of the Products resource. For more information, see the Play EMM API usage requirements. - /// - /// The updatePermissions method (deprecated) updates the set of Android app permissions for this app that have been accepted by the enterprise. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `productId` - The ID of the product. - pub fn update_permissions(&self, request: ProductPermissions, enterprise_id: &str, product_id: &str) -> ProductUpdatePermissionCall<'a, C, A> { - ProductUpdatePermissionCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _product_id: product_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an administrator to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play. + /// Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play. /// /// # Arguments /// @@ -3719,48 +3507,6 @@ impl<'a, C, A> ProductMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves details of a product for display to an enterprise admin. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `productId` - The ID of the product, e.g. "app:com.google.android.gm". - pub fn get(&self, enterprise_id: &str, product_id: &str) -> ProductGetCall<'a, C, A> { - ProductGetCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _product_id: product_id.to_string(), - _language: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. - /// - /// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `productId` - The ID of the product. - pub fn generate_approval_url(&self, enterprise_id: &str, product_id: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { - ProductGenerateApprovalUrlCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _product_id: product_id.to_string(), - _language_code: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -3826,25 +3572,6 @@ impl<'a, C, A> ManagedconfigurationsforuserMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Lists all the per-user managed configurations for the specified user. Only the ID is set. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `userId` - The ID of the user. - pub fn list(&self, enterprise_id: &str, user_id: &str) -> ManagedconfigurationsforuserListCall<'a, C, A> { - ManagedconfigurationsforuserListCall { - 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: /// /// Removes a per-user managed configuration for an app for the specified user. @@ -3866,6 +3593,25 @@ impl<'a, C, A> ManagedconfigurationsforuserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists all the per-user managed configurations for the specified user. Only the ID is set. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + /// * `userId` - The ID of the user. + pub fn list(&self, enterprise_id: &str, user_id: &str) -> ManagedconfigurationsforuserListCall<'a, C, A> { + ManagedconfigurationsforuserListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _user_id: user_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Adds or updates a per-user managed configuration for an app for the specified user. @@ -4013,17 +3759,19 @@ impl<'a, C, A> EntitlementMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List of all entitlements for the specified user. Only the ID is set. + /// Removes an entitlement to an app for a user. /// /// # Arguments /// /// * `enterpriseId` - The ID of the enterprise. /// * `userId` - The ID of the user. - pub fn list(&self, enterprise_id: &str, user_id: &str) -> EntitlementListCall<'a, C, A> { - EntitlementListCall { + /// * `entitlementId` - The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". + pub fn delete(&self, enterprise_id: &str, user_id: &str, entitlement_id: &str) -> EntitlementDeleteCall<'a, C, A> { + EntitlementDeleteCall { hub: self.hub, _enterprise_id: enterprise_id.to_string(), _user_id: user_id.to_string(), + _entitlement_id: entitlement_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4077,19 +3825,17 @@ impl<'a, C, A> EntitlementMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Removes an entitlement to an app for a user and uninstalls it. + /// Lists all entitlements for the specified user. Only the ID is set. /// /// # Arguments /// /// * `enterpriseId` - The ID of the enterprise. /// * `userId` - The ID of the user. - /// * `entitlementId` - The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". - pub fn delete(&self, enterprise_id: &str, user_id: &str, entitlement_id: &str) -> EntitlementDeleteCall<'a, C, A> { - EntitlementDeleteCall { + pub fn list(&self, enterprise_id: &str, user_id: &str) -> EntitlementListCall<'a, C, A> { + EntitlementListCall { hub: self.hub, _enterprise_id: enterprise_id.to_string(), _user_id: user_id.to_string(), - _entitlement_id: entitlement_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4123,163 +3869,6 @@ impl<'a, C, A> EntitlementMethods<'a, C, A> { -/// A builder providing access to all methods supported on *collection* 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 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::new(), -/// ::default(), None); -/// let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` -/// // to build up your call. -/// let rb = hub.collections(); -/// # } -/// ``` -pub struct CollectionMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, -} - -impl<'a, C, A> MethodsBuilder for CollectionMethods<'a, C, A> {} - -impl<'a, C, A> CollectionMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Updates a collection. This method supports patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `collectionId` - The ID of the collection. - pub fn patch(&self, request: Collection, enterprise_id: &str, collection_id: &str) -> CollectionPatchCall<'a, C, A> { - CollectionPatchCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _collection_id: collection_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 IDs of all the collections for an enterprise. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - pub fn list(&self, enterprise_id: &str) -> CollectionListCall<'a, C, A> { - CollectionListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the details of a collection. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `collectionId` - The ID of the collection. - pub fn get(&self, enterprise_id: &str, collection_id: &str) -> CollectionGetCall<'a, C, A> { - CollectionGetCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _collection_id: collection_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 collection. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - /// * `collectionId` - The ID of the collection. - pub fn delete(&self, enterprise_id: &str, collection_id: &str) -> CollectionDeleteCall<'a, C, A> { - CollectionDeleteCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _collection_id: collection_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new collection. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - pub fn insert(&self, request: Collection, enterprise_id: &str) -> CollectionInsertCall<'a, C, A> { - CollectionInsertCall { - 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: - /// - /// Updates a collection. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `enterpriseId` - The ID of the enterprise. - /// * `collectionId` - The ID of the collection. - pub fn update(&self, request: Collection, enterprise_id: &str, collection_id: &str) -> CollectionUpdateCall<'a, C, A> { - CollectionUpdateCall { - hub: self.hub, - _request: request, - _enterprise_id: enterprise_id.to_string(), - _collection_id: collection_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - /// A builder providing access to all methods supported on *serviceaccountkey* resources. /// It is not used directly, but through the `AndroidEnterprise` hub. /// @@ -4318,23 +3907,6 @@ impl<'a, C, A> MethodsBuilder for ServiceaccountkeyMethods<'a, C, A> {} impl<'a, C, A> ServiceaccountkeyMethods<'a, C, A> { - /// Create a builder to help you perform the following task: - /// - /// Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. - /// - /// # Arguments - /// - /// * `enterpriseId` - The ID of the enterprise. - pub fn list(&self, enterprise_id: &str) -> ServiceaccountkeyListCall<'a, C, A> { - ServiceaccountkeyListCall { - hub: self.hub, - _enterprise_id: enterprise_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. @@ -4356,6 +3928,23 @@ impl<'a, C, A> ServiceaccountkeyMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. + /// + /// # Arguments + /// + /// * `enterpriseId` - The ID of the enterprise. + pub fn list(&self, enterprise_id: &str) -> ServiceaccountkeyListCall<'a, C, A> { + ServiceaccountkeyListCall { + hub: self.hub, + _enterprise_id: enterprise_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. @@ -4443,9 +4032,9 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { // CallBuilders ### // ################# -/// Deletes a store page. +/// Retrieves the details of all pages in the store. /// -/// A builder for the *delete* method supported by a *storelayoutpage* resource. +/// A builder for the *list* method supported by a *storelayoutpage* resource. /// It is not used directly, but through a `StorelayoutpageMethods` instance. /// /// # Example @@ -4469,28 +4058,27 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.storelayoutpages().delete("enterpriseId", "pageId") +/// let result = hub.storelayoutpages().list("enterpriseId") /// .doit(); /// # } /// ``` -pub struct StorelayoutpageDeleteCall<'a, C, A> +pub struct StorelayoutpageListCall<'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> CallBuilder for StorelayoutpageListCall<'a, C, A> {} -impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> StorelayoutpageListCall<'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, StoreLayoutPagesListResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -4498,12 +4086,11 @@ 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 }); + dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.list", + http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("pageId", self._page_id.to_string())); - for &field in ["enterpriseId", "pageId"].iter() { + for &field in ["alt", "enterpriseId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4513,13 +4100,14 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -4530,8 +4118,8 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["pageId", "enterpriseId"].iter() { + 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); } @@ -4564,7 +4152,7 @@ impl<'a, C, A> 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) @@ -4613,27 +4211,17 @@ impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut StorelayoutpageDeleteCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutpageListCall<'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> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> StorelayoutpageListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4654,7 +4242,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) -> StorelayoutpageListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4671,7 +4259,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) -> StorelayoutpageListCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -4679,9 +4267,9 @@ 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::default(), None); /// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = 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().patch(req, "enterpriseId", "pageId") +/// let result = hub.storelayoutpages().get("enterpriseId", "pageId") /// .doit(); /// # } /// ``` -pub struct StorelayoutpagePatchCall<'a, C, A> +pub struct StorelayoutpageGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, - _request: StorePage, _enterprise_id: String, _page_id: String, _delegate: Option<&'a mut Delegate>, @@ -4727,9 +4308,9 @@ pub struct StorelayoutpagePatchCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for StorelayoutpagePatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for StorelayoutpageGetCall<'a, C, A> {} -impl<'a, C, A> StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> StorelayoutpageGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -4741,9 +4322,9 @@ impl<'a, C, A> StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.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: "androidenterprise.storelayoutpages.get", + 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(("pageId", self._page_id.to_string())); for &field in ["alt", "enterpriseId", "pageId"].iter() { @@ -4758,7 +4339,7 @@ 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 StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut StorelayoutpagePatchCall<'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) -> StorelayoutpagePatchCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutpageGetCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } @@ -4901,7 +4458,7 @@ impl<'a, C, A> StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut StorelayoutpagePatchCall<'a, C, A> { + pub fn page_id(mut self, new_value: &str) -> StorelayoutpageGetCall<'a, C, A> { self._page_id = new_value.to_string(); self } @@ -4911,7 +4468,7 @@ impl<'a, C, A> StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut StorelayoutpagePatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> StorelayoutpageGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4932,7 +4489,7 @@ impl<'a, C, A> StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> StorelayoutpagePatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> StorelayoutpageGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4949,273 +4506,7 @@ impl<'a, C, A> StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> StorelayoutpagePatchCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Inserts a new store page. -/// -/// A builder for the *insert* method supported by a *storelayoutpage* resource. -/// It is not used directly, but through a `StorelayoutpageMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::StorePage; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = 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().insert(req, "enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct StorelayoutpageInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: StorePage, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for StorelayoutpageInsertCall<'a, C, A> {} - -impl<'a, C, A> StorelayoutpageInsertCall<'a, C, 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.insert", - 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}/storeLayout/pages"; - 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: StorePage) -> StorelayoutpageInsertCall<'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) -> StorelayoutpageInsertCall<'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) -> StorelayoutpageInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> StorelayoutpageInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> StorelayoutpageInsertCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> StorelayoutpageGetCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -5302,7 +4593,7 @@ impl<'a, C, A> StorelayoutpageUpdateCall<'a, C, A> where C: BorrowMut StorelayoutpageUpdateCall<'a, C, A> where C: BorrowMut StorelayoutpageUpdateCall<'a, C, A> where C: BorrowMut StorelayoutpageUpdateCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = 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().get("enterpriseId", "pageId") +/// let result = hub.storelayoutpages().insert(req, "enterpriseId") /// .doit(); /// # } /// ``` -pub struct StorelayoutpageGetCall<'a, C, A> +pub struct StorelayoutpageInsertCall<'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 StorelayoutpageGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for StorelayoutpageInsertCall<'a, C, A> {} -impl<'a, C, A> StorelayoutpageGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> StorelayoutpageInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -5556,256 +4853,10 @@ impl<'a, C, A> StorelayoutpageGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.get", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.insert", + http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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) -> StorelayoutpageGetCall<'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) -> StorelayoutpageGetCall<'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) -> StorelayoutpageGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> StorelayoutpageGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> StorelayoutpageGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves the details of all pages in the store. -/// -/// A builder for the *list* method supported by a *storelayoutpage* resource. -/// It is not used directly, but through a `StorelayoutpageMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling 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().list("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct StorelayoutpageListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for StorelayoutpageListCall<'a, C, A> {} - -impl<'a, C, A> StorelayoutpageListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StoreLayoutPagesListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); for &field in ["alt", "enterpriseId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); @@ -5818,7 +4869,7 @@ impl<'a, C, A> StorelayoutpageListCall<'a, C, A> where C: BorrowMut StorelayoutpageListCall<'a, C, A> where C: BorrowMut StorelayoutpageListCall<'a, C, A> where C: BorrowMut StorelayoutpageListCall<'a, C, A> where C: BorrowMut StorelayoutpageInsertCall<'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) -> StorelayoutpageListCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutpageInsertCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } @@ -5937,7 +5012,7 @@ impl<'a, C, A> StorelayoutpageListCall<'a, C, A> where C: BorrowMut StorelayoutpageListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> StorelayoutpageInsertCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5958,7 +5033,7 @@ impl<'a, C, A> StorelayoutpageListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> StorelayoutpageListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> StorelayoutpageInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5975,7 +5050,7 @@ impl<'a, C, A> StorelayoutpageListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> StorelayoutpageListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> StorelayoutpageInsertCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -5983,10 +5058,10 @@ impl<'a, C, A> StorelayoutpageListCall<'a, C, A> where C: BorrowMut StorelayoutpageListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.collectionviewers().get("enterpriseId", "collectionId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct CollectionviewerGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _collection_id: String, - _user_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CollectionviewerGetCall<'a, C, A> {} - -impl<'a, C, A> CollectionviewerGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.collectionviewers.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("collectionId", self._collection_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "collectionId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{collectionId}", "collectionId"), ("{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(3); - for param_name in ["userId", "collectionId", "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) -> CollectionviewerGetCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the collection. - /// - /// 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) -> CollectionviewerGetCall<'a, C, A> { - self._collection_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) -> CollectionviewerGetCall<'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) -> CollectionviewerGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> CollectionviewerGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CollectionviewerGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *collectionviewer* resource. -/// It is not used directly, but through a `CollectionviewerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::User; +/// use androidenterprise1::StorePage; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -6269,35 +5085,34 @@ impl<'a, C, A> CollectionviewerGetCall<'a, C, A> where C: BorrowMut +pub struct StorelayoutpagePatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, - _request: User, + _request: StorePage, _enterprise_id: String, - _collection_id: String, - _user_id: String, + _page_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for CollectionviewerPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for StorelayoutpagePatchCall<'a, C, A> {} -impl<'a, C, A> CollectionviewerPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> StorelayoutpagePatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { + 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; @@ -6305,13 +5120,12 @@ impl<'a, C, A> CollectionviewerPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.collectionviewers.patch", + dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.patch", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("collectionId", self._collection_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "collectionId", "userId"].iter() { + 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)); @@ -6323,12 +5137,12 @@ impl<'a, C, A> CollectionviewerPatchCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -6339,8 +5153,8 @@ impl<'a, C, A> CollectionviewerPatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["userId", "collectionId", "enterpriseId"].iter() { + 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); } @@ -6446,7 +5260,7 @@ impl<'a, C, A> CollectionviewerPatchCall<'a, C, A> where C: BorrowMut CollectionviewerPatchCall<'a, C, A> { + pub fn request(mut self, new_value: StorePage) -> StorelayoutpagePatchCall<'a, C, A> { self._request = new_value; self } @@ -6456,28 +5270,18 @@ impl<'a, C, A> CollectionviewerPatchCall<'a, C, A> where C: BorrowMut CollectionviewerPatchCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> StorelayoutpagePatchCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } - /// The ID of the collection. + /// The ID of the page. /// - /// Sets the *collection id* path property to the given value. + /// 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 collection_id(mut self, new_value: &str) -> CollectionviewerPatchCall<'a, C, A> { - self._collection_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) -> CollectionviewerPatchCall<'a, C, A> { - self._user_id = new_value.to_string(); + pub fn page_id(mut self, new_value: &str) -> StorelayoutpagePatchCall<'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 @@ -6486,7 +5290,7 @@ impl<'a, C, A> CollectionviewerPatchCall<'a, C, A> where C: BorrowMut CollectionviewerPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> StorelayoutpagePatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -6507,7 +5311,7 @@ impl<'a, C, A> CollectionviewerPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CollectionviewerPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> StorelayoutpagePatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -6524,7 +5328,7 @@ impl<'a, C, A> CollectionviewerPatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> CollectionviewerPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> StorelayoutpagePatchCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -6532,10 +5336,10 @@ impl<'a, C, A> CollectionviewerPatchCall<'a, C, A> where C: BorrowMut CollectionviewerPatchCall<'a, C, A> where C: BorrowMut +pub struct StorelayoutpageDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, _enterprise_id: String, - _collection_id: String, + _page_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for CollectionviewerListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for StorelayoutpageDeleteCall<'a, C, A> {} -impl<'a, C, A> CollectionviewerListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, CollectionViewersListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.collectionviewers.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(("collectionId", self._collection_id.to_string())); - for &field in ["alt", "enterpriseId", "collectionId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/collections/{collectionId}/users"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{collectionId}", "collectionId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["collectionId", "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) -> CollectionviewerListCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the collection. - /// - /// 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) -> CollectionviewerListCall<'a, C, A> { - self._collection_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> CollectionviewerListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> CollectionviewerListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CollectionviewerListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Removes the user from the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. -/// -/// A builder for the *delete* method supported by a *collectionviewer* resource. -/// It is not used directly, but through a `CollectionviewerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.collectionviewers().delete("enterpriseId", "collectionId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct CollectionviewerDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _collection_id: String, - _user_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CollectionviewerDeleteCall<'a, C, A> {} - -impl<'a, C, A> CollectionviewerDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> StorelayoutpageDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -6835,13 +5391,12 @@ impl<'a, C, A> CollectionviewerDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.collectionviewers.delete", + dlg.begin(MethodInfo { id: "androidenterprise.storelayoutpages.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((3 + self._additional_params.len())); params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("collectionId", self._collection_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["enterpriseId", "collectionId", "userId"].iter() { + 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)); @@ -6852,12 +5407,12 @@ impl<'a, C, A> CollectionviewerDeleteCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -6868,8 +5423,8 @@ impl<'a, C, A> CollectionviewerDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["userId", "collectionId", "enterpriseId"].iter() { + 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); } @@ -6951,28 +5506,18 @@ impl<'a, C, A> CollectionviewerDeleteCall<'a, C, A> where C: BorrowMut CollectionviewerDeleteCall<'a, C, A> { + 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 collection. + /// The ID of the page. /// - /// Sets the *collection id* path property to the given value. + /// 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 collection_id(mut self, new_value: &str) -> CollectionviewerDeleteCall<'a, C, A> { - self._collection_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) -> CollectionviewerDeleteCall<'a, C, A> { - self._user_id = new_value.to_string(); + 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 @@ -6981,7 +5526,7 @@ impl<'a, C, A> CollectionviewerDeleteCall<'a, C, A> where C: BorrowMut CollectionviewerDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> StorelayoutpageDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -7002,7 +5547,7 @@ impl<'a, C, A> CollectionviewerDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CollectionviewerDeleteCall<'a, C, A> + 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 @@ -7019,297 +5564,7 @@ impl<'a, C, A> CollectionviewerDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> CollectionviewerDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Adds the user to the list of those specifically allowed to see the collection. If the collection's visibility is set to viewersOnly then only such users will see the collection. -/// -/// A builder for the *update* method supported by a *collectionviewer* resource. -/// It is not used directly, but through a `CollectionviewerMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::User; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = User::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.collectionviewers().update(req, "enterpriseId", "collectionId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct CollectionviewerUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: User, - _enterprise_id: String, - _collection_id: String, - _user_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CollectionviewerUpdateCall<'a, C, A> {} - -impl<'a, C, A> CollectionviewerUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.collectionviewers.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("collectionId", self._collection_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "collectionId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/collections/{collectionId}/users/{userId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{collectionId}", "collectionId"), ("{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(3); - for param_name in ["userId", "collectionId", "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: User) -> CollectionviewerUpdateCall<'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) -> CollectionviewerUpdateCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the collection. - /// - /// 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) -> CollectionviewerUpdateCall<'a, C, A> { - self._collection_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) -> CollectionviewerUpdateCall<'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) -> CollectionviewerUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> CollectionviewerUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CollectionviewerUpdateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> StorelayoutpageDeleteCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -7388,7 +5643,7 @@ impl<'a, C, A> UserRevokeTokenCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/token"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/token".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7634,7 +5889,7 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7833,6 +6088,985 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa } +/// Retrieves a user's details. +/// +/// A builder for the *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 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.users().get("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserGetCall<'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 UserGetCall<'a, C, A> {} + +impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> UserGetCall<'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) -> UserGetCall<'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) -> UserGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deleted an EMM-managed user. +/// +/// A builder for the *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 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.users().delete("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserDeleteCall<'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 UserDeleteCall<'a, C, A> {} + +impl<'a, C, A> UserDeleteCall<'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.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(("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 = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}".to_string(); + 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) -> UserDeleteCall<'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) -> UserDeleteCall<'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) -> UserDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. +/// +/// This call only works with EMM-managed accounts. +/// +/// A builder for the *generateAuthenticationToken* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.users().generate_authentication_token("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserGenerateAuthenticationTokenCall<'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 UserGenerateAuthenticationTokenCall<'a, C, A> {} + +impl<'a, C, A> UserGenerateAuthenticationTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AuthenticationToken)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.generateAuthenticationToken", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/authenticationToken".to_string(); + 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::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> UserGenerateAuthenticationTokenCall<'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) -> UserGenerateAuthenticationTokenCall<'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) -> UserGenerateAuthenticationTokenCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserGenerateAuthenticationTokenCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserGenerateAuthenticationTokenCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. +/// +/// A builder for the *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 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.users().list("enterpriseId", "email") +/// .doit(); +/// # } +/// ``` +pub struct UserListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _email: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserListCall<'a, C, A> {} + +impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UsersListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.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(("email", self._email.to_string())); + for &field in ["alt", "enterpriseId", "email"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> UserListCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The exact primary email address of the user to look up. + /// + /// Sets the *email* 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 email(mut self, new_value: &str) -> UserListCall<'a, C, A> { + self._email = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Updates the details of an EMM-managed user. /// /// Can be used with EMM-managed users only (not Google managed users). Pass the new details in the Users resource in the request body. Only the displayName field can be changed. Other fields must either be unset or have the currently active value. This method supports patch semantics. @@ -7914,7 +7148,7 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8113,7 +7347,525 @@ impl<'a, C, A> UserPatchCall<'a, C, A> where C: BorrowMut, A: oau } -/// Modifies the set of products a user is entitled to access. +/// Creates a new EMM-managed user. +/// +/// The Users resource passed in the body of the request should include an accountIdentifier and an accountType. +/// If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed. +/// +/// A builder for the *insert* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// use androidenterprise1::User; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = User::default(); +/// +/// // You can configure optional parameters by calling 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().insert(req, "enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct UserInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _request: User, + _enterprise_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserInsertCall<'a, C, A> {} + +impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.insert", + 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 = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users".to_string(); + 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: User) -> UserInsertCall<'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) -> UserInsertCall<'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) -> UserInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Generates a token (activation code) to allow this user to configure their managed account in the Android Setup Wizard. Revokes any previously generated token. +/// +/// This call only works with Google managed accounts. +/// +/// A builder for the *generateToken* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.users().generate_token("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserGenerateTokenCall<'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 UserGenerateTokenCall<'a, C, A> {} + +impl<'a, C, A> UserGenerateTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, UserToken)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.generateToken", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/token".to_string(); + 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::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> UserGenerateTokenCall<'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) -> UserGenerateTokenCall<'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) -> UserGenerateTokenCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserGenerateTokenCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserGenerateTokenCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Modifies the set of products that a user is entitled to access (referred to as whitelisted products). Only products that are approved or products that were previously approved (products with revoked approval) can be whitelisted. /// /// A builder for the *setAvailableProductSet* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. @@ -8192,7 +7944,7 @@ impl<'a, C, A> UserSetAvailableProductSetCall<'a, C, A> where C: BorrowMut UserGetAvailableProductSetCall<'a, C, A> where C: BorrowMut UserGetAvailableProductSetCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.users().get("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct UserGetCall<'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 UserGetCall<'a, C, A> {} - -impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserGetCall<'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) -> UserGetCall<'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) -> UserGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Creates a new EMM-managed user. -/// -/// The Users resource passed in the body of the request should include an accountIdentifier and an accountType. -/// If a corresponding user already exists with the same account identifier, the user will be updated with the resource. In this case only the displayName field can be changed. -/// -/// A builder for the *insert* method supported by a *user* resource. -/// It is not used directly, but through a `UserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::User; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = User::default(); -/// -/// // You can configure optional parameters by calling 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().insert(req, "enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct UserInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: User, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UserInsertCall<'a, C, A> {} - -impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.insert", - 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}/users"; - 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: User) -> UserInsertCall<'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) -> UserInsertCall<'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) -> UserInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserInsertCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Generates a token (activation code) to allow this user to configure their work account in the Android Setup Wizard. Revokes any previously generated token. -/// -/// This call only works with Google managed accounts. -/// -/// A builder for the *generateToken* method supported by a *user* resource. -/// It is not used directly, but through a `UserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.users().generate_token("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct UserGenerateTokenCall<'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 UserGenerateTokenCall<'a, C, A> {} - -impl<'a, C, A> UserGenerateTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, UserToken)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.generateToken", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/token"; - 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::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserGenerateTokenCall<'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) -> UserGenerateTokenCall<'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) -> UserGenerateTokenCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserGenerateTokenCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserGenerateTokenCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Deleted an EMM-managed user. -/// -/// A builder for the *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 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.users().delete("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct UserDeleteCall<'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 UserDeleteCall<'a, C, A> {} - -impl<'a, C, A> UserDeleteCall<'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.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(("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}"; - 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) -> UserDeleteCall<'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) -> UserDeleteCall<'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) -> UserDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Looks up a user by primary email address. This is only supported for Google-managed users. Lookup of the id is not needed for EMM-managed users because the id is already returned in the result of the Users.insert call. -/// -/// A builder for the *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 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.users().list("enterpriseId", "email") -/// .doit(); -/// # } -/// ``` -pub struct UserListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _email: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for UserListCall<'a, C, A> {} - -impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, UsersListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.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(("email", self._email.to_string())); - for &field in ["alt", "enterpriseId", "email"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserListCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The exact primary email address of the user to look up. - /// - /// Sets the *email* 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 email(mut self, new_value: &str) -> UserListCall<'a, C, A> { - self._email = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Generates an authentication token which the device policy client can use to provision the given EMM-managed user account on a device. The generated token is single-use and expires after a few minutes. -/// -/// This call only works with EMM-managed accounts. -/// -/// A builder for the *generateAuthenticationToken* method supported by a *user* resource. -/// It is not used directly, but through a `UserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.users().generate_authentication_token("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct UserGenerateAuthenticationTokenCall<'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 UserGenerateAuthenticationTokenCall<'a, C, A> {} - -impl<'a, C, A> UserGenerateAuthenticationTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AuthenticationToken)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.generateAuthenticationToken", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/authenticationToken"; - 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::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> UserGenerateAuthenticationTokenCall<'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) -> UserGenerateAuthenticationTokenCall<'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) -> UserGenerateAuthenticationTokenCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserGenerateAuthenticationTokenCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserGenerateAuthenticationTokenCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary. This method supports patch semantics. +/// Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *install* resource. /// It is not used directly, but through a `InstallMethods` instance. @@ -10218,7 +8473,7 @@ impl<'a, C, A> InstallPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10437,266 +8692,6 @@ impl<'a, C, A> InstallPatchCall<'a, C, A> where C: BorrowMut, A: } -/// Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. -/// -/// A builder for the *delete* method supported by a *install* resource. -/// It is not used directly, but through a `InstallMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.installs().delete("enterpriseId", "userId", "deviceId", "installId") -/// .doit(); -/// # } -/// ``` -pub struct InstallDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _install_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InstallDeleteCall<'a, C, A> {} - -impl<'a, C, A> InstallDeleteCall<'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.installs.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + 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())); - params.push(("installId", self._install_id.to_string())); - for &field in ["enterpriseId", "userId", "deviceId", "installId"].iter() { - if self._additional_params.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}/devices/{deviceId}/installs/{installId}"; - 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"), ("{installId}", "installId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(4); - for param_name in ["installId", "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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_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) -> InstallDeleteCall<'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) -> InstallDeleteCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The Android 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) -> InstallDeleteCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The ID of the product represented by the install, e.g. "app:com.google.android.gm". - /// - /// Sets the *install id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn install_id(mut self, new_value: &str) -> InstallDeleteCall<'a, C, A> { - self._install_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstallDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> InstallDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InstallDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Retrieves details of an installation of an app on a device. /// /// A builder for the *get* method supported by a *install* resource. @@ -10773,7 +8768,7 @@ impl<'a, C, A> InstallGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11042,7 +9037,7 @@ impl<'a, C, A> InstallListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11227,7 +9222,267 @@ impl<'a, C, A> InstallListCall<'a, C, A> where C: BorrowMut, A: o } -/// Requests to install the latest version of an app to a device. If the app is already installed then it is updated to the latest version if necessary. +/// Requests to remove an app from a device. A call to get or list will still show the app as installed on the device until it is actually removed. +/// +/// A builder for the *delete* method supported by a *install* resource. +/// It is not used directly, but through a `InstallMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.installs().delete("enterpriseId", "userId", "deviceId", "installId") +/// .doit(); +/// # } +/// ``` +pub struct InstallDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _device_id: String, + _install_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InstallDeleteCall<'a, C, A> {} + +impl<'a, C, A> InstallDeleteCall<'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.installs.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + 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())); + params.push(("installId", self._install_id.to_string())); + for &field in ["enterpriseId", "userId", "deviceId", "installId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}".to_string(); + 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"), ("{installId}", "installId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(4); + for param_name in ["installId", "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)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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) -> InstallDeleteCall<'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) -> InstallDeleteCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The Android 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) -> InstallDeleteCall<'a, C, A> { + self._device_id = new_value.to_string(); + self + } + /// The ID of the product represented by the install, e.g. "app:com.google.android.gm". + /// + /// Sets the *install id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn install_id(mut self, new_value: &str) -> InstallDeleteCall<'a, C, A> { + self._install_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> InstallDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> InstallDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InstallDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Requests to install the latest version of an app to a device. If the app is already installed, then it is updated to the latest version if necessary. /// /// A builder for the *update* method supported by a *install* resource. /// It is not used directly, but through a `InstallMethods` instance. @@ -11310,7 +9565,7 @@ impl<'a, C, A> InstallUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/installs/{installId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11601,7 +9856,7 @@ impl<'a, C, A> GrouplicenseGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses/{groupLicenseId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11846,7 +10101,7 @@ impl<'a, C, A> GrouplicenseListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/groupLicenses"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/groupLicenses".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12011,6 +10266,525 @@ impl<'a, C, A> GrouplicenseListCall<'a, C, A> where C: BorrowMut, } +/// Removes a per-device managed configuration for an app for the specified device. +/// +/// A builder for the *delete* method supported by a *managedconfigurationsfordevice* resource. +/// It is not used directly, but through a `ManagedconfigurationsfordeviceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.managedconfigurationsfordevice().delete("enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId") +/// .doit(); +/// # } +/// ``` +pub struct ManagedconfigurationsfordeviceDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _device_id: String, + _managed_configuration_for_device_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ManagedconfigurationsfordeviceDeleteCall<'a, C, A> {} + +impl<'a, C, A> ManagedconfigurationsfordeviceDeleteCall<'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.managedconfigurationsfordevice.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + 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())); + params.push(("managedConfigurationForDeviceId", self._managed_configuration_for_device_id.to_string())); + for &field in ["enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}".to_string(); + 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"), ("{managedConfigurationForDeviceId}", "managedConfigurationForDeviceId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(4); + for param_name in ["managedConfigurationForDeviceId", "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)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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) -> ManagedconfigurationsfordeviceDeleteCall<'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) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The Android 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) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { + self._device_id = new_value.to_string(); + self + } + /// The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + /// + /// Sets the *managed configuration for 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 managed_configuration_for_device_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { + self._managed_configuration_for_device_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists all the per-device managed configurations for the specified device. Only the ID is set. +/// +/// A builder for the *list* method supported by a *managedconfigurationsfordevice* resource. +/// It is not used directly, but through a `ManagedconfigurationsfordeviceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.managedconfigurationsfordevice().list("enterpriseId", "userId", "deviceId") +/// .doit(); +/// # } +/// ``` +pub struct ManagedconfigurationsfordeviceListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _device_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ManagedconfigurationsfordeviceListCall<'a, C, A> {} + +impl<'a, C, A> ManagedconfigurationsfordeviceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfigurationsForDeviceListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.managedconfigurationsfordevice.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + 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())); + for &field in ["alt", "enterpriseId", "userId", "deviceId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice".to_string(); + 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)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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) -> ManagedconfigurationsfordeviceListCall<'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) -> ManagedconfigurationsfordeviceListCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The Android 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) -> ManagedconfigurationsfordeviceListCall<'a, C, A> { + self._device_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ManagedconfigurationsfordeviceListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsfordeviceListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsfordeviceListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Adds or updates a per-device managed configuration for an app for the specified device. /// /// A builder for the *update* method supported by a *managedconfigurationsfordevice* resource. @@ -12094,7 +10868,7 @@ impl<'a, C, A> ManagedconfigurationsfordeviceUpdateCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12313,6 +11087,277 @@ impl<'a, C, A> ManagedconfigurationsfordeviceUpdateCall<'a, C, A> where C: Borro } +/// Retrieves details of a per-device managed configuration. +/// +/// A builder for the *get* method supported by a *managedconfigurationsfordevice* resource. +/// It is not used directly, but through a `ManagedconfigurationsfordeviceMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.managedconfigurationsfordevice().get("enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId") +/// .doit(); +/// # } +/// ``` +pub struct ManagedconfigurationsfordeviceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _device_id: String, + _managed_configuration_for_device_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ManagedconfigurationsfordeviceGetCall<'a, C, A> {} + +impl<'a, C, A> ManagedconfigurationsfordeviceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfiguration)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.managedconfigurationsfordevice.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + 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())); + params.push(("managedConfigurationForDeviceId", self._managed_configuration_for_device_id.to_string())); + for &field in ["alt", "enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}".to_string(); + 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"), ("{managedConfigurationForDeviceId}", "managedConfigurationForDeviceId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(4); + for param_name in ["managedConfigurationForDeviceId", "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)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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) -> ManagedconfigurationsfordeviceGetCall<'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) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The Android 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) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> { + self._device_id = new_value.to_string(); + self + } + /// The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". + /// + /// Sets the *managed configuration for 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 managed_configuration_for_device_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> { + self._managed_configuration_for_device_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Adds or updates a per-device managed configuration for an app for the specified device. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *managedconfigurationsfordevice* resource. @@ -12396,7 +11441,7 @@ impl<'a, C, A> ManagedconfigurationsfordevicePatchCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12615,796 +11660,6 @@ impl<'a, C, A> ManagedconfigurationsfordevicePatchCall<'a, C, A> where C: Borrow } -/// Lists all the per-device managed configurations for the specified device. Only the ID is set. -/// -/// A builder for the *list* method supported by a *managedconfigurationsfordevice* resource. -/// It is not used directly, but through a `ManagedconfigurationsfordeviceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.managedconfigurationsfordevice().list("enterpriseId", "userId", "deviceId") -/// .doit(); -/// # } -/// ``` -pub struct ManagedconfigurationsfordeviceListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ManagedconfigurationsfordeviceListCall<'a, C, A> {} - -impl<'a, C, A> ManagedconfigurationsfordeviceListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfigurationsForDeviceListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.managedconfigurationsfordevice.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + 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())); - for &field in ["alt", "enterpriseId", "userId", "deviceId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/managedConfigurationsForDevice"; - 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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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) -> ManagedconfigurationsfordeviceListCall<'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) -> ManagedconfigurationsfordeviceListCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The Android 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) -> ManagedconfigurationsfordeviceListCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ManagedconfigurationsfordeviceListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsfordeviceListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsfordeviceListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Removes a per-device managed configuration for an app for the specified device. -/// -/// A builder for the *delete* method supported by a *managedconfigurationsfordevice* resource. -/// It is not used directly, but through a `ManagedconfigurationsfordeviceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.managedconfigurationsfordevice().delete("enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId") -/// .doit(); -/// # } -/// ``` -pub struct ManagedconfigurationsfordeviceDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _managed_configuration_for_device_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ManagedconfigurationsfordeviceDeleteCall<'a, C, A> {} - -impl<'a, C, A> ManagedconfigurationsfordeviceDeleteCall<'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.managedconfigurationsfordevice.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + 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())); - params.push(("managedConfigurationForDeviceId", self._managed_configuration_for_device_id.to_string())); - for &field in ["enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId"].iter() { - if self._additional_params.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}/devices/{deviceId}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; - 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"), ("{managedConfigurationForDeviceId}", "managedConfigurationForDeviceId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(4); - for param_name in ["managedConfigurationForDeviceId", "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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_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) -> ManagedconfigurationsfordeviceDeleteCall<'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) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The Android 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) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - /// - /// Sets the *managed configuration for 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 managed_configuration_for_device_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - self._managed_configuration_for_device_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsfordeviceDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves details of a per-device managed configuration. -/// -/// A builder for the *get* method supported by a *managedconfigurationsfordevice* resource. -/// It is not used directly, but through a `ManagedconfigurationsfordeviceMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.managedconfigurationsfordevice().get("enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId") -/// .doit(); -/// # } -/// ``` -pub struct ManagedconfigurationsfordeviceGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _managed_configuration_for_device_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ManagedconfigurationsfordeviceGetCall<'a, C, A> {} - -impl<'a, C, A> ManagedconfigurationsfordeviceGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfiguration)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.managedconfigurationsfordevice.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + 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())); - params.push(("managedConfigurationForDeviceId", self._managed_configuration_for_device_id.to_string())); - for &field in ["alt", "enterpriseId", "userId", "deviceId", "managedConfigurationForDeviceId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/managedConfigurationsForDevice/{managedConfigurationForDeviceId}"; - 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"), ("{managedConfigurationForDeviceId}", "managedConfigurationForDeviceId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(4); - for param_name in ["managedConfigurationForDeviceId", "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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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) -> ManagedconfigurationsfordeviceGetCall<'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) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> { - self._user_id = new_value.to_string(); - self - } - /// The Android 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) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The ID of the managed configuration (a product ID), e.g. "app:com.google.android.gm". - /// - /// Sets the *managed configuration for 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 managed_configuration_for_device_id(mut self, new_value: &str) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> { - self._managed_configuration_for_device_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsfordeviceGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Sets whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. /// /// A builder for the *setState* method supported by a *device* resource. @@ -13486,7 +11741,7 @@ impl<'a, C, A> DeviceSetStateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13695,265 +11950,6 @@ impl<'a, C, A> DeviceSetStateCall<'a, C, A> where C: BorrowMut, A } -/// Retrieves the details of a device. -/// -/// A builder for the *get* 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 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.devices().get("enterpriseId", "userId", "deviceId") -/// .doit(); -/// # } -/// ``` -pub struct DeviceGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _user_id: String, - _device_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DeviceGetCall<'a, C, A> {} - -impl<'a, C, A> DeviceGetCall<'a, C, 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.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + 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())); - for &field in ["alt", "enterpriseId", "userId", "deviceId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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) -> DeviceGetCall<'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) -> DeviceGetCall<'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) -> DeviceGetCall<'a, C, A> { - self._device_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> DeviceGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DeviceGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DeviceGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Retrieves whether a device's access to Google services is enabled or disabled. The device state takes effect only if enforcing EMM policies on Android devices is enabled in the Google Admin Console. Otherwise, the device state is ignored and all devices are allowed access to Google services. This is only supported for Google-managed users. /// /// A builder for the *getState* method supported by a *device* resource. @@ -14028,7 +12024,7 @@ impl<'a, C, A> DeviceGetStateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}/state".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14285,7 +12281,7 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/devices"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14460,6 +12456,692 @@ impl<'a, C, A> DeviceListCall<'a, C, A> where C: BorrowMut, A: oa } +/// Retrieves the details of a device. +/// +/// A builder for the *get* 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 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.devices().get("enterpriseId", "userId", "deviceId") +/// .doit(); +/// # } +/// ``` +pub struct DeviceGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _user_id: String, + _device_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DeviceGetCall<'a, C, A> {} + +impl<'a, C, A> DeviceGetCall<'a, C, 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.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + 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())); + for &field in ["alt", "enterpriseId", "userId", "deviceId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/devices/{deviceId}".to_string(); + 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)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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) -> DeviceGetCall<'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) -> DeviceGetCall<'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) -> DeviceGetCall<'a, C, A> { + self._device_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DeviceGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DeviceGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DeviceGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + 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. +/// 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 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.enterprises().acknowledge_notification_set() +/// .notification_set_id("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseAcknowledgeNotificationSetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _notification_set_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseAcknowledgeNotificationSetCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseAcknowledgeNotificationSetCall<'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.enterprises.acknowledgeNotificationSet", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + if let Some(value) = self._notification_set_id { + params.push(("notificationSetId", value.to_string())); + } + for &field in ["notificationSetId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/acknowledgeNotificationSet".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = res; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided. + /// + /// Sets the *notification set id* query property to the given value. + pub fn notification_set_id(mut self, new_value: &str) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { + self._notification_set_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) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Unenrolls an enterprise from the calling EMM. +/// +/// A builder for the *unenroll* 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 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.enterprises().unenroll("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseUnenrollCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseUnenrollCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseUnenrollCall<'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.enterprises.unenroll", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["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())); + } + + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/unenroll".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::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 = 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) -> EnterpriseUnenrollCall<'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) -> EnterpriseUnenrollCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseUnenrollCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseUnenrollCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Establishes the binding between the EMM and an enterprise. This is now deprecated; use enroll instead. /// /// A builder for the *insert* method supported by a *enterprise* resource. @@ -14537,7 +13219,7 @@ impl<'a, C, A> EnterpriseInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14705,7 +13387,691 @@ impl<'a, C, A> EnterpriseInsertCall<'a, C, A> where C: BorrowMut, } -/// Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the administrator, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom"), the basic store layout is disabled. +/// Sends a test push notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. +/// +/// A builder for the *sendTestPushNotification* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling 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().send_test_push_notification("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseSendTestPushNotificationCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseSendTestPushNotificationCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, EnterprisesSendTestPushNotificationResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.sendTestPushNotification", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/sendTestPushNotification".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseSendTestPushNotificationCall<'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) -> EnterpriseSendTestPushNotificationCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseSendTestPushNotificationCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseSendTestPushNotificationCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Looks up an enterprise by domain name. This is only supported for enterprises created via the Google-initiated creation flow. Lookup of the id is not needed for enterprises created via the EMM-initiated flow since the EMM learns the enterprise ID in the callback specified in the Enterprises.generateSignupUrl call. +/// +/// A builder for the *list* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.enterprises().list("domain") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _domain: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseListCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, EnterprisesListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("domain", self._domain.to_string())); + for &field in ["alt", "domain"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises".to_string(); + 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 exact primary domain name of the enterprise to look up. + /// + /// Sets the *domain* 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 domain(mut self, new_value: &str) -> EnterpriseListCall<'a, C, A> { + self._domain = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns the store layout for the enterprise. If the store layout has not been set, returns "basic" as the store layout type and no homepage. +/// +/// A builder for the *getStoreLayout* 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 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.enterprises().get_store_layout("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseGetStoreLayoutCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseGetStoreLayoutCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseGetStoreLayoutCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, StoreLayout)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.getStoreLayout", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseGetStoreLayoutCall<'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) -> EnterpriseGetStoreLayoutCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseGetStoreLayoutCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseGetStoreLayoutCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Sets the store layout for the enterprise. By default, storeLayoutType is set to "basic" and the basic store layout is enabled. The basic layout only contains apps approved by the admin, and that have been added to the available product set for a user (using the setAvailableProductSet call). Apps on the page are sorted in order of their product ID value. If you create a custom store layout (by setting storeLayoutType = "custom" and setting a homepage), the basic store layout is disabled. /// /// A builder for the *setStoreLayout* method supported by a *enterprise* resource. /// It is not used directly, but through a `EnterpriseMethods` instance. @@ -14782,7 +14148,7 @@ impl<'a, C, A> EnterpriseSetStoreLayoutCall<'a, C, A> where C: BorrowMut EnterpriseSetStoreLayoutCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.enterprises().complete_signup() +/// .enterprise_token("ea") +/// .completion_token("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseCompleteSignupCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_token: Option, + _completion_token: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseCompleteSignupCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseCompleteSignupCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Enterprise)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.enterprises.completeSignup", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + if let Some(value) = self._enterprise_token { + params.push(("enterpriseToken", value.to_string())); + } + if let Some(value) = self._completion_token { + params.push(("completionToken", value.to_string())); + } + for &field in ["alt", "enterpriseToken", "completionToken"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/completeSignup".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The Enterprise token appended to the Callback URL. + /// + /// Sets the *enterprise token* query property to the given value. + pub fn enterprise_token(mut self, new_value: &str) -> EnterpriseCompleteSignupCall<'a, C, A> { + self._enterprise_token = Some(new_value.to_string()); + self + } + /// The Completion token initially returned by GenerateSignupUrl. + /// + /// Sets the *completion token* query property to the given value. + pub fn completion_token(mut self, new_value: &str) -> EnterpriseCompleteSignupCall<'a, C, A> { + self._completion_token = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseCompleteSignupCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseCompleteSignupCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseCompleteSignupCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Pulls and returns a notification set for the enterprises associated with the service account authenticated for the request. The notification set may be empty if no notification are pending. -/// A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises​.AcknowledgeNotificationSet, unless the notification set is empty. +/// A notification set returned needs to be acknowledged within 20 seconds by calling Enterprises.AcknowledgeNotificationSet, unless the notification set is empty. /// Notifications that are not acknowledged within the 20 seconds will eventually be included again in the response to another PullNotificationSet request, and those that are never acknowledged will ultimately be deleted according to the Google Cloud Platform Pub/Sub system policy. /// Multiple requests might be performed concurrently to retrieve notifications, in which case the pending notifications (if any) will be split among each caller, if any are pending. /// If no notifications are present, an empty notification list is returned. Subsequent requests may return more notifications once they become available. @@ -15002,7 +14594,7 @@ impl<'a, C, A> EnterpriseSetStoreLayoutCall<'a, C, A> where C: BorrowMut EnterprisePullNotificationSetCall<'a, C, A> where C: BorrowMut EnterpriseEnrollCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/enroll"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/enroll".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15437,7 +15029,495 @@ impl<'a, C, A> EnterpriseEnrollCall<'a, C, A> where C: BorrowMut, } -/// Set the account that will be used to authenticate to the API as the enterprise. +/// Retrieves the name and domain of an enterprise. +/// +/// A builder for the *get* method supported by a *enterprise* resource. +/// It is not used directly, but through a `EnterpriseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.enterprises().get("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseGetCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Enterprise)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseGetCall<'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) -> EnterpriseGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. +/// +/// This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error. +/// +/// Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials. +/// +/// Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource. +/// +/// A builder for the *getServiceAccount* 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 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.enterprises().get_service_account("enterpriseId") +/// .key_type("aliquyam") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseGetServiceAccountCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _key_type: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseGetServiceAccountCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseGetServiceAccountCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceAccount)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.getServiceAccount", + 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())); + if let Some(value) = self._key_type { + params.push(("keyType", value.to_string())); + } + for &field in ["alt", "enterpriseId", "keyType"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/serviceAccount".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseGetServiceAccountCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The type of credential to return with the service account. Required. + /// + /// Sets the *key type* query property to the given value. + pub fn key_type(mut self, new_value: &str) -> EnterpriseGetServiceAccountCall<'a, C, A> { + self._key_type = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseGetServiceAccountCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseGetServiceAccountCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseGetServiceAccountCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Sets the account that will be used to authenticate to the API as the enterprise. /// /// A builder for the *setAccount* method supported by a *enterprise* resource. /// It is not used directly, but through a `EnterpriseMethods` instance. @@ -15514,7 +15594,7 @@ impl<'a, C, A> EnterpriseSetAccountCall<'a, C, A> where C: BorrowMut EnterpriseSetAccountCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.enterprises().delete("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseDeleteCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseDeleteCall<'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.enterprises.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["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())); + } + + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::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) -> EnterpriseDeleteCall<'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) -> EnterpriseDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Generates a sign-up URL. +/// +/// A builder for the *generateSignupUrl* 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 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.enterprises().generate_signup_url() +/// .callback_url("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct EnterpriseGenerateSignupUrlCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _callback_url: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for EnterpriseGenerateSignupUrlCall<'a, C, A> {} + +impl<'a, C, A> EnterpriseGenerateSignupUrlCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SignupInfo)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.generateSignupUrl", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + if let Some(value) = self._callback_url { + params.push(("callbackUrl", value.to_string())); + } + for &field in ["alt", "callbackUrl"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/signupUrl".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The callback URL to which the Admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a single query parameter to this URL named "enterpriseToken" which will contain an opaque token to be used for the CompleteSignup request. + /// Beware that this means that the URL will be parsed, the parameter added and then a new URL formatted, i.e. there may be some minor formatting changes and, more importantly, the URL must be well-formed so that it can be parsed. + /// + /// Sets the *callback url* query property to the given value. + pub fn callback_url(mut self, new_value: &str) -> EnterpriseGenerateSignupUrlCall<'a, C, A> { + self._callback_url = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseGenerateSignupUrlCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> EnterpriseGenerateSignupUrlCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> EnterpriseGenerateSignupUrlCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// 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. @@ -15780,7 +16299,7 @@ impl<'a, C, A> EnterpriseCreateWebTokenCall<'a, C, A> where C: BorrowMut EnterpriseCreateWebTokenCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.enterprises().list("domain") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _domain: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseListCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, EnterprisesListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("domain", self._domain.to_string())); - for &field in ["alt", "domain"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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"; - 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 exact primary domain name of the enterprise to look up. - /// - /// Sets the *domain* 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 domain(mut self, new_value: &str) -> EnterpriseListCall<'a, C, A> { - self._domain = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Returns the store layout for the enterprise. If the store layout has not been set, or if the store layout has no homepageId set, returns a NOT_FOUND error. -/// -/// A builder for the *getStoreLayout* 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 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.enterprises().get_store_layout("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseGetStoreLayoutCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseGetStoreLayoutCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseGetStoreLayoutCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StoreLayout)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.getStoreLayout", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/storeLayout"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseGetStoreLayoutCall<'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) -> EnterpriseGetStoreLayoutCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseGetStoreLayoutCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseGetStoreLayoutCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Completes the signup flow, by specifying the Completion token and Enterprise token. This request must not be called multiple times for a given Enterprise Token. -/// -/// A builder for the *completeSignup* 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 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.enterprises().complete_signup() -/// .enterprise_token("eos") -/// .completion_token("tempor") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseCompleteSignupCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_token: Option, - _completion_token: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseCompleteSignupCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseCompleteSignupCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Enterprise)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.enterprises.completeSignup", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - if let Some(value) = self._enterprise_token { - params.push(("enterpriseToken", value.to_string())); - } - if let Some(value) = self._completion_token { - params.push(("completionToken", value.to_string())); - } - for &field in ["alt", "enterpriseToken", "completionToken"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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/completeSignup"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The Enterprise token appended to the Callback URL. - /// - /// Sets the *enterprise token* query property to the given value. - pub fn enterprise_token(mut self, new_value: &str) -> EnterpriseCompleteSignupCall<'a, C, A> { - self._enterprise_token = Some(new_value.to_string()); - self - } - /// The Completion token initially returned by GenerateSignupUrl. - /// - /// Sets the *completion token* query property to the given value. - pub fn completion_token(mut self, new_value: &str) -> EnterpriseCompleteSignupCall<'a, C, A> { - self._completion_token = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseCompleteSignupCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseCompleteSignupCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseCompleteSignupCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Returns a service account and credentials. The service account can be bound to the enterprise by calling setAccount. The service account is unique to this enterprise and EMM, and will be deleted if the enterprise is unbound. The credentials contain private key data and are not stored server-side. -/// -/// This method can only be called after calling Enterprises.Enroll or Enterprises.CompleteSignup, and before Enterprises.SetAccount; at other times it will return an error. -/// -/// Subsequent calls after the first will generate a new, unique set of credentials, and invalidate the previously generated credentials. -/// -/// Once the service account is bound to the enterprise, it can be managed using the serviceAccountKeys resource. -/// -/// A builder for the *getServiceAccount* 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 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.enterprises().get_service_account("enterpriseId") -/// .key_type("labore") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseGetServiceAccountCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _key_type: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseGetServiceAccountCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseGetServiceAccountCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceAccount)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.getServiceAccount", - 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())); - if let Some(value) = self._key_type { - params.push(("keyType", value.to_string())); - } - for &field in ["alt", "enterpriseId", "keyType"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/serviceAccount"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseGetServiceAccountCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The type of credential to return with the service account. Required. - /// - /// Sets the *key type* query property to the given value. - pub fn key_type(mut self, new_value: &str) -> EnterpriseGetServiceAccountCall<'a, C, A> { - self._key_type = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseGetServiceAccountCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseGetServiceAccountCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseGetServiceAccountCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - 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. -/// 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 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.enterprises().acknowledge_notification_set() -/// .notification_set_id("ipsum") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseAcknowledgeNotificationSetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _notification_set_id: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseAcknowledgeNotificationSetCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseAcknowledgeNotificationSetCall<'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.enterprises.acknowledgeNotificationSet", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); - if let Some(value) = self._notification_set_id { - params.push(("notificationSetId", value.to_string())); - } - for &field in ["notificationSetId"].iter() { - if self._additional_params.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/acknowledgeNotificationSet"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = res; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The notification set ID as returned by Enterprises.PullNotificationSet. This must be provided. - /// - /// Sets the *notification set id* query property to the given value. - pub fn notification_set_id(mut self, new_value: &str) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { - self._notification_set_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) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseAcknowledgeNotificationSetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Unenrolls an enterprise from the calling EMM. -/// -/// A builder for the *unenroll* 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 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.enterprises().unenroll("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseUnenrollCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseUnenrollCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseUnenrollCall<'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.enterprises.unenroll", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["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())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/unenroll"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::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 = 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) -> EnterpriseUnenrollCall<'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) -> EnterpriseUnenrollCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseUnenrollCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseUnenrollCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Sends a test push notification to validate the EMM integration with the Google Cloud Pub/Sub service for this enterprise. -/// -/// A builder for the *sendTestPushNotification* method supported by a *enterprise* resource. -/// It is not used directly, but through a `EnterpriseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling 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().send_test_push_notification("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseSendTestPushNotificationCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseSendTestPushNotificationCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseSendTestPushNotificationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, EnterprisesSendTestPushNotificationResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.sendTestPushNotification", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/sendTestPushNotification"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseSendTestPushNotificationCall<'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) -> EnterpriseSendTestPushNotificationCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseSendTestPushNotificationCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseSendTestPushNotificationCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves the name and domain of an enterprise. -/// -/// A builder for the *get* method supported by a *enterprise* resource. -/// It is not used directly, but through a `EnterpriseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.enterprises().get("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseGetCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Enterprise)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> EnterpriseGetCall<'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) -> EnterpriseGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Deletes the binding between the EMM and enterprise. This is now deprecated; use this to unenroll customers that were previously enrolled with the 'insert' call, then enroll them again with the 'enroll' call. -/// -/// A builder for the *delete* method supported by a *enterprise* resource. -/// It is not used directly, but through a `EnterpriseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.enterprises().delete("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseDeleteCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseDeleteCall<'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.enterprises.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["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())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::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) -> EnterpriseDeleteCall<'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) -> EnterpriseDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Generates a sign-up URL. -/// -/// A builder for the *generateSignupUrl* 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 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.enterprises().generate_signup_url() -/// .callback_url("ut") -/// .doit(); -/// # } -/// ``` -pub struct EnterpriseGenerateSignupUrlCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _callback_url: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for EnterpriseGenerateSignupUrlCall<'a, C, A> {} - -impl<'a, C, A> EnterpriseGenerateSignupUrlCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, SignupInfo)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.generateSignupUrl", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - if let Some(value) = self._callback_url { - params.push(("callbackUrl", value.to_string())); - } - for &field in ["alt", "callbackUrl"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/signupUrl"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The callback URL to which the Admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a single query parameter to this URL named "enterpriseToken" which will contain an opaque token to be used for the CompleteSignup request. - /// Beware that this means that the URL will be parsed, the parameter added and then a new URL formatted, i.e. there may be some minor formatting changes and, more importantly, the URL must be well-formed so that it can be parsed. - /// - /// Sets the *callback url* query property to the given value. - pub fn callback_url(mut self, new_value: &str) -> EnterpriseGenerateSignupUrlCall<'a, C, A> { - self._callback_url = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> EnterpriseGenerateSignupUrlCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> EnterpriseGenerateSignupUrlCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> EnterpriseGenerateSignupUrlCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves the details of all clusters on the specified page. -/// -/// A builder for the *list* method supported by a *storelayoutcluster* resource. -/// It is not used directly, but through a `StorelayoutclusterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.storelayoutclusters().list("enterpriseId", "pageId") -/// .doit(); -/// # } -/// ``` -pub struct StorelayoutclusterListCall<'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 StorelayoutclusterListCall<'a, C, A> {} - -impl<'a, C, A> StorelayoutclusterListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StoreLayoutClustersListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.storelayoutclusters.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(("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}/clusters"; - 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::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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) -> StorelayoutclusterListCall<'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) -> StorelayoutclusterListCall<'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) -> StorelayoutclusterListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> StorelayoutclusterListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> StorelayoutclusterListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Updates a cluster. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *storelayoutcluster* resource. @@ -18561,7 +16569,7 @@ impl<'a, C, A> StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut StorelayoutclusterPatchCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.storelayoutclusters().delete("enterpriseId", "pageId", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct StorelayoutclusterDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _page_id: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for StorelayoutclusterDeleteCall<'a, C, A> {} + +impl<'a, C, A> StorelayoutclusterDeleteCall<'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.storelayoutclusters.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("pageId", self._page_id.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["enterpriseId", "pageId", "clusterId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{pageId}", "pageId"), ("{clusterId}", "clusterId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["clusterId", "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) -> StorelayoutclusterDeleteCall<'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) -> StorelayoutclusterDeleteCall<'a, C, A> { + self._page_id = new_value.to_string(); + self + } + /// The ID of the cluster. + /// + /// Sets the *cluster id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn cluster_id(mut self, new_value: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> StorelayoutclusterDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> StorelayoutclusterDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> StorelayoutclusterDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Inserts a new cluster in a page. +/// +/// A builder for the *insert* method supported by a *storelayoutcluster* resource. +/// It is not used directly, but through a `StorelayoutclusterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// use androidenterprise1::StoreCluster; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = StoreCluster::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.storelayoutclusters().insert(req, "enterpriseId", "pageId") +/// .doit(); +/// # } +/// ``` +pub struct StorelayoutclusterInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _request: StoreCluster, + _enterprise_id: String, + _page_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for StorelayoutclusterInsertCall<'a, C, A> {} + +impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, StoreCluster)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.storelayoutclusters.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("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 = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters".to_string(); + 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::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: StoreCluster) -> StorelayoutclusterInsertCall<'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) -> StorelayoutclusterInsertCall<'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) -> StorelayoutclusterInsertCall<'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) -> StorelayoutclusterInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> StorelayoutclusterInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> StorelayoutclusterInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves the details of all clusters on the specified page. +/// +/// A builder for the *list* method supported by a *storelayoutcluster* resource. +/// It is not used directly, but through a `StorelayoutclusterMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.storelayoutclusters().list("enterpriseId", "pageId") +/// .doit(); +/// # } +/// ``` +pub struct StorelayoutclusterListCall<'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 StorelayoutclusterListCall<'a, C, A> {} + +impl<'a, C, A> StorelayoutclusterListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, StoreLayoutClustersListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.storelayoutclusters.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(("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 = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters".to_string(); + 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::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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) -> StorelayoutclusterListCall<'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) -> StorelayoutclusterListCall<'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) -> StorelayoutclusterListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> StorelayoutclusterListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> StorelayoutclusterListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Updates a cluster. /// /// A builder for the *update* method supported by a *storelayoutcluster* resource. @@ -18851,7 +17632,7 @@ impl<'a, C, A> StorelayoutclusterUpdateCall<'a, C, A> where C: BorrowMut StorelayoutclusterGetCall<'a, C, A> where C: BorrowMut StorelayoutclusterGetCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = StoreCluster::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.storelayoutclusters().insert(req, "enterpriseId", "pageId") -/// .doit(); -/// # } -/// ``` -pub struct StorelayoutclusterInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: StoreCluster, - _enterprise_id: String, - _page_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for StorelayoutclusterInsertCall<'a, C, A> {} - -impl<'a, C, A> StorelayoutclusterInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StoreCluster)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.storelayoutclusters.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("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}/clusters"; - 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::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: StoreCluster) -> StorelayoutclusterInsertCall<'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) -> StorelayoutclusterInsertCall<'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) -> StorelayoutclusterInsertCall<'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) -> StorelayoutclusterInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> StorelayoutclusterInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> StorelayoutclusterInsertCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Deletes a cluster. -/// -/// A builder for the *delete* method supported by a *storelayoutcluster* resource. -/// It is not used directly, but through a `StorelayoutclusterMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.storelayoutclusters().delete("enterpriseId", "pageId", "clusterId") -/// .doit(); -/// # } -/// ``` -pub struct StorelayoutclusterDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _page_id: String, - _cluster_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for StorelayoutclusterDeleteCall<'a, C, A> {} - -impl<'a, C, A> StorelayoutclusterDeleteCall<'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.storelayoutclusters.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("pageId", self._page_id.to_string())); - params.push(("clusterId", self._cluster_id.to_string())); - for &field in ["enterpriseId", "pageId", "clusterId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/storeLayout/pages/{pageId}/clusters/{clusterId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{pageId}", "pageId"), ("{clusterId}", "clusterId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["clusterId", "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) -> StorelayoutclusterDeleteCall<'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) -> StorelayoutclusterDeleteCall<'a, C, A> { - self._page_id = new_value.to_string(); - self - } - /// The ID of the cluster. - /// - /// Sets the *cluster id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn cluster_id(mut self, new_value: &str) -> StorelayoutclusterDeleteCall<'a, C, A> { - self._cluster_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> StorelayoutclusterDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> StorelayoutclusterDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> StorelayoutclusterDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Retrieves the Android app permissions required by this app. /// /// A builder for the *getPermissions* method supported by a *product* resource. @@ -19917,7 +18172,7 @@ impl<'a, C, A> ProductGetPermissionCall<'a, C, A> where C: BorrowMut ProductUnapproveCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/unapprove"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/unapprove".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20328,9 +18583,529 @@ impl<'a, C, A> ProductUnapproveCall<'a, C, A> where C: BorrowMut, } +/// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. +/// +/// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. +/// +/// A builder for the *generateApprovalUrl* method supported by a *product* resource. +/// It is not used directly, but through a `ProductMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate 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::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.products().generate_approval_url("enterpriseId", "productId") +/// .language_code("clita") +/// .doit(); +/// # } +/// ``` +pub struct ProductGenerateApprovalUrlCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _product_id: String, + _language_code: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProductGenerateApprovalUrlCall<'a, C, A> {} + +impl<'a, C, A> ProductGenerateApprovalUrlCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ProductsGenerateApprovalUrlResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.products.generateApprovalUrl", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("productId", self._product_id.to_string())); + if let Some(value) = self._language_code { + params.push(("languageCode", value.to_string())); + } + for &field in ["alt", "enterpriseId", "productId", "languageCode"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{productId}", "productId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["productId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the product. + /// + /// Sets the *product id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn product_id(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._product_id = new_value.to_string(); + self + } + /// The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". + /// + /// Sets the *language code* query property to the given value. + pub fn language_code(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._language_code = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProductGenerateApprovalUrlCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProductGenerateApprovalUrlCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProductGenerateApprovalUrlCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves details of a product for display to an enterprise admin. +/// +/// A builder for the *get* method supported by a *product* resource. +/// It is not used directly, but through a `ProductMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.products().get("enterpriseId", "productId") +/// .language("dolores") +/// .doit(); +/// # } +/// ``` +pub struct ProductGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _product_id: String, + _language: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProductGetCall<'a, C, A> {} + +impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Product)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "androidenterprise.products.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("productId", self._product_id.to_string())); + if let Some(value) = self._language { + params.push(("language", value.to_string())); + } + for &field in ["alt", "enterpriseId", "productId", "language"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{productId}", "productId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["productId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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) -> ProductGetCall<'a, C, A> { + self._enterprise_id = new_value.to_string(); + self + } + /// The ID of the product, e.g. "app:com.google.android.gm". + /// + /// 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) -> ProductGetCall<'a, C, A> { + self._product_id = new_value.to_string(); + self + } + /// The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). + /// + /// Sets the *language* query property to the given value. + pub fn language(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { + self._language = 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) -> ProductGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProductGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProductGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Approves the specified product and the relevant app permissions, if any. The maximum number of products that you can approve per enterprise customer is 1,000. /// -/// To learn how to use Google Play for Work to design and create a store layout to display approved products to your users, see Store Layout Design. +/// To learn how to use managed Google Play to design and create a store layout to display approved products to your users, see Store Layout Design. /// /// A builder for the *approve* method supported by a *product* resource. /// It is not used directly, but through a `ProductMethods` instance. @@ -20408,7 +19183,7 @@ impl<'a, C, A> ProductApproveCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/approve"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/approve".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20597,287 +19372,7 @@ impl<'a, C, A> ProductApproveCall<'a, C, A> where C: BorrowMut, A } -/// This method has been deprecated. To programmatically approve applications, you must use the iframe mechanism via the generateApprovalUrl and approve methods of the Products resource. For more information, see the Play EMM API usage requirements. -/// -/// The updatePermissions method (deprecated) updates the set of Android app permissions for this app that have been accepted by the enterprise. -/// -/// A builder for the *updatePermissions* method supported by a *product* resource. -/// It is not used directly, but through a `ProductMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::ProductPermissions; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = ProductPermissions::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.products().update_permissions(req, "enterpriseId", "productId") -/// .doit(); -/// # } -/// ``` -pub struct ProductUpdatePermissionCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: ProductPermissions, - _enterprise_id: String, - _product_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProductUpdatePermissionCall<'a, C, A> {} - -impl<'a, C, A> ProductUpdatePermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ProductPermissions)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.products.updatePermissions", - 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(("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}/permissions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{productId}", "productId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["productId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).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: ProductPermissions) -> ProductUpdatePermissionCall<'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) -> ProductUpdatePermissionCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the product. - /// - /// Sets the *product id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn product_id(mut self, new_value: &str) -> ProductUpdatePermissionCall<'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) -> ProductUpdatePermissionCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProductUpdatePermissionCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProductUpdatePermissionCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an administrator to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play. +/// Retrieves the schema that defines the configurable properties for this product. All products have a schema, but this schema may be empty if no managed configurations have been defined. This schema can be used to populate a UI that allows an admin to configure the product. To apply a managed configuration based on the schema obtained using this API, see Managed Configurations through Play. /// /// A builder for the *getAppRestrictionsSchema* method supported by a *product* resource. /// It is not used directly, but through a `ProductMethods` instance. @@ -20904,7 +19399,7 @@ impl<'a, C, A> ProductUpdatePermissionCall<'a, C, A> where C: BorrowMut ProductGetAppRestrictionsSchemaCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products/{productId}/appRestrictionsSchema".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -21163,10 +19658,10 @@ 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("eirmod") -/// .query("At") -/// .max_results(5) -/// .language("et") +/// .token("ea") +/// .query("et") +/// .max_results(53) +/// .language("diam") /// .approved(false) /// .doit(); /// # } @@ -21231,7 +19726,7 @@ impl<'a, C, A> ProductListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/products".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -21344,14 +19839,14 @@ impl<'a, C, A> ProductListCall<'a, C, A> where C: BorrowMut, A: o self._enterprise_id = new_value.to_string(); self } - /// A pagination token is contained in a request’s response when there are more products. The token can be used in a subsequent request to obtain more products, and so forth. This parameter cannot be used in the initial request. + /// A pagination token is contained in a request''s response when there are more products. The token can be used in a subsequent request to obtain more products, and so forth. This parameter cannot be used in the initial request. /// /// Sets the *token* query property to the given value. pub fn token(mut self, new_value: &str) -> ProductListCall<'a, C, A> { self._token = Some(new_value.to_string()); self } - /// The search query as typed in the Google Play Store search box. If omitted, all approved apps will be returned (using the pagination parameters), including apps that are not available in the store (e.g. unpublished apps). + /// The search query as typed in the Google Play store search box. If omitted, all approved apps will be returned (using the pagination parameters), including apps that are not available in the store (e.g. unpublished apps). /// /// Sets the *query* query property to the given value. pub fn query(mut self, new_value: &str) -> ProductListCall<'a, C, A> { @@ -21431,526 +19926,6 @@ impl<'a, C, A> ProductListCall<'a, C, A> where C: BorrowMut, A: o } -/// Retrieves details of a product for display to an enterprise admin. -/// -/// A builder for the *get* method supported by a *product* resource. -/// It is not used directly, but through a `ProductMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.products().get("enterpriseId", "productId") -/// .language("elitr") -/// .doit(); -/// # } -/// ``` -pub struct ProductGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _product_id: String, - _language: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProductGetCall<'a, C, A> {} - -impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Product)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.products.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("productId", self._product_id.to_string())); - if let Some(value) = self._language { - params.push(("language", value.to_string())); - } - for &field in ["alt", "enterpriseId", "productId", "language"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}"; - 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) -> ProductGetCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the product, e.g. "app:com.google.android.gm". - /// - /// 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) -> ProductGetCall<'a, C, A> { - self._product_id = new_value.to_string(); - self - } - /// The BCP47 tag for the user's preferred language (e.g. "en-US", "de"). - /// - /// Sets the *language* query property to the given value. - pub fn language(mut self, new_value: &str) -> ProductGetCall<'a, C, A> { - self._language = 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) -> ProductGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProductGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProductGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product. An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. -/// -/// Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. -/// -/// A builder for the *generateApprovalUrl* method supported by a *product* resource. -/// It is not used directly, but through a `ProductMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate 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::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.products().generate_approval_url("enterpriseId", "productId") -/// .language_code("Lorem") -/// .doit(); -/// # } -/// ``` -pub struct ProductGenerateApprovalUrlCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _product_id: String, - _language_code: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProductGenerateApprovalUrlCall<'a, C, A> {} - -impl<'a, C, A> ProductGenerateApprovalUrlCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ProductsGenerateApprovalUrlResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "androidenterprise.products.generateApprovalUrl", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("productId", self._product_id.to_string())); - if let Some(value) = self._language_code { - params.push(("languageCode", value.to_string())); - } - for &field in ["alt", "enterpriseId", "productId", "languageCode"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/products/{productId}/generateApprovalUrl"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{productId}", "productId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["productId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the product. - /// - /// Sets the *product id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn product_id(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { - self._product_id = new_value.to_string(); - self - } - /// The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US". - /// - /// Sets the *language code* query property to the given value. - pub fn language_code(mut self, new_value: &str) -> ProductGenerateApprovalUrlCall<'a, C, A> { - self._language_code = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProductGenerateApprovalUrlCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ProductGenerateApprovalUrlCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProductGenerateApprovalUrlCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Adds or updates a per-user managed configuration for an app for the specified user. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *managedconfigurationsforuser* resource. @@ -22032,7 +20007,7 @@ impl<'a, C, A> ManagedconfigurationsforuserPatchCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -22241,253 +20216,6 @@ impl<'a, C, A> ManagedconfigurationsforuserPatchCall<'a, C, A> where C: BorrowMu } -/// Lists all the per-user managed configurations for the specified user. Only the ID is set. -/// -/// A builder for the *list* method supported by a *managedconfigurationsforuser* resource. -/// It is not used directly, but through a `ManagedconfigurationsforuserMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.managedconfigurationsforuser().list("enterpriseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct ManagedconfigurationsforuserListCall<'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 ManagedconfigurationsforuserListCall<'a, C, A> {} - -impl<'a, C, A> ManagedconfigurationsforuserListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfigurationsForUserListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.managedconfigurationsforuser.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ManagedconfigurationsforuserListCall<'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) -> ManagedconfigurationsforuserListCall<'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) -> ManagedconfigurationsforuserListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsforuserListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsforuserListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Removes a per-user managed configuration for an app for the specified user. /// /// A builder for the *delete* method supported by a *managedconfigurationsforuser* resource. @@ -22561,7 +20289,7 @@ impl<'a, C, A> ManagedconfigurationsforuserDeleteCall<'a, C, A> where C: BorrowM } - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -22736,6 +20464,253 @@ impl<'a, C, A> ManagedconfigurationsforuserDeleteCall<'a, C, A> where C: BorrowM } +/// Lists all the per-user managed configurations for the specified user. Only the ID is set. +/// +/// A builder for the *list* method supported by a *managedconfigurationsforuser* resource. +/// It is not used directly, but through a `ManagedconfigurationsforuserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_androidenterprise1 as androidenterprise1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use androidenterprise1::AndroidEnterprise; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.managedconfigurationsforuser().list("enterpriseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct ManagedconfigurationsforuserListCall<'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 ManagedconfigurationsforuserListCall<'a, C, A> {} + +impl<'a, C, A> ManagedconfigurationsforuserListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ManagedConfigurationsForUserListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.managedconfigurationsforuser.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "enterpriseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["userId", "enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> ManagedconfigurationsforuserListCall<'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) -> ManagedconfigurationsforuserListCall<'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) -> ManagedconfigurationsforuserListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ManagedconfigurationsforuserListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ManagedconfigurationsforuserListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Adds or updates a per-user managed configuration for an app for the specified user. /// /// A builder for the *update* method supported by a *managedconfigurationsforuser* resource. @@ -22817,7 +20792,7 @@ impl<'a, C, A> ManagedconfigurationsforuserUpdateCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23100,7 +21075,7 @@ impl<'a, C, A> ManagedconfigurationsforuserGetCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/managedConfigurationsForUser/{managedConfigurationForUserId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23357,7 +21332,7 @@ impl<'a, C, A> GrouplicenseuserListCall<'a, C, A> where C: BorrowMut GrouplicenseuserListCall<'a, C, A> where C: BorrowMut GrouplicenseuserListCall<'a, C, A> where C: BorrowMut +pub struct EntitlementDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, _enterprise_id: String, _user_id: String, + _entitlement_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for EntitlementListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for EntitlementDeleteCall<'a, C, A> {} -impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> EntitlementDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, EntitlementsListResponse)> { + pub fn doit(mut self) -> Result { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -23587,12 +21563,13 @@ impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.entitlements.list", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "androidenterprise.entitlements.delete", + http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("enterpriseId", self._enterprise_id.to_string())); params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "enterpriseId", "userId"].iter() { + params.push(("entitlementId", self._entitlement_id.to_string())); + for &field in ["enterpriseId", "userId", "entitlementId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -23602,14 +21579,13 @@ impl<'a, C, A> EntitlementListCall<'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() + "enterprises/{enterpriseId}/users/{userId}/entitlements"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}".to_string(); 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() { + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{entitlementId}", "entitlementId")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -23620,8 +21596,8 @@ impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["userId", "enterpriseId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["entitlementId", "userId", "enterpriseId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -23654,7 +21630,7 @@ impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -23687,17 +21663,7 @@ impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, Ok(serr) => Err(Error::BadRequest(serr)) } } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; + let result_value = res; dlg.finished(true); return Ok(result_value) @@ -23713,7 +21679,7 @@ impl<'a, C, A> EntitlementListCall<'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 enterprise_id(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> EntitlementDeleteCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } @@ -23723,17 +21689,27 @@ impl<'a, C, A> EntitlementListCall<'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 user_id(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { + pub fn user_id(mut self, new_value: &str) -> EntitlementDeleteCall<'a, C, A> { self._user_id = new_value.to_string(); self } + /// The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". + /// + /// Sets the *entitlement id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn entitlement_id(mut self, new_value: &str) -> EntitlementDeleteCall<'a, C, A> { + self._entitlement_id = new_value.to_string(); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> EntitlementListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EntitlementDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -23754,7 +21730,7 @@ impl<'a, C, A> EntitlementListCall<'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) -> EntitlementListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> EntitlementDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -23771,7 +21747,7 @@ impl<'a, C, A> EntitlementListCall<'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) -> EntitlementListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> EntitlementDeleteCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -23812,7 +21788,7 @@ impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.entitlements().update(req, "enterpriseId", "userId", "entitlementId") -/// .install(true) +/// .install(false) /// .doit(); /// # } /// ``` @@ -23865,7 +21841,7 @@ impl<'a, C, A> EntitlementUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24155,7 +22131,7 @@ impl<'a, C, A> EntitlementGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24340,9 +22316,9 @@ impl<'a, C, A> EntitlementGetCall<'a, C, A> where C: BorrowMut, A } -/// Removes an entitlement to an app for a user and uninstalls it. +/// Lists all entitlements for the specified user. Only the ID is set. /// -/// A builder for the *delete* method supported by a *entitlement* resource. +/// A builder for the *list* method supported by a *entitlement* resource. /// It is not used directly, but through a `EntitlementMethods` instance. /// /// # Example @@ -24366,29 +22342,28 @@ impl<'a, C, A> EntitlementGetCall<'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.entitlements().delete("enterpriseId", "userId", "entitlementId") +/// let result = hub.entitlements().list("enterpriseId", "userId") /// .doit(); /// # } /// ``` -pub struct EntitlementDeleteCall<'a, C, A> +pub struct EntitlementListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a AndroidEnterprise, _enterprise_id: String, _user_id: String, - _entitlement_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for EntitlementDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for EntitlementListCall<'a, C, A> {} -impl<'a, C, A> EntitlementDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result { + pub fn doit(mut self) -> Result<(hyper::client::Response, EntitlementsListResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -24396,13 +22371,12 @@ impl<'a, C, A> EntitlementDeleteCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "androidenterprise.entitlements.delete", - http_method: hyper::method::Method::Delete }); + dlg.begin(MethodInfo { id: "androidenterprise.entitlements.list", + http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("enterpriseId", self._enterprise_id.to_string())); params.push(("userId", self._user_id.to_string())); - params.push(("entitlementId", self._entitlement_id.to_string())); - for &field in ["enterpriseId", "userId", "entitlementId"].iter() { + for &field in ["alt", "enterpriseId", "userId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -24412,13 +22386,14 @@ impl<'a, C, A> EntitlementDeleteCall<'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() + "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{userId}", "userId"), ("{entitlementId}", "entitlementId")].iter() { + 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 { @@ -24429,8 +22404,8 @@ impl<'a, C, A> EntitlementDeleteCall<'a, C, A> where C: BorrowMut url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(3); - for param_name in ["entitlementId", "userId", "enterpriseId"].iter() { + 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); } @@ -24463,7 +22438,7 @@ impl<'a, C, A> EntitlementDeleteCall<'a, C, A> where C: BorrowMut let auth_header = Authorization(Bearer { token: token.access_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) + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) .header(UserAgent(self.hub._user_agent.clone())) .header(auth_header.clone()); @@ -24496,7 +22471,17 @@ impl<'a, C, A> EntitlementDeleteCall<'a, C, A> where C: BorrowMut 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) @@ -24512,7 +22497,7 @@ impl<'a, C, A> EntitlementDeleteCall<'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 enterprise_id(mut self, new_value: &str) -> EntitlementDeleteCall<'a, C, A> { + pub fn enterprise_id(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { self._enterprise_id = new_value.to_string(); self } @@ -24522,27 +22507,17 @@ impl<'a, C, A> EntitlementDeleteCall<'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 user_id(mut self, new_value: &str) -> EntitlementDeleteCall<'a, C, A> { + pub fn user_id(mut self, new_value: &str) -> EntitlementListCall<'a, C, A> { self._user_id = new_value.to_string(); self } - /// The ID of the entitlement (a product ID), e.g. "app:com.google.android.gm". - /// - /// Sets the *entitlement id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn entitlement_id(mut self, new_value: &str) -> EntitlementDeleteCall<'a, C, A> { - self._entitlement_id = new_value.to_string(); - self - } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> EntitlementDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EntitlementListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -24563,7 +22538,7 @@ impl<'a, C, A> EntitlementDeleteCall<'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) -> EntitlementDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> EntitlementListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -24580,7 +22555,7 @@ impl<'a, C, A> EntitlementDeleteCall<'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) -> EntitlementDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> EntitlementListCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -24621,7 +22596,7 @@ impl<'a, C, A> EntitlementDeleteCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.entitlements().patch(req, "enterpriseId", "userId", "entitlementId") -/// .install(true) +/// .install(false) /// .doit(); /// # } /// ``` @@ -24674,7 +22649,7 @@ impl<'a, C, A> EntitlementPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/users/{userId}/entitlements/{entitlementId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24890,1781 +22865,6 @@ impl<'a, C, A> EntitlementPatchCall<'a, C, A> where C: BorrowMut, } -/// Updates a collection. This method supports patch semantics. -/// -/// A builder for the *patch* method supported by a *collection* resource. -/// It is not used directly, but through a `CollectionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::Collection; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = Collection::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.collections().patch(req, "enterpriseId", "collectionId") -/// .doit(); -/// # } -/// ``` -pub struct CollectionPatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: Collection, - _enterprise_id: String, - _collection_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CollectionPatchCall<'a, C, A> {} - -impl<'a, C, A> CollectionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Collection)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.collections.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - params.push(("collectionId", self._collection_id.to_string())); - for &field in ["alt", "enterpriseId", "collectionId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/collections/{collectionId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{collectionId}", "collectionId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["collectionId", "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: Collection) -> CollectionPatchCall<'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) -> CollectionPatchCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the collection. - /// - /// 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) -> CollectionPatchCall<'a, C, A> { - self._collection_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> CollectionPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> CollectionPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CollectionPatchCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves the IDs of all the collections for an enterprise. -/// -/// A builder for the *list* method supported by a *collection* resource. -/// It is not used directly, but through a `CollectionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.collections().list("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct CollectionListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CollectionListCall<'a, C, A> {} - -impl<'a, C, A> CollectionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, CollectionsListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.collections.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/collections"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> CollectionListCall<'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) -> CollectionListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> CollectionListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CollectionListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves the details of a collection. -/// -/// A builder for the *get* method supported by a *collection* resource. -/// It is not used directly, but through a `CollectionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.collections().get("enterpriseId", "collectionId") -/// .doit(); -/// # } -/// ``` -pub struct CollectionGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _collection_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CollectionGetCall<'a, C, A> {} - -impl<'a, C, A> CollectionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Collection)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.collections.get", - 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(("collectionId", self._collection_id.to_string())); - for &field in ["alt", "enterpriseId", "collectionId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/collections/{collectionId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{collectionId}", "collectionId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["collectionId", "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) -> CollectionGetCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the collection. - /// - /// 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) -> CollectionGetCall<'a, C, A> { - self._collection_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> CollectionGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> CollectionGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CollectionGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Deletes a collection. -/// -/// A builder for the *delete* method supported by a *collection* resource. -/// It is not used directly, but through a `CollectionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.collections().delete("enterpriseId", "collectionId") -/// .doit(); -/// # } -/// ``` -pub struct CollectionDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _collection_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CollectionDeleteCall<'a, C, A> {} - -impl<'a, C, A> CollectionDeleteCall<'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.collections.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(("collectionId", self._collection_id.to_string())); - for &field in ["enterpriseId", "collectionId"].iter() { - if self._additional_params.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}/collections/{collectionId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{collectionId}", "collectionId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["collectionId", "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) -> CollectionDeleteCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the collection. - /// - /// 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) -> CollectionDeleteCall<'a, C, A> { - self._collection_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> CollectionDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> CollectionDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CollectionDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Creates a new collection. -/// -/// A builder for the *insert* method supported by a *collection* resource. -/// It is not used directly, but through a `CollectionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::Collection; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = Collection::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.collections().insert(req, "enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct CollectionInsertCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: Collection, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CollectionInsertCall<'a, C, A> {} - -impl<'a, C, A> CollectionInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Collection)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.collections.insert", - 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}/collections"; - 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: Collection) -> CollectionInsertCall<'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) -> CollectionInsertCall<'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) -> CollectionInsertCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> CollectionInsertCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CollectionInsertCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Updates a collection. -/// -/// A builder for the *update* method supported by a *collection* resource. -/// It is not used directly, but through a `CollectionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// use androidenterprise1::Collection; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = Collection::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.collections().update(req, "enterpriseId", "collectionId") -/// .doit(); -/// # } -/// ``` -pub struct CollectionUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _request: Collection, - _enterprise_id: String, - _collection_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CollectionUpdateCall<'a, C, A> {} - -impl<'a, C, A> CollectionUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Collection)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.collections.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(("collectionId", self._collection_id.to_string())); - for &field in ["alt", "enterpriseId", "collectionId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/collections/{collectionId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId"), ("{collectionId}", "collectionId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["collectionId", "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: Collection) -> CollectionUpdateCall<'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) -> CollectionUpdateCall<'a, C, A> { - self._enterprise_id = new_value.to_string(); - self - } - /// The ID of the collection. - /// - /// 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) -> CollectionUpdateCall<'a, C, A> { - self._collection_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> CollectionUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> CollectionUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CollectionUpdateCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Lists all active credentials for the service account associated with this enterprise. Only the ID and key type are returned. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. -/// -/// A builder for the *list* method supported by a *serviceaccountkey* resource. -/// It is not used directly, but through a `ServiceaccountkeyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_androidenterprise1 as androidenterprise1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use androidenterprise1::AndroidEnterprise; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.serviceaccountkeys().list("enterpriseId") -/// .doit(); -/// # } -/// ``` -pub struct ServiceaccountkeyListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a AndroidEnterprise, - _enterprise_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ServiceaccountkeyListCall<'a, C, A> {} - -impl<'a, C, A> ServiceaccountkeyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceAccountKeysListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.serviceaccountkeys.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("enterpriseId", self._enterprise_id.to_string())); - for &field in ["alt", "enterpriseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "enterprises/{enterpriseId}/serviceAccountKeys"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["enterpriseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The ID of the enterprise. - /// - /// Sets the *enterprise id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn enterprise_id(mut self, new_value: &str) -> ServiceaccountkeyListCall<'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) -> ServiceaccountkeyListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ServiceaccountkeyListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ServiceaccountkeyListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Generates new credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. /// /// Only the type of the key should be populated in the resource to be inserted. @@ -26744,7 +22944,7 @@ impl<'a, C, A> ServiceaccountkeyInsertCall<'a, C, A> where C: BorrowMut ServiceaccountkeyInsertCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = AndroidEnterprise::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.serviceaccountkeys().list("enterpriseId") +/// .doit(); +/// # } +/// ``` +pub struct ServiceaccountkeyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a AndroidEnterprise, + _enterprise_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ServiceaccountkeyListCall<'a, C, A> {} + +impl<'a, C, A> ServiceaccountkeyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceAccountKeysListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.serviceaccountkeys.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("enterpriseId", self._enterprise_id.to_string())); + for &field in ["alt", "enterpriseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/androidenterprise/v1/enterprises/{enterpriseId}/serviceAccountKeys".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{enterpriseId}", "enterpriseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["enterpriseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the enterprise. + /// + /// Sets the *enterprise id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn enterprise_id(mut self, new_value: &str) -> ServiceaccountkeyListCall<'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) -> ServiceaccountkeyListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ServiceaccountkeyListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ServiceaccountkeyListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Removes and invalidates the specified credentials for the service account associated with this enterprise. The calling service account must have been retrieved by calling Enterprises.GetServiceAccount and must have been set as the enterprise service account by calling Enterprises.SetAccount. /// /// A builder for the *delete* method supported by a *serviceaccountkey* resource. @@ -27004,7 +23439,7 @@ impl<'a, C, A> ServiceaccountkeyDeleteCall<'a, C, A> where C: BorrowMut ServiceaccountkeyDeleteCall<'a, C, A> where C: BorrowMut PermissionGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "permissions/{permissionId}"; + let mut url = "https://www.googleapis.com/androidenterprise/v1/permissions/{permissionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -27416,3 +23851,4 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/androidpublisher2-cli/Cargo.toml b/gen/androidpublisher2-cli/Cargo.toml index 8483c85522..ad179c9f07 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.4+20161212" +version = "1.0.4+20170425" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-androidpublisher2] path = "../androidpublisher2" -version = "1.0.4+20161212" +version = "1.0.4+20170425" diff --git a/gen/androidpublisher2-cli/README.md b/gen/androidpublisher2-cli/README.md index 715dd34a49..f1b34d842d 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 *20161212*. The CLI is at version *1.0.4*. +This documentation was generated from the *Android Publisher* API at revision *20170425*. The CLI is at version *1.0.4*. ```bash androidpublisher2 [options] diff --git a/gen/androidpublisher2-cli/mkdocs.yml b/gen/androidpublisher2-cli/mkdocs.yml index af3d68fa9a..2f4438c4c4 100644 --- a/gen/androidpublisher2-cli/mkdocs.yml +++ b/gen/androidpublisher2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Android Publisher v1.0.4+20161212 +site_name: Android Publisher v1.0.4+20170425 site_url: http://byron.github.io/google-apis-rs/google-androidpublisher2-cli site_description: A complete library to interact with Android Publisher (protocol v2) diff --git a/gen/androidpublisher2-cli/src/main.rs b/gen/androidpublisher2-cli/src/main.rs index 6dab9d252d..efd1a03d6a 100644 --- a/gen/androidpublisher2-cli/src/main.rs +++ b/gen/androidpublisher2-cli/src/main.rs @@ -5915,7 +5915,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Returns a list of reviews."##), + Some(r##"Returns a list of reviews. Only reviews from last week will be returned."##), "Details at http://byron.github.io/google-apis-rs/google_androidpublisher2_cli/reviews_list", vec![ (Some(r##"package-name"##), @@ -5976,7 +5976,7 @@ fn main() { let mut app = App::new("androidpublisher2") .author("Sebastian Thiel ") - .version("1.0.4+20161212") + .version("1.0.4+20170425") .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 781738718b..18fe878dd3 100644 --- a/gen/androidpublisher2/Cargo.toml +++ b/gen/androidpublisher2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-androidpublisher2" -version = "1.0.4+20161212" +version = "1.0.4+20170425" 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.4+20161212" +documentation = "https://docs.rs/google-androidpublisher2/1.0.4+20170425" license = "MIT" keywords = ["androidpublisher", "google", "protocol", "web", "api"] diff --git a/gen/androidpublisher2/README.md b/gen/androidpublisher2/README.md index 9e438ff03c..0587500a31 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.4+20161212*, where *20161212* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Android Publisher* crate version *1.0.4+20170425*, where *20170425* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161212/google_androidpublisher2/struct.AndroidPublisher.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.AndroidPublisher.html) ... * edits - * [*apklistings delete*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditApklistingDeleteCall.html), [*apklistings deleteall*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditApklistingDeleteallCall.html), [*apklistings get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditApklistingGetCall.html), [*apklistings list*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditApklistingListCall.html), [*apklistings patch*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditApklistingPatchCall.html), [*apklistings update*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditApklistingUpdateCall.html), [*apks addexternallyhosted*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditApkAddexternallyhostedCall.html), [*apks list*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditApkListCall.html), [*apks upload*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditApkUploadCall.html), [*commit*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditCommitCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditDeleteCall.html), [*deobfuscationfiles upload*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html), [*details get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditDetailGetCall.html), [*details patch*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditDetailPatchCall.html), [*details update*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditDetailUpdateCall.html), [*expansionfiles get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditExpansionfileUploadCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditGetCall.html), [*images delete*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditImageDeleteCall.html), [*images deleteall*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditImageDeleteallCall.html), [*images list*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditImageListCall.html), [*images upload*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditImageUploadCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditInsertCall.html), [*listings delete*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditListingDeleteCall.html), [*listings deleteall*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditListingDeleteallCall.html), [*listings get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditListingGetCall.html), [*listings list*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditListingListCall.html), [*listings patch*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditListingPatchCall.html), [*listings update*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditListingUpdateCall.html), [*testers get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditTesterGetCall.html), [*testers patch*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditTesterPatchCall.html), [*testers update*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditTesterUpdateCall.html), [*tracks get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditTrackGetCall.html), [*tracks list*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditTrackListCall.html), [*tracks patch*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditTrackPatchCall.html), [*tracks update*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditTrackUpdateCall.html) and [*validate*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditValidateCall.html) -* [entitlements](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.Entitlement.html) - * [*list*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EntitlementListCall.html) + * [*apklistings delete*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditApklistingDeleteCall.html), [*apklistings deleteall*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditApklistingDeleteallCall.html), [*apklistings get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditApklistingGetCall.html), [*apklistings list*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditApklistingListCall.html), [*apklistings patch*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditApklistingPatchCall.html), [*apklistings update*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditApklistingUpdateCall.html), [*apks addexternallyhosted*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditApkAddexternallyhostedCall.html), [*apks list*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditApkListCall.html), [*apks upload*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditApkUploadCall.html), [*commit*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditCommitCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditDeleteCall.html), [*deobfuscationfiles upload*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html), [*details get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditDetailGetCall.html), [*details patch*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditDetailPatchCall.html), [*details update*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditDetailUpdateCall.html), [*expansionfiles get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditExpansionfileGetCall.html), [*expansionfiles patch*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditExpansionfilePatchCall.html), [*expansionfiles update*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditExpansionfileUpdateCall.html), [*expansionfiles upload*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditExpansionfileUploadCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditGetCall.html), [*images delete*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditImageDeleteCall.html), [*images deleteall*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditImageDeleteallCall.html), [*images list*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditImageListCall.html), [*images upload*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditImageUploadCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditInsertCall.html), [*listings delete*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditListingDeleteCall.html), [*listings deleteall*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditListingDeleteallCall.html), [*listings get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditListingGetCall.html), [*listings list*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditListingListCall.html), [*listings patch*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditListingPatchCall.html), [*listings update*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditListingUpdateCall.html), [*testers get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditTesterGetCall.html), [*testers patch*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditTesterPatchCall.html), [*testers update*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditTesterUpdateCall.html), [*tracks get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditTrackGetCall.html), [*tracks list*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditTrackListCall.html), [*tracks patch*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditTrackPatchCall.html), [*tracks update*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditTrackUpdateCall.html) and [*validate*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditValidateCall.html) +* [entitlements](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.Entitlement.html) + * [*list*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EntitlementListCall.html) * inappproducts - * [*batch*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.InappproductBatchCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.InappproductDeleteCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.InappproductGetCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.InappproductInsertCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.InappproductListCall.html), [*patch*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.InappproductPatchCall.html) and [*update*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.InappproductUpdateCall.html) + * [*batch*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.InappproductBatchCall.html), [*delete*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.InappproductDeleteCall.html), [*get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.InappproductGetCall.html), [*insert*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.InappproductInsertCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.InappproductListCall.html), [*patch*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.InappproductPatchCall.html) and [*update*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.InappproductUpdateCall.html) * purchases - * [*products get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.PurchaseProductGetCall.html), [*subscriptions cancel*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.PurchaseVoidedpurchaseListCall.html) -* [reviews](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.Review.html) - * [*get*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.ReviewGetCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.ReviewListCall.html) and [*reply*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.ReviewReplyCall.html) + * [*products get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.PurchaseProductGetCall.html), [*subscriptions cancel*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.PurchaseSubscriptionCancelCall.html), [*subscriptions defer*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.PurchaseSubscriptionDeferCall.html), [*subscriptions get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.PurchaseSubscriptionGetCall.html), [*subscriptions refund*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.PurchaseSubscriptionRefundCall.html), [*subscriptions revoke*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.PurchaseSubscriptionRevokeCall.html) and [*voidedpurchases list*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.PurchaseVoidedpurchaseListCall.html) +* [reviews](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.Review.html) + * [*get*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.ReviewGetCall.html), [*list*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.ReviewListCall.html) and [*reply*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.ReviewReplyCall.html) Upload supported by ... -* [*deobfuscationfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html) -* [*images upload edits*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditImageUploadCall.html) -* [*expansionfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditExpansionfileUploadCall.html) -* [*apks upload edits*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.EditApkUploadCall.html) +* [*deobfuscationfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditDeobfuscationfileUploadCall.html) +* [*images upload edits*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditImageUploadCall.html) +* [*expansionfiles upload edits*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditExpansionfileUploadCall.html) +* [*apks upload edits*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/struct.EditApkUploadCall.html) @@ -38,17 +38,17 @@ Upload supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/struct.AndroidPublisher.html)** +* **[Hub](https://docs.rs/google-androidpublisher2/1.0.4+20170425/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.4+20161212/google_androidpublisher2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-androidpublisher2/1.0.4+20170425/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.4+20161212/google_androidpublisher2/trait.Part.html)** + * **[Parts](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-androidpublisher2/1.0.4+20161212/google_androidpublisher2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-androidpublisher2/1.0.4+20170425/google_androidpublisher2/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-androidpublisher2/1.0.4+20161212/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.4+20170425/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.4+20161212/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.4+20170425/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.4+20161212/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.4+20170425/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.4+20161212/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.4+20170425/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")`. @@ -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-androidpublisher2/1.0.4+20161212/google_androidpublisher2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-androidpublisher2/1.0.4+20161212/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.4+20170425/google_androidpublisher2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-androidpublisher2/1.0.4+20170425/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.4+20161212/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.4+20170425/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.4+20161212/google_androidpublisher2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-androidpublisher2/1.0.4+20161212/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.4+20170425/google_androidpublisher2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-androidpublisher2/1.0.4+20170425/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.4+20161212/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.4+20170425/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.4+20161212/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.4+20170425/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.4+20161212/google_androidpublisher2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-androidpublisher2/1.0.4+20170425/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 b35743853d..5e128cf9d6 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.4+20161212*, where *20161212* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Android Publisher* crate version *1.0.4+20170425*, where *20170425* is the exact revision of the *androidpublisher:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Android Publisher* *v2* API can be found at the //! [official documentation site](https://developers.google.com/android-publisher). @@ -195,7 +195,7 @@ // 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 +// 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)] @@ -327,8 +327,6 @@ pub struct AndroidPublisher { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for AndroidPublisher {} @@ -341,8 +339,6 @@ impl<'a, C, A> AndroidPublisher client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/androidpublisher/v2/applications/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -371,26 +367,6 @@ impl<'a, C, A> AndroidPublisher self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/androidpublisher/v2/applications/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1301,7 +1277,7 @@ impl RequestValue for Testers {} impl ResponseResult for Testers {} -/// A VoidedPurchase resource indicates the purchase was either cancelled/refunded/charged-back. +/// A VoidedPurchase resource indicates a purchase that was either cancelled/refunded/charged-back. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1309,13 +1285,13 @@ impl ResponseResult for Testers {} pub struct VoidedPurchase { /// This kind represents a voided purchase object in the androidpublisher service. pub kind: Option, - /// The time when the purchase was cancelled/refunded/chargeback, in milliseconds since the epoch (Jan 1, 1970). + /// The time at which the purchase was cancelled/refunded/charged-back, in milliseconds since the epoch (Jan 1, 1970). #[serde(rename="voidedTimeMillis")] pub voided_time_millis: Option, - /// The token that was generated when a purchase was made and uniquely identifies a purchase. + /// The token that was generated when a purchase was made. This uniquely identifies a purchase. #[serde(rename="purchaseToken")] pub purchase_token: Option, - /// The time the purchase was made, in milliseconds since the epoch (Jan 1, 1970). + /// The time at which the purchase was made, in milliseconds since the epoch (Jan 1, 1970). #[serde(rename="purchaseTimeMillis")] pub purchase_time_millis: Option, } @@ -1449,6 +1425,9 @@ pub struct SubscriptionPurchase { /// Time at which the subscription was granted, in milliseconds since the Epoch. #[serde(rename="startTimeMillis")] pub start_time_millis: Option, + /// The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0. + #[serde(rename="userCancellationTimeMillis")] + pub user_cancellation_time_millis: Option, /// Price of the subscription, not including tax. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000. #[serde(rename="priceAmountMicros")] pub price_amount_micros: Option, @@ -2939,7 +2918,7 @@ impl<'a, C, A> ReviewMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of reviews. + /// Returns a list of reviews. Only reviews from last week will be returned. /// /// # Arguments /// @@ -3233,7 +3212,7 @@ impl<'a, C, A> EntitlementListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/entitlements"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/entitlements".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -3475,7 +3454,7 @@ impl<'a, C, A> PurchaseSubscriptionRevokeCall<'a, C, A> where C: BorrowMut PurchaseProductGetCall<'a, C, A> where C: BorrowMut PurchaseSubscriptionGetCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> { @@ -4401,7 +4380,7 @@ impl<'a, C, A> PurchaseVoidedpurchaseListCall<'a, C, A> where C: BorrowMut PurchaseVoidedpurchaseListCall<'a, C, A> { @@ -4533,7 +4512,7 @@ impl<'a, C, A> PurchaseSubscriptionCancelCall<'a, C, A> where C: BorrowMut PurchaseSubscriptionRefundCall<'a, C, A> where C: BorrowMut PurchaseSubscriptionDeferCall<'a, C, A> where C: BorrowMut EditDeobfuscationfileUploadCall<'a, C, A> where C: BorrowMut EditImageUploadCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", "multipart") + ("https://www.googleapis.com/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}", "resumable") + ("https://www.googleapis.com/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}".to_string(), "resumable") } else { unreachable!() }; @@ -6087,7 +6066,7 @@ impl<'a, C, A> EditExpansionfileUpdateCall<'a, C, A> where C: BorrowMut EditDetailGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/details"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/details".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6623,7 +6602,7 @@ impl<'a, C, A> EditListingDeleteallCall<'a, C, A> where C: BorrowMut EditApkAddexternallyhostedCall<'a, C, A> where C: BorrowMut EditApklistingDeleteallCall<'a, C, A> where C: BorrowMut EditDetailUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/details"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/details".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7666,7 +7645,7 @@ impl<'a, C, A> EditTrackGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/tracks/{track}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7934,7 +7913,7 @@ impl<'a, C, A> EditExpansionfilePatchCall<'a, C, A> where C: BorrowMut EditImageListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}/{imageType}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8503,7 +8482,7 @@ impl<'a, C, A> EditTrackUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/tracks/{track}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8793,7 +8772,7 @@ impl<'a, C, A> EditListingPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9074,7 +9053,7 @@ impl<'a, C, A> EditGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9326,7 +9305,7 @@ impl<'a, C, A> EditImageDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9594,9 +9573,9 @@ impl<'a, C, A> EditApkUploadCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks", "multipart") + ("https://www.googleapis.com/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks", "resumable") + ("https://www.googleapis.com/resumable/upload/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks".to_string(), "resumable") } else { unreachable!() }; @@ -9957,7 +9936,7 @@ impl<'a, C, A> EditApklistingUpdateCall<'a, C, A> where C: BorrowMut EditApkListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/apks"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10504,7 +10483,7 @@ impl<'a, C, A> EditApklistingPatchCall<'a, C, A> where C: BorrowMut EditListingGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11057,7 +11036,7 @@ impl<'a, C, A> EditApklistingDeleteCall<'a, C, A> where C: BorrowMut EditTesterGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/testers/{track}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11569,7 +11548,7 @@ impl<'a, C, A> EditDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11814,9 +11793,9 @@ impl<'a, C, A> EditExpansionfileUploadCall<'a, C, A> where C: BorrowMut EditInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12451,7 +12430,7 @@ impl<'a, C, A> EditListingListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12705,7 +12684,7 @@ impl<'a, C, A> EditTesterPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/testers/{track}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12985,7 +12964,7 @@ impl<'a, C, A> EditCommitCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}:commit"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}:commit".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13232,7 +13211,7 @@ impl<'a, C, A> EditTrackListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/tracks"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13479,7 +13458,7 @@ impl<'a, C, A> EditValidateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}:validate"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}:validate".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13735,7 +13714,7 @@ impl<'a, C, A> EditListingUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14020,7 +13999,7 @@ impl<'a, C, A> EditExpansionfileGetCall<'a, C, A> where C: BorrowMut EditImageDeleteallCall<'a, C, A> where C: BorrowMut EditDetailPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/details"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/details".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14843,7 +14822,7 @@ impl<'a, C, A> EditTrackPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/tracks/{track}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/tracks/{track}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15125,7 +15104,7 @@ impl<'a, C, A> EditListingDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/listings/{language}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/listings/{language}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15376,7 +15355,7 @@ impl<'a, C, A> EditApklistingGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/listings/{language}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15650,7 +15629,7 @@ impl<'a, C, A> EditTesterUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/edits/{editId}/testers/{track}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/edits/{editId}/testers/{track}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15932,7 +15911,7 @@ impl<'a, C, A> EditApklistingListCall<'a, C, A> where C: BorrowMut ReviewReplyCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/reviews/{reviewId}:reply"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/reviews/{reviewId}:reply".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16471,7 +16450,7 @@ impl<'a, C, A> ReviewGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/reviews/{reviewId}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/reviews/{reviewId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16651,7 +16630,7 @@ impl<'a, C, A> ReviewGetCall<'a, C, A> where C: BorrowMut, A: oau } -/// Returns a list of reviews. +/// Returns a list of reviews. Only reviews from last week will be returned. /// /// A builder for the *list* method supported by a *review* resource. /// It is not used directly, but through a `ReviewMethods` instance. @@ -16741,7 +16720,7 @@ impl<'a, C, A> ReviewListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/reviews"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/reviews".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17003,7 +16982,7 @@ impl<'a, C, A> InappproductBatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "inappproducts/batch"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/inappproducts/batch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17246,7 +17225,7 @@ impl<'a, C, A> InappproductListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/inappproducts"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/inappproducts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17511,7 +17490,7 @@ impl<'a, C, A> InappproductInsertCall<'a, C, A> where C: BorrowMut InappproductDeleteCall<'a, C, A> where C: BorrowMut InappproductGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/inappproducts/{sku}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18273,7 +18252,7 @@ impl<'a, C, A> InappproductUpdateCall<'a, C, A> where C: BorrowMut InappproductPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{packageName}/inappproducts/{sku}"; + let mut url = "https://www.googleapis.com/androidpublisher/v2/applications/{packageName}/inappproducts/{sku}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18769,3 +18748,4 @@ impl<'a, C, A> InappproductPatchCall<'a, C, A> where C: BorrowMut } + diff --git a/gen/appengine1-cli/Cargo.toml b/gen/appengine1-cli/Cargo.toml index a59cf45a6d..deca0b7dc6 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.4+20161208" +version = "1.0.4+20170522" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-appengine1] path = "../appengine1" -version = "1.0.4+20161208" +version = "1.0.4+20170522" diff --git a/gen/appengine1-cli/README.md b/gen/appengine1-cli/README.md index e5ecdce6fb..11ce669955 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 *20161208*. The CLI is at version *1.0.4*. +This documentation was generated from the *appengine* API at revision *20170522*. The CLI is at version *1.0.4*. ```bash appengine1 [options] diff --git a/gen/appengine1-cli/mkdocs.yml b/gen/appengine1-cli/mkdocs.yml index e86d404e61..ced13cd247 100644 --- a/gen/appengine1-cli/mkdocs.yml +++ b/gen/appengine1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appengine v1.0.4+20161208 +site_name: appengine v1.0.4+20170522 site_url: http://byron.github.io/google-apis-rs/google-appengine1-cli site_description: A complete library to interact with appengine (protocol v1) diff --git a/gen/appengine1-cli/src/main.rs b/gen/appengine1-cli/src/main.rs index ea9261452c..9d959f7a6e 100644 --- a/gen/appengine1-cli/src/main.rs +++ b/gen/appengine1-cli/src/main.rs @@ -74,11 +74,17 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gcr-domain" => Some(("gcrDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "id", "location-id", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "enabled", "gcr-domain", "iap", "id", "location-id", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "serving-status"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -446,11 +452,17 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "location-id" => Some(("locationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gcr-domain" => Some(("gcrDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "id", "location-id", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "enabled", "gcr-domain", "iap", "id", "location-id", "name", "oauth2-client-id", "oauth2-client-secret", "oauth2-client-secret-sha256", "serving-status"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -784,10 +796,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())))); @@ -881,18 +893,27 @@ 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 })), - "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "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 })), + "readiness-check.check-interval" => Some(("readinessCheck.checkInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "readiness-check.host" => Some(("readinessCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "readiness-check.timeout" => Some(("readinessCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "readiness-check.path" => Some(("readinessCheck.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "readiness-check.success-threshold" => Some(("readinessCheck.successThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "readiness-check.failure-threshold" => Some(("readinessCheck.failureThreshold", JsonTypeInfo { jtype: JsonType::Int, 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.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 })), @@ -900,7 +921,6 @@ impl<'n> Engine<'n> { "health-check.host" => Some(("healthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.timeout" => Some(("healthCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "default-expiration" => Some(("defaultExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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 })), @@ -909,13 +929,13 @@ impl<'n> Engine<'n> { "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 })), @@ -930,21 +950,26 @@ impl<'n> Engine<'n> { "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 })), "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 })), "deployment.zip.source-url" => Some(("deployment.zip.sourceUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "liveness-check.check-interval" => Some(("livenessCheck.checkInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "liveness-check.initial-delay" => Some(("livenessCheck.initialDelay", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "liveness-check.host" => Some(("livenessCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "liveness-check.timeout" => Some(("livenessCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "liveness-check.path" => Some(("livenessCheck.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime" => Some(("runtime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "create-time", "created-by", "default-expiration", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "files-count", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "instance-class", "instance-tag", "instances", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "request-utilization", "resources", "restart-threshold", "runtime", "script", "security-level", "serving-status", "source-url", "subnetwork-name", "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", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "create-time", "created-by", "default-expiration", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "failure-threshold", "files-count", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "initial-delay", "instance-class", "instance-tag", "instances", "liveness-check", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "path", "readiness-check", "request-utilization", "resources", "restart-threshold", "runtime", "script", "security-level", "serving-status", "source-url", "subnetwork-name", "success-threshold", "target-concurrent-requests", "target-read-bytes-per-second", "target-read-ops-per-second", "target-received-bytes-per-second", "target-received-packets-per-second", "target-request-count-per-second", "target-sent-bytes-per-second", "target-sent-packets-per-second", "target-utilization", "target-write-bytes-per-second", "target-write-ops-per-second", "threadsafe", "timeout", "unhealthy-threshold", "url", "version-url", "vm", "zip"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1447,18 +1472,27 @@ 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 })), - "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "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 })), + "readiness-check.check-interval" => Some(("readinessCheck.checkInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "readiness-check.host" => Some(("readinessCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "readiness-check.timeout" => Some(("readinessCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "readiness-check.path" => Some(("readinessCheck.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "readiness-check.success-threshold" => Some(("readinessCheck.successThreshold", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "readiness-check.failure-threshold" => Some(("readinessCheck.failureThreshold", JsonTypeInfo { jtype: JsonType::Int, 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.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 })), @@ -1466,7 +1500,6 @@ impl<'n> Engine<'n> { "health-check.host" => Some(("healthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.timeout" => Some(("healthCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "default-expiration" => Some(("defaultExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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 })), @@ -1475,13 +1508,13 @@ impl<'n> Engine<'n> { "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 })), @@ -1496,21 +1529,26 @@ impl<'n> Engine<'n> { "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 })), "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 })), "deployment.zip.source-url" => Some(("deployment.zip.sourceUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "liveness-check.check-interval" => Some(("livenessCheck.checkInterval", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "liveness-check.initial-delay" => Some(("livenessCheck.initialDelay", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "liveness-check.host" => Some(("livenessCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "liveness-check.timeout" => Some(("livenessCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "liveness-check.path" => Some(("livenessCheck.path", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "serving-status" => Some(("servingStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "runtime" => Some(("runtime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["aggregation-window-length", "api-config", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "create-time", "created-by", "default-expiration", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "files-count", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "instance-class", "instance-tag", "instances", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "request-utilization", "resources", "restart-threshold", "runtime", "script", "security-level", "serving-status", "source-url", "subnetwork-name", "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", "auth-fail-action", "automatic-scaling", "basic-scaling", "beta-settings", "check-interval", "config-id", "container", "cool-down-period", "cpu", "cpu-utilization", "create-time", "created-by", "default-expiration", "deployment", "disable-health-check", "disk-gb", "disk-usage-bytes", "disk-utilization", "endpoints-api-service", "env", "env-variables", "failure-threshold", "files-count", "forwarded-ports", "health-check", "healthy-threshold", "host", "id", "idle-timeout", "image", "inbound-services", "initial-delay", "instance-class", "instance-tag", "instances", "liveness-check", "login", "manual-scaling", "max-concurrent-requests", "max-idle-instances", "max-instances", "max-pending-latency", "max-total-instances", "memory-gb", "min-idle-instances", "min-pending-latency", "min-total-instances", "name", "network", "network-utilization", "nobuild-files-regex", "path", "readiness-check", "request-utilization", "resources", "restart-threshold", "runtime", "script", "security-level", "serving-status", "source-url", "subnetwork-name", "success-threshold", "target-concurrent-requests", "target-read-bytes-per-second", "target-read-ops-per-second", "target-received-bytes-per-second", "target-received-packets-per-second", "target-request-count-per-second", "target-sent-bytes-per-second", "target-sent-packets-per-second", "target-utilization", "target-write-bytes-per-second", "target-write-ops-per-second", "threadsafe", "timeout", "unhealthy-threshold", "url", "version-url", "vm", "zip"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1738,7 +1776,9 @@ fn main() { let arg_data = [ ("apps", "methods: 'create', 'get', 'locations-get', 'locations-list', 'operations-get', 'operations-list', 'patch', 'repair', 'services-delete', 'services-get', 'services-list', 'services-patch', 'services-versions-create', 'services-versions-delete', 'services-versions-get', 'services-versions-instances-debug', 'services-versions-instances-delete', 'services-versions-instances-get', 'services-versions-instances-list', 'services-versions-list' and 'services-versions-patch'", vec![ ("create", - Some(r##"Creates an App Engine application for a Google Cloud Platform project. This requires a project that excludes an App Engine application. For details about creating a project without an application, see the Google Cloud Resource Manager create project topic (https://cloud.google.com/resource-manager/docs/creating-project)."##), + Some(r##"Creates an App Engine application for a Google Cloud Platform project. Required fields: + id - The ID of the target Cloud Platform project. + location - 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/)."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_create", vec![ (Some(r##"kv"##), @@ -1882,7 +1922,9 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates the specified Application resource. You can update the following fields: auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps#Application.FIELDS.auth_domain) default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps#Application.FIELDS.default_cookie_expiration)"##), + Some(r##"Updates the specified Application resource. You can update the following fields: + auth_domain - Google authentication domain for controlling user access to the application. + default_cookie_expiration - Cookie expiration policy for the application."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_patch", vec![ (Some(r##"apps-id"##), @@ -2278,7 +2320,7 @@ fn main() { Some(false)), ]), ("services-versions-instances-list", - Some(r##"Lists the instances of a version."##), + Some(r##"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)."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_services-versions-instances-list", vec![ (Some(r##"apps-id"##), @@ -2340,7 +2382,11 @@ fn main() { Some(false)), ]), ("services-versions-patch", - Some(r##"Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment."##), + Some(r##"Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: + serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. + instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. + automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. + automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_cli/apps_services-versions-patch", vec![ (Some(r##"apps-id"##), @@ -2385,8 +2431,8 @@ fn main() { let mut app = App::new("appengine1") .author("Sebastian Thiel ") - .version("1.0.4+20161208") - .about("Provisions and manages App Engine applications.") + .version("1.0.4+20170522") + .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") .long("scope") diff --git a/gen/appengine1/Cargo.toml b/gen/appengine1/Cargo.toml index 72fba3ce46..cbd0cd1c63 100644 --- a/gen/appengine1/Cargo.toml +++ b/gen/appengine1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appengine1" -version = "1.0.4+20161208" +version = "1.0.4+20170522" 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.4+20161208" +documentation = "https://docs.rs/google-appengine1/1.0.4+20170522" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] diff --git a/gen/appengine1/README.md b/gen/appengine1/README.md index 294efb8ecb..1ded5fc540 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.4+20161208*, where *20161208* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *appengine* crate version *1.0.4+20170522*, where *20170522* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161208/google_appengine1/struct.Appengine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.Appengine.html) ... * apps - * [*create*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppPatchCall.html), [*repair*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppRepairCall.html), [*services delete*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/struct.AppServiceVersionPatchCall.html) + * [*create*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppPatchCall.html), [*repair*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppRepairCall.html), [*services delete*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1/1.0.4+20170522/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.4+20161208/google_appengine1/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1/1.0.4+20170522/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.4+20161208/google_appengine1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1/1.0.4+20170522/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.4+20161208/google_appengine1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appengine1/1.0.4+20161208/google_appengine1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1/1.0.4+20170522/google_appengine1/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/1.0.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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")`. @@ -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/1.0.4+20161208/google_appengine1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appengine1/1.0.4+20161208/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.4+20170522/google_appengine1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1/1.0.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/google_appengine1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appengine1/1.0.4+20161208/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.4+20170522/google_appengine1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1/1.0.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/google_appengine1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1/1.0.4+20170522/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 faa4972739..1d05dc5516 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.4+20161208*, where *20161208* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *appengine* crate version *1.0.4+20170522*, where *20170522* is the exact revision of the *appengine:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *appengine* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). @@ -186,7 +186,7 @@ // 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 +// 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)] @@ -325,8 +325,6 @@ pub struct Appengine { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Appengine {} @@ -339,8 +337,6 @@ impl<'a, C, A> Appengine client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://appengine.googleapis.com/".to_string(), - _root_url: "https://appengine.googleapis.com/".to_string(), } } @@ -357,26 +353,6 @@ impl<'a, C, A> Appengine self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://appengine.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://appengine.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -404,6 +380,35 @@ pub struct ListInstancesResponse { 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. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LivenessCheck { + /// Host header to send when performing a HTTP Liveness check. Example: "myapp.appspot.com" + pub host: Option, + /// Time before the check is considered failed. + pub timeout: Option, + /// Interval between health checks. + #[serde(rename="checkInterval")] + pub check_interval: Option, + /// The request path. + pub path: Option, + /// Number of consecutive successful checks required before considering the VM healthy. + #[serde(rename="successThreshold")] + pub success_threshold: Option, + /// The initial delay before starting to execute the checks. + #[serde(rename="initialDelay")] + pub initial_delay: Option, + /// Number of consecutive failed checks required before considering the VM unhealthy. + #[serde(rename="failureThreshold")] + pub failure_threshold: Option, +} + +impl Part for LivenessCheck {} + + /// Extra network settings. Only applicable for VM runtimes. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -418,7 +423,10 @@ pub struct Network { 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, - /// Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network. If the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range. If the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network. If the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the Flex app. + /// Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network. + /// If the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range. + /// If the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network. + /// If the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the Flex app. #[serde(rename="subnetworkName")] pub subnetwork_name: Option, } @@ -438,10 +446,10 @@ impl Part for Network {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Service { - /// Mapping that defines fractional HTTP traffic diversion to different versions within the service. - pub split: Option, /// Relative name of the service within the application. Example: default.@OutputOnly pub id: Option, + /// Mapping that defines fractional HTTP traffic diversion to different versions within the service. + pub split: Option, /// Full path to the Service resource in the API. Example: apps/myapp/services/default.@OutputOnly pub name: Option, } @@ -483,26 +491,34 @@ pub struct Application { 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.@OutputOnly + /// HTTP path dispatch rules for requests to the application that do not explicitly target a service or version. Rules are order-dependent. Up to 20 dispatch rules can be supported.@OutputOnly #[serde(rename="dispatchRules")] pub dispatch_rules: Option>, /// Cookie expiration policy for this application. #[serde(rename="defaultCookieExpiration")] pub default_cookie_expiration: Option, + /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. + pub id: Option, /// Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US #[serde(rename="locationId")] pub location_id: Option, + /// Serving status of this application. + #[serde(rename="servingStatus")] + pub serving_status: Option, /// Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. #[serde(rename="authDomain")] pub auth_domain: Option, - /// 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, } impl RequestValue for Application {} @@ -516,8 +532,8 @@ impl ResponseResult for Application {} /// This type is used in activities, which are methods you may call on this type or where 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 get apps](struct.AppServiceVersionGetCall.html) (response) /// * [services versions patch apps](struct.AppServiceVersionPatchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -525,14 +541,14 @@ pub struct Version { /// Cloud Endpoints configuration.If endpoints_api_service is set, the Cloud Endpoints Extensible Service Proxy will be provided to serve the API implemented by the app. #[serde(rename="endpointsApiService")] pub endpoints_api_service: Option, + /// Duration that static files should be cached by web proxies and browsers. Only applicable if the corresponding StaticFilesHandler (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#staticfileshandler) does not specify its own expiration time.Only returned in GET requests if view=FULL is set. + #[serde(rename="defaultExpiration")] + pub default_expiration: Option, + /// Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly + pub name: Option, /// A service with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity. #[serde(rename="basicScaling")] pub basic_scaling: Option, - /// Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly - pub name: Option, - /// Metadata settings that are supplied to this version to enable beta runtime features. - #[serde(rename="betaSettings")] - pub beta_settings: 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, @@ -544,9 +560,14 @@ pub struct Version { /// Before an application can receive email or XMPP messages, the application must be configured to enable the service. #[serde(rename="inboundServices")] pub inbound_services: Option>, - /// Instance class that is used to run this version. Valid values are: AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling. + /// Instance class that is used to run this version. Valid values are: + /// AutomaticScaling: F1, F2, F4, F4_1G + /// ManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling. #[serde(rename="instanceClass")] pub instance_class: Option, + /// Metadata settings that are supplied to this version to enable beta runtime features. + #[serde(rename="betaSettings")] + pub beta_settings: Option>, /// Email address of the user who created this version.@OutputOnly #[serde(rename="createdBy")] pub created_by: Option, @@ -555,29 +576,32 @@ pub struct Version { /// Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set. #[serde(rename="errorHandlers")] pub error_handlers: Option>, + /// Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set. + #[serde(rename="nobuildFilesRegex")] + pub nobuild_files_regex: Option, /// Current serving status of this version. Only the versions with a SERVING status create instances and can be billed.SERVING_STATUS_UNSPECIFIED is an invalid value. Defaults to SERVING. #[serde(rename="servingStatus")] pub serving_status: Option, /// Relative name of the version within the service. Example: v1. Version names can contain only lowercase letters, numbers, or hyphens. Reserved names: "default", "latest", and any name with the prefix "ah-". pub id: Option, - /// Extra network settings. Only applicable for VM runtimes. - pub network: Option, + /// Configures readiness health checking for VM instances. Unhealthy instances are not put into the backend traffic rotation.Only returned in GET requests if view=FULL is set. + #[serde(rename="readinessCheck")] + pub readiness_check: Option, + /// Whether multiple requests can be dispatched to this version at once. + pub threadsafe: Option, /// Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set. #[serde(rename="apiConfig")] pub api_config: Option, - /// Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set. - #[serde(rename="nobuildFilesRegex")] - pub nobuild_files_regex: Option, - /// Whether multiple requests can be dispatched to this version at once. - pub threadsafe: Option, + /// Configures liveness health checking for VM instances. Unhealthy instances are stopped and replaced with new instancesOnly returned in GET requests if view=FULL is set. + #[serde(rename="livenessCheck")] + pub liveness_check: Option, + /// Extra network settings. Only applicable for VM runtimes. + pub network: Option, /// An ordered list of URL-matching patterns that should be applied to incoming requests. The first matching URL handles the request and other request handlers are not attempted.Only returned in GET requests if view=FULL is set. pub handlers: Option>, /// Configures health checking for VM instances. Unhealthy instances are stopped and replaced with new instances. Only applicable for VM runtimes.Only returned in GET requests if view=FULL is set. #[serde(rename="healthCheck")] pub health_check: Option, - /// 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, /// Serving URL for this version. Example: "https://myversion-dot-myservice-dot-myapp.appspot.com"@OutputOnly #[serde(rename="versionUrl")] pub version_url: Option, @@ -604,7 +628,7 @@ impl RequestValue for Version {} impl ResponseResult for Version {} -/// The response message for LocationService.ListLocations. +/// The response message for Locations.ListLocations. /// /// # Activities /// @@ -636,7 +660,9 @@ impl ResponseResult for ListLocationsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Location { - /// Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} + /// 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")] @@ -661,7 +687,9 @@ impl ResponseResult for Location {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DebugInstanceRequest { - /// Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME] [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). + /// Public SSH key to add to the instance. Examples: + /// [USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME] + /// [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). #[serde(rename="sshKey")] pub ssh_key: Option, } @@ -707,7 +735,14 @@ pub struct Resources { 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 which 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 purpose. Batch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response. Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message. Logging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons. +/// 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. /// @@ -834,25 +869,21 @@ pub struct Volume { impl Part for Volume {} -/// Response message for Services.ListServices. +/// Code and application artifacts used to deploy a version to App 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*). -/// -/// * [services list apps](struct.AppServiceListCall.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 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, +pub struct Deployment { + /// 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. + pub files: Option>, + /// The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment. + pub container: Option, + /// The zip file for this deployment, if this is a zip deployment. + pub zip: Option, } -impl ResponseResult for ListServicesResponse {} +impl Part for Deployment {} /// Executes a script to handle the request that matches the URL pattern. @@ -869,21 +900,17 @@ pub struct ScriptHandler { impl Part for ScriptHandler {} -/// Rules to match an HTTP request and dispatch that request to a service. +/// Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlDispatchRule { - /// Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters. - pub path: Option, - /// Domain name to match against. The wildcard "*" is supported if specified before a period: "*.".Defaults to matching all domains: "*". - pub domain: Option, - /// Resource ID of a service in this application that should serve the matched request. The service must already exist. Example: default. - pub service: Option, +pub struct ContainerInfo { + /// URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" + pub image: Option, } -impl Part for UrlDispatchRule {} +impl Part for ContainerInfo {} /// Uses Google Cloud Endpoints to handle requests. @@ -930,21 +957,26 @@ pub struct HealthCheck { impl Part for HealthCheck {} -/// Code and application artifacts used to deploy a version to App Engine. +/// 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 Deployment { - /// 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. - pub files: Option>, - /// A Docker image that App Engine uses to run the version. Only applicable for instances in App Engine flexible environment. - pub container: Option, - /// The zip file for this deployment, if this is a zip deployment. - pub zip: 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, + /// 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 Deployment {} +impl Part for IdentityAwareProxy {} /// Custom static error page to be served when an error occurs. @@ -979,18 +1011,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 service. - #[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 service. + #[serde(rename="minIdleInstances")] + pub min_idle_instances: Option, /// Target scaling by request utilization. #[serde(rename="requestUtilization")] pub request_utilization: Option, @@ -1056,7 +1088,7 @@ 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//'. + /// 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. @@ -1076,7 +1108,7 @@ 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//'. + /// 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, } @@ -1111,11 +1143,11 @@ impl Part for EndpointsApiService {} /// #[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 {} @@ -1152,8 +1184,8 @@ pub struct Instance { pub vm_ip: Option, /// Average queries per second (QPS) over the last minute.@OutputOnly pub qps: Option, - /// Availability of the instance.@OutputOnly - pub availability: Option, + /// Relative name of the instance within the version. Example: instance-1.@OutputOnly + pub id: Option, /// Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly pub name: Option, /// Number of errors since this instance was started.@OutputOnly @@ -1161,8 +1193,8 @@ pub struct Instance { /// 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, - /// Relative name of the instance within the version. Example: instance-1.@OutputOnly - pub id: Option, + /// Availability of the instance.@OutputOnly + pub availability: Option, /// Average latency (ms) over the last minute.@OutputOnly #[serde(rename="averageLatency")] pub average_latency: Option, @@ -1286,17 +1318,68 @@ pub struct RequestUtilization { impl Part for RequestUtilization {} -/// Docker image that is used to start a VM container for the version you deploy. +/// Readiness checking configuration for VM instances. Unhealthy instances are removed from traffic rotation. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ContainerInfo { - /// URI to the hosted container image in a Docker repository. The URI must be fully qualified and include a tag or digest. Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" - pub image: Option, +pub struct ReadinessCheck { + /// Host header to send when performing a HTTP Readiness check. Example: "myapp.appspot.com" + pub host: Option, + /// Time before the check is considered failed. + pub timeout: Option, + /// Interval between health checks. + #[serde(rename="checkInterval")] + pub check_interval: Option, + /// The request path. + pub path: Option, + /// Number of consecutive successful checks required before receiving traffic. + #[serde(rename="successThreshold")] + pub success_threshold: Option, + /// Number of consecutive failed checks required before removing traffic. + #[serde(rename="failureThreshold")] + pub failure_threshold: Option, } -impl Part for ContainerInfo {} +impl Part for ReadinessCheck {} + + +/// 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 {} + + +/// 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 {} /// This resource represents a long-running operation that is the result of a network API call. @@ -1320,16 +1403,16 @@ impl Part for ContainerInfo {} /// #[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>, + /// 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, - /// The error result of the operation in case of failure or cancellation. - pub error: 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 {} @@ -1380,7 +1463,7 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the instances of a version. + /// 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). /// /// # Arguments /// @@ -1487,7 +1570,9 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified Application resource. You can update the following fields: auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps#Application.FIELDS.auth_domain) default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps#Application.FIELDS.default_cookie_expiration) + /// Updates the specified Application resource. You can update the following fields: + /// auth_domain - Google authentication domain for controlling user access to the application. + /// default_cookie_expiration - Cookie expiration policy for the application. /// /// # Arguments /// @@ -1530,7 +1615,11 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. + /// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: + /// serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. + /// instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. + /// automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. + /// automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. /// /// # Arguments /// @@ -1776,7 +1865,9 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates an App Engine application for a Google Cloud Platform project. This requires a project that excludes an App Engine application. For details about creating a project without an application, see the Google Cloud Resource Manager create project topic (https://cloud.google.com/resource-manager/docs/creating-project). + /// Creates an App Engine application for a Google Cloud Platform project. Required fields: + /// id - The ID of the target Cloud Platform project. + /// location - 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/). /// /// # Arguments /// @@ -1822,7 +1913,7 @@ impl<'a, C, A> AppMethods<'a, C, A> { // CallBuilders ### // ################# -/// Lists the instances of a version. +/// 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). /// /// A builder for the *services.versions.instances.list* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -1906,7 +1997,7 @@ impl<'a, C, A> AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut AppRepairCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}:repair"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}:repair".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2629,10 +2720,10 @@ impl<'a, C, A> AppRepairCall<'a, C, A> where C: BorrowMut, A: oau /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -2750,7 +2841,7 @@ impl<'a, C, A> AppServiceVersionInstanceDebugCall<'a, C, A> where C: BorrowMut AppServiceVersionInstanceDebugCall<'a, C, A> where C: BorrowMut AppServiceGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/services/{servicesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -3190,10 +3281,10 @@ impl<'a, C, A> AppServiceGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3228,7 +3319,9 @@ impl<'a, C, A> AppServiceGetCall<'a, C, A> where C: BorrowMut, A: } -/// Updates the specified Application resource. You can update the following fields: auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps#Application.FIELDS.auth_domain) default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps#Application.FIELDS.default_cookie_expiration) +/// Updates the specified Application resource. You can update the following fields: +/// auth_domain - Google authentication domain for controlling user access to the application. +/// default_cookie_expiration - Cookie expiration policy for the application. /// /// A builder for the *patch* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -3310,7 +3403,7 @@ impl<'a, C, A> AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3474,10 +3567,10 @@ impl<'a, C, A> AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3588,7 +3681,7 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3751,10 +3844,10 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3789,7 +3882,11 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< } -/// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. +/// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: +/// serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.serving_status): For Version resources that use basic scaling, manual scaling, or run in the App Engine flexible environment. +/// instance_class (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.instance_class): For Version resources that run in the App Engine standard environment. +/// automatic_scaling.min_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. +/// automatic_scaling.max_idle_instances (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#Version.FIELDS.automatic_scaling): For Version resources that use automatic scaling and run in the App Engine standard environment. /// /// A builder for the *services.versions.patch* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -3875,7 +3972,7 @@ 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 AppOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/operations/{operationsId}"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/operations/{operationsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -4601,10 +4698,10 @@ impl<'a, C, A> AppOperationGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4719,7 +4816,7 @@ impl<'a, C, A> AppServiceListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/services".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -4866,10 +4963,10 @@ impl<'a, C, A> AppServiceListCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4989,7 +5086,7 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/locations"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/locations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5143,10 +5240,10 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5257,7 +5354,7 @@ impl<'a, C, A> AppServiceVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppServiceVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppOperationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/operations"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5697,10 +5794,10 @@ impl<'a, C, A> AppOperationListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5809,7 +5906,7 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut AppLocationGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/locations/{locationsId}"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/locations/{locationsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -6215,10 +6312,10 @@ impl<'a, C, A> AppLocationGetCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6342,7 +6439,7 @@ impl<'a, C, A> AppServicePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/services/{servicesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6496,7 +6593,7 @@ impl<'a, C, A> AppServicePatchCall<'a, C, A> where C: BorrowMut, self._update_mask = Some(new_value.to_string()); self } - /// Set to true to gradually shift traffic from one version to another single version. By default, traffic is shifted immediately. For gradual traffic migration, the target version 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). + /// 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). /// /// Sets the *migrate traffic* query property to the given value. pub fn migrate_traffic(mut self, new_value: bool) -> AppServicePatchCall<'a, C, A> { @@ -6523,10 +6620,10 @@ impl<'a, C, A> AppServicePatchCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6631,7 +6728,7 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -6764,10 +6861,10 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6874,7 +6971,7 @@ impl<'a, C, A> AppServiceDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps/{appsId}/services/{servicesId}"; + let mut url = "https://appengine.googleapis.com/v1/apps/{appsId}/services/{servicesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7017,10 +7114,10 @@ impl<'a, C, A> AppServiceDeleteCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -7055,7 +7152,9 @@ impl<'a, C, A> AppServiceDeleteCall<'a, C, A> where C: BorrowMut, } -/// Creates an App Engine application for a Google Cloud Platform project. This requires a project that excludes an App Engine application. For details about creating a project without an application, see the Google Cloud Resource Manager create project topic (https://cloud.google.com/resource-manager/docs/creating-project). +/// Creates an App Engine application for a Google Cloud Platform project. Required fields: +/// id - The ID of the target Cloud Platform project. +/// location - 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/). /// /// A builder for the *create* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -7130,7 +7229,7 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/apps"; + let mut url = "https://appengine.googleapis.com/v1/apps".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7256,10 +7355,10 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -7373,7 +7472,7 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut AppServiceVersionGetCall<'a, C, A> where C: BorrowMut AppServiceVersionGetCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with appengine (protocol v1beta4)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta4-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-appengine1_beta4] path = "../appengine1_beta4" -version = "1.0.4+20161208" +version = "1.0.4+20170522" diff --git a/gen/appengine1_beta4-cli/README.md b/gen/appengine1_beta4-cli/README.md index 10e31ef357..af4e1e787a 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 *20161208*. The CLI is at version *1.0.4*. +This documentation was generated from the *appengine* API at revision *20170522*. The CLI is at version *1.0.4*. ```bash appengine1-beta4 [options] diff --git a/gen/appengine1_beta4-cli/mkdocs.yml b/gen/appengine1_beta4-cli/mkdocs.yml index 4b6001a44f..fb191e1a42 100644 --- a/gen/appengine1_beta4-cli/mkdocs.yml +++ b/gen/appengine1_beta4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appengine v1.0.4+20161208 +site_name: appengine v1.0.4+20170522 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 97e247cac3..ab60d3830d 100644 --- a/gen/appengine1_beta4-cli/src/main.rs +++ b/gen/appengine1_beta4-cli/src/main.rs @@ -74,11 +74,15 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", 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 })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "id", "location", "name"]); + 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())))); None } @@ -496,8 +500,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "split.shard-by" => Some(("split.shardBy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "split.allocations" => Some(("split.allocations", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Map })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["allocations", "id", "name", "shard-by", "split"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -589,18 +593,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "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 })), - "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "vm" => Some(("vm", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "instance-class" => Some(("instanceClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.url" => Some(("apiConfig.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.security-level" => Some(("apiConfig.securityLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.login" => Some(("apiConfig.login", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.script" => Some(("apiConfig.script", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "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 })), "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 })), @@ -608,14 +614,13 @@ impl<'n> Engine<'n> { "health-check.host" => Some(("healthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.timeout" => Some(("healthCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "default-expiration" => Some(("defaultExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "env" => Some(("env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.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-received-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSec", 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.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 })), @@ -635,12 +640,11 @@ impl<'n> Engine<'n> { "resources.disk-gb" => Some(("resources.diskGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.cpu" => Some(("resources.cpu", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.memory-gb" => Some(("resources.memoryGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inbound-services" => Some(("inboundServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "deployment.container.image" => Some(("deployment.container.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "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 })), + "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1148,18 +1152,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "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 })), - "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "vm" => Some(("vm", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "instance-class" => Some(("instanceClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.url" => Some(("apiConfig.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.security-level" => Some(("apiConfig.securityLevel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.login" => Some(("apiConfig.login", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-config.auth-fail-action" => Some(("apiConfig.authFailAction", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "api-config.script" => Some(("apiConfig.script", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "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 })), "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 })), @@ -1167,14 +1173,13 @@ impl<'n> Engine<'n> { "health-check.host" => Some(("healthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.timeout" => Some(("healthCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "default-expiration" => Some(("defaultExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "env" => Some(("env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.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-received-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSec", 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.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 })), @@ -1194,12 +1199,11 @@ impl<'n> Engine<'n> { "resources.disk-gb" => Some(("resources.diskGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.cpu" => Some(("resources.cpu", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.memory-gb" => Some(("resources.memoryGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inbound-services" => Some(("inboundServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "deployment.container.image" => Some(("deployment.container.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "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 })), + "threadsafe" => Some(("threadsafe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1412,11 +1416,15 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "id" => Some(("id", 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 })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "id", "location", "name"]); + 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())))); None } @@ -1641,7 +1649,9 @@ fn main() { let arg_data = [ ("apps", "methods: 'create', 'get', 'locations-get', 'locations-list', 'modules-delete', 'modules-get', 'modules-list', 'modules-patch', 'modules-versions-create', 'modules-versions-delete', 'modules-versions-get', 'modules-versions-instances-debug', 'modules-versions-instances-delete', 'modules-versions-instances-get', 'modules-versions-instances-list', 'modules-versions-list', 'modules-versions-patch', 'operations-get', 'operations-list' and 'patch'", vec![ ("create", - Some(r##"Creates an App Engine application for a Google Cloud Platform project. This requires a project that excludes an App Engine application. For details about creating a project without an application, see the Google Cloud Resource Manager create project topic (https://cloud.google.com/resource-manager/docs/creating-project)."##), + Some(r##"Creates an App Engine application for a Google Cloud Platform project. Required fields: + id - The ID of the target Cloud Platform project. + location - 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/)."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_beta4_cli/apps_create", vec![ (Some(r##"kv"##), @@ -2075,7 +2085,7 @@ fn main() { Some(false)), ]), ("modules-versions-instances-list", - Some(r##"Lists the instances of a version."##), + Some(r##"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)."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_beta4_cli/apps_modules-versions-instances-list", vec![ (Some(r##"apps-id"##), @@ -2137,7 +2147,11 @@ fn main() { Some(false)), ]), ("modules-versions-patch", - Some(r##"Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. instance_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. automatic_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. automatic_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."##), + Some(r##"Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: + serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. + instance_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. + automatic_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. + automatic_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."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_beta4_cli/apps_modules-versions-patch", vec![ (Some(r##"apps-id"##), @@ -2227,7 +2241,9 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates the specified Application resource. You can update the following fields: auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.auth_domain) default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.default_cookie_expiration)"##), + Some(r##"Updates the specified Application resource. You can update the following fields: + auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.auth_domain) + default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.default_cookie_expiration)"##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_beta4_cli/apps_patch", vec![ (Some(r##"apps-id"##), @@ -2260,8 +2276,8 @@ fn main() { let mut app = App::new("appengine1-beta4") .author("Sebastian Thiel ") - .version("1.0.4+20161208") - .about("Provisions and manages App Engine applications.") + .version("1.0.4+20170522") + .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") .long("scope") diff --git a/gen/appengine1_beta4/Cargo.toml b/gen/appengine1_beta4/Cargo.toml index f92e4b7b85..bfb37109a7 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.4+20161208" +version = "1.0.4+20170522" 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.4+20161208" +documentation = "https://docs.rs/google-appengine1_beta4/1.0.4+20170522" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] diff --git a/gen/appengine1_beta4/README.md b/gen/appengine1_beta4/README.md index 2aad86afa7..acb8724e7e 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.4+20161208*, where *20161208* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *appengine* crate version *1.0.4+20170522*, where *20170522* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161208/google_appengine1_beta4/struct.Appengine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.Appengine.html) ... * apps - * [*create*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppLocationListCall.html), [*modules delete*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleDeleteCall.html), [*modules get*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleGetCall.html), [*modules list*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleListCall.html), [*modules patch*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModulePatchCall.html), [*modules versions create*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleVersionCreateCall.html), [*modules versions delete*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleVersionDeleteCall.html), [*modules versions get*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleVersionGetCall.html), [*modules versions instances debug*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleVersionInstanceDebugCall.html), [*modules versions instances delete*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleVersionInstanceDeleteCall.html), [*modules versions instances get*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleVersionInstanceGetCall.html), [*modules versions instances list*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleVersionInstanceListCall.html), [*modules versions list*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleVersionListCall.html), [*modules versions patch*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppModuleVersionPatchCall.html), [*operations get*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppOperationListCall.html) and [*patch*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/struct.AppPatchCall.html) + * [*create*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppLocationListCall.html), [*modules delete*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleDeleteCall.html), [*modules get*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleGetCall.html), [*modules list*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleListCall.html), [*modules patch*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModulePatchCall.html), [*modules versions create*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleVersionCreateCall.html), [*modules versions delete*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleVersionDeleteCall.html), [*modules versions get*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleVersionGetCall.html), [*modules versions instances debug*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleVersionInstanceDebugCall.html), [*modules versions instances delete*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleVersionInstanceDeleteCall.html), [*modules versions instances get*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleVersionInstanceGetCall.html), [*modules versions instances list*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleVersionInstanceListCall.html), [*modules versions list*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleVersionListCall.html), [*modules versions patch*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppModuleVersionPatchCall.html), [*operations get*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/struct.AppOperationListCall.html) and [*patch*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/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.4+20161208/google_appengine1_beta4/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/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.4+20161208/google_appengine1_beta4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/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.4+20161208/google_appengine1_beta4/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/google_appengine1_beta4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/google_appengine1_beta4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/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. @@ -132,17 +132,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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")`. @@ -152,29 +152,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.4+20161208/google_appengine1_beta4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/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.4+20170522/google_appengine1_beta4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/google_appengine1_beta4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appengine1_beta4/1.0.4+20161208/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.4+20170522/google_appengine1_beta4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/google_appengine1_beta4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1_beta4/1.0.4+20170522/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 59dd533bec..246de84209 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.4+20161208*, where *20161208* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *appengine* crate version *1.0.4+20170522*, where *20170522* is the exact revision of the *appengine:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *appengine* *v1_beta4* API can be found at the //! [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). @@ -187,7 +187,7 @@ // 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 +// 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)] @@ -328,8 +328,6 @@ pub struct Appengine { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Appengine {} @@ -342,8 +340,6 @@ impl<'a, C, A> Appengine client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://appengine.googleapis.com/".to_string(), - _root_url: "https://appengine.googleapis.com/".to_string(), } } @@ -360,26 +356,6 @@ impl<'a, C, A> Appengine self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://appengine.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://appengine.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -426,47 +402,62 @@ pub struct Network { impl Part for Network {} -/// An Application resource contains the top-level configuration of an App Engine application. +/// An Instance resource is the computing unit that App Engine uses to automatically scale an application. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [create apps](struct.AppCreateCall.html) (request) -/// * [patch apps](struct.AppPatchCall.html) (request) -/// * [get apps](struct.AppGetCall.html) (response) +/// * [modules versions instances get apps](struct.AppModuleVersionInstanceGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Application { - /// Hostname used to reach the application, as resolved by App Engine.@OutputOnly - #[serde(rename="defaultHostname")] - pub default_hostname: Option, - /// Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly +pub struct Instance { + /// Time that this instance was started.@OutputOnly + #[serde(rename="startTimestamp")] + pub start_timestamp: Option, + /// Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmId")] + pub vm_id: Option, + /// Total memory in use (bytes).@OutputOnly + #[serde(rename="memoryUsage")] + pub memory_usage: Option, + /// The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmIp")] + pub vm_ip: Option, + /// Average queries per second (QPS) over the last minute.@OutputOnly + pub qps: Option, + /// Availability of the instance.@OutputOnly + pub availability: Option, + /// Full path to the Instance resource in the API. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.@OutputOnly pub name: Option, - /// Google Cloud Storage bucket that can be used for storing files associated with this application. This bucket is associated with the application and can be used by the gcloud deployment commands.@OutputOnly - #[serde(rename="codeBucket")] - pub code_bucket: Option, - /// Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly - #[serde(rename="defaultBucket")] - pub default_bucket: Option, - /// HTTP path dispatch rules for requests to the application that do not explicitly target a module or version. Rules are order-dependent.@OutputOnly - #[serde(rename="dispatchRules")] - pub dispatch_rules: Option>, - /// Cookie expiration policy for this application. - #[serde(rename="defaultCookieExpiration")] - pub default_cookie_expiration: Option, - /// Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US - pub location: Option, - /// Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. - #[serde(rename="authDomain")] - pub auth_domain: Option, - /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. + /// Number of errors since this instance was started.@OutputOnly + pub errors: Option, + /// Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmStatus")] + pub vm_status: Option, + /// Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmUnlocked")] + pub vm_unlocked: Option, + /// Relative name of the instance within the version. Example: instance-1.@OutputOnly pub id: Option, + /// Average latency (ms) over the last minute.@OutputOnly + #[serde(rename="averageLatency")] + pub average_latency: Option, + /// Number of requests since this instance was started.@OutputOnly + pub requests: Option, + /// Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmName")] + pub vm_name: Option, + /// App Engine release this instance is running on.@OutputOnly + #[serde(rename="appEngineRelease")] + pub app_engine_release: Option, + /// Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmZoneName")] + pub vm_zone_name: Option, } -impl RequestValue for Application {} -impl ResponseResult for Application {} +impl ResponseResult for Instance {} /// A Version resource is a specific set of source code and configuration files that are deployed into a module. @@ -482,26 +473,27 @@ impl ResponseResult for Application {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Version { + /// 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 module with basic scaling will create an instance when the application receives a request. The instance will be turned down when the app becomes idle. Basic scaling is ideal for work that is intermittent or driven by user activity. #[serde(rename="basicScaling")] pub basic_scaling: Option, - /// Metadata settings that are supplied to this version to enable beta runtime features. - #[serde(rename="betaSettings")] - pub beta_settings: Option>, - /// A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. - #[serde(rename="manualScaling")] - pub manual_scaling: Option, - /// Time that this version was created.@OutputOnly - #[serde(rename="creationTime")] - pub creation_time: Option, + /// Email address of the user who created this version.@OutputOnly + pub deployer: Option, /// Whether to deploy this version in a container on a virtual machine. pub vm: Option, /// Before an application can receive email or XMPP messages, the application must be configured to enable the service. #[serde(rename="inboundServices")] pub inbound_services: Option>, - /// Instance class that is used to run this version. Valid values are: AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling. + /// Instance class that is used to run this version. Valid values are: + /// AutomaticScaling: F1, F2, F4, F4_1G + /// ManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling. #[serde(rename="instanceClass")] pub instance_class: Option, + /// Metadata settings that are supplied to this version to enable beta runtime features. + #[serde(rename="betaSettings")] + pub beta_settings: Option>, /// Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set. pub deployment: Option, /// Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set. @@ -512,30 +504,31 @@ 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, /// Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set. #[serde(rename="apiConfig")] pub api_config: Option, /// Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set. #[serde(rename="nobuildFilesRegex")] pub nobuild_files_regex: Option, - /// 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 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, - /// 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, + /// Time that this version was created.@OutputOnly + #[serde(rename="creationTime")] + pub creation_time: Option, /// Full path to the Version resource in the API. Example: apps/myapp/modules/default/versions/v1.@OutputOnly pub name: Option, /// Configuration for third-party Python runtime libraries required by the application.Only returned in GET requests if view=FULL is set. pub libraries: Option>, - /// Email address of the user who created this version.@OutputOnly - pub deployer: Option, + /// A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. + #[serde(rename="manualScaling")] + pub manual_scaling: Option, /// App Engine execution environment to use for this version.Defaults to 1. pub env: Option, /// Automatic scaling is based on request rate, response latencies, and other application metrics. @@ -554,7 +547,7 @@ impl RequestValue for Version {} impl ResponseResult for Version {} -/// The response message for LocationService.ListLocations. +/// The response message for Locations.ListLocations. /// /// # Activities /// @@ -575,19 +568,31 @@ pub struct ListLocationsResponse { impl ResponseResult for ListLocationsResponse {} -/// Third-party Python runtime library that is required by the application. +/// A resource that represents Google Cloud Platform location. /// -/// 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 get apps](struct.AppLocationGetCall.html) (response) /// #[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 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 Library {} +impl ResponseResult for Location {} /// Request message for Instances.DebugInstance. @@ -601,7 +606,9 @@ impl Part for Library {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DebugInstanceRequest { - /// Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME] [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). + /// Public SSH key to add to the instance. Examples: + /// [USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME] + /// [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). #[serde(rename="sshKey")] pub ssh_key: Option, } @@ -632,16 +639,16 @@ impl Part for CpuUtilization {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Resources { - /// Memory (GB) needed. - #[serde(rename="memoryGb")] - pub memory_gb: Option, + /// User specified volumes. + pub volumes: Option>, /// Disk size (GB) needed. #[serde(rename="diskGb")] pub disk_gb: Option, /// Number of CPU cores needed. pub cpu: Option, - /// User specified volumes. - pub volumes: Option>, + /// Memory (GB) needed. + #[serde(rename="memoryGb")] + pub memory_gb: Option, } impl Part for Resources {} @@ -668,7 +675,14 @@ pub struct ListModulesResponse { impl ResponseResult for ListModulesResponse {} -/// 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 which 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 purpose. Batch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response. Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message. Logging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons. +/// 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. /// @@ -721,12 +735,12 @@ pub struct StaticFilesHandler { /// Whether this handler should match the request if the file referenced by the handler does not exist. #[serde(rename="requireMatchingFile")] pub require_matching_file: Option, - /// HTTP headers to use for all responses from these URLs. - #[serde(rename="httpHeaders")] - pub http_headers: Option>, /// Whether files should also be uploaded as code data. By default, files declared in static file handlers are uploaded as static data and are only served to end users; they cannot be read by the application. If enabled, uploads are charged against both your code and static data storage resource quotas. #[serde(rename="applicationReadable")] pub application_readable: Option, + /// HTTP headers to use for all responses from these URLs. + #[serde(rename="httpHeaders")] + pub http_headers: Option>, } impl Part for StaticFilesHandler {} @@ -744,12 +758,12 @@ pub struct NetworkUtilization { /// Target bytes sent per second. #[serde(rename="targetSentBytesPerSec")] pub target_sent_bytes_per_sec: Option, - /// Target packets sent per second. - #[serde(rename="targetSentPacketsPerSec")] - pub target_sent_packets_per_sec: Option, /// Target packets received per second. #[serde(rename="targetReceivedPacketsPerSec")] pub target_received_packets_per_sec: Option, + /// Target packets sent per second. + #[serde(rename="targetSentPacketsPerSec")] + pub target_sent_packets_per_sec: Option, } impl Part for NetworkUtilization {} @@ -806,7 +820,7 @@ pub struct Deployment { /// 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. #[serde(rename="sourceReferences")] pub source_references: Option>, - /// A Docker image that App Engine uses the run the version. Only applicable for instances in App Engine flexible environment. + /// The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment. pub container: Option, } @@ -827,21 +841,17 @@ pub struct ScriptHandler { impl Part for ScriptHandler {} -/// Rules to match an HTTP request and dispatch that request to a module. +/// Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UrlDispatchRule { - /// Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters. - pub path: Option, - /// Domain name to match against. The wildcard "*" is supported if specified before a period: "*.".Defaults to matching all domains: "*". - pub domain: Option, - /// Resource ID of a module in this application that should serve the matched request. The module must already exist. Example: default. - pub module: Option, +pub struct ContainerInfo { + /// URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" + pub image: Option, } -impl Part for UrlDispatchRule {} +impl Part for ContainerInfo {} /// Uses Google Cloud Endpoints to handle requests. @@ -935,6 +945,28 @@ pub struct StaticDirectoryHandler { impl Part for StaticDirectoryHandler {} +/// 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, + /// 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. @@ -1027,7 +1059,7 @@ 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//'. + /// 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. @@ -1049,72 +1081,59 @@ impl Part for FileInfo {} /// #[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 {} -/// An Instance resource is the computing unit that App Engine uses to automatically scale an application. +/// An Application resource contains the top-level configuration of an App Engine application. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [modules versions instances get apps](struct.AppModuleVersionInstanceGetCall.html) (response) +/// * [create apps](struct.AppCreateCall.html) (request) +/// * [patch apps](struct.AppPatchCall.html) (request) +/// * [get apps](struct.AppGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Instance { - /// App Engine release this instance is running on.@OutputOnly - #[serde(rename="appEngineRelease")] - pub app_engine_release: Option, - /// Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmId")] - pub vm_id: Option, - /// Total memory in use (bytes).@OutputOnly - #[serde(rename="memoryUsage")] - pub memory_usage: Option, - /// The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmIp")] - pub vm_ip: Option, - /// Average queries per second (QPS) over the last minute.@OutputOnly - pub qps: Option, - /// Availability of the instance.@OutputOnly - pub availability: Option, - /// Full path to the Instance resource in the API. Example: apps/myapp/modules/default/versions/v1/instances/instance-1.@OutputOnly +pub struct Application { + /// Hostname used to reach the application, as resolved by App Engine.@OutputOnly + #[serde(rename="defaultHostname")] + pub default_hostname: Option, + /// Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly pub name: Option, - /// Number of errors since this instance was started.@OutputOnly - pub errors: Option, - /// Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmStatus")] - pub vm_status: Option, - /// Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmUnlocked")] - pub vm_unlocked: Option, - /// Relative name of the instance within the version. Example: instance-1.@OutputOnly + /// Google Cloud Storage bucket that can be used for storing files associated with this application. This bucket is associated with the application and can be used by the gcloud deployment commands.@OutputOnly + #[serde(rename="codeBucket")] + pub code_bucket: Option, + /// Google Cloud Storage bucket that can be used by this application to store content.@OutputOnly + #[serde(rename="defaultBucket")] + pub default_bucket: Option, + /// HTTP path dispatch rules for requests to the application that do not explicitly target a module or version. Rules are order-dependent.@OutputOnly + #[serde(rename="dispatchRules")] + pub dispatch_rules: Option>, + /// Cookie expiration policy for this application. + #[serde(rename="defaultCookieExpiration")] + pub default_cookie_expiration: Option, + /// no description provided + pub iap: Option, + /// Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US + pub location: Option, + /// Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. + #[serde(rename="authDomain")] + pub auth_domain: Option, + /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. pub id: Option, - /// Average latency (ms) over the last minute.@OutputOnly - #[serde(rename="averageLatency")] - pub average_latency: Option, - /// Number of requests since this instance was started.@OutputOnly - pub requests: Option, - /// Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmName")] - pub vm_name: Option, - /// Time that this instance was started.@OutputOnly - #[serde(rename="startTimestamp")] - pub start_timestamp: Option, - /// Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmZoneName")] - pub vm_zone_name: Option, } -impl ResponseResult for Instance {} +impl RequestValue for Application {} +impl ResponseResult for Application {} /// A module with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. @@ -1130,17 +1149,21 @@ pub struct ManualScaling { impl Part for ManualScaling {} -/// Docker image that is used to start a VM container for the version you deploy. +/// Rules to match an HTTP request and dispatch that request to a module. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ContainerInfo { - /// URI to the hosted container image in a Docker repository. The URI must be fully qualified and include a tag or digest. Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" - pub image: Option, +pub struct UrlDispatchRule { + /// Pathname within the host. Must start with a "/". A single "*" can be included at the end of the path. The sum of the lengths of the domain and path may not exceed 100 characters. + pub path: Option, + /// Domain name to match against. The wildcard "*" is supported if specified before a period: "*.".Defaults to matching all domains: "*". + pub domain: Option, + /// Resource ID of a module in this application that should serve the matched request. The module must already exist. Example: default. + pub module: Option, } -impl Part for ContainerInfo {} +impl Part for UrlDispatchRule {} /// Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/) configuration for API handlers. @@ -1154,11 +1177,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, } @@ -1166,28 +1189,19 @@ pub struct ApiConfigHandler { impl Part for ApiConfigHandler {} -/// 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. +/// Third-party Python runtime library that is required by the application. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [modules get apps](struct.AppModuleGetCall.html) (response) -/// * [modules patch apps](struct.AppModulePatchCall.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 Module { - /// Mapping that defines fractional HTTP traffic diversion to different versions within the module. - pub split: Option, - /// Relative name of the module within the application. Example: default.@OutputOnly - pub id: Option, - /// Full path to the Module resource in the API. Example: apps/myapp/modules/default.@OutputOnly +pub struct Library { + /// Version of the library to select, or "latest". + pub version: Option, + /// Name of the library. Example: "django". pub name: Option, } -impl RequestValue for Module {} -impl ResponseResult for Module {} +impl Part for Library {} /// Reference to a particular snapshot of the source tree used to build and deploy the application. @@ -1262,6 +1276,30 @@ pub struct TrafficSplit { impl Part for TrafficSplit {} +/// 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. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [modules get apps](struct.AppModuleGetCall.html) (response) +/// * [modules patch apps](struct.AppModulePatchCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Module { + /// Relative name of the module within the application. Example: default.@OutputOnly + pub id: Option, + /// Full path to the Module resource in the API. Example: apps/myapp/modules/default.@OutputOnly + pub name: Option, + /// Mapping that defines fractional HTTP traffic diversion to different versions within the module. + pub split: Option, +} + +impl RequestValue for Module {} +impl ResponseResult for Module {} + + /// This resource represents a long-running operation that is the result of a network API call. /// /// # Activities @@ -1282,44 +1320,19 @@ impl Part for TrafficSplit {} /// #[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>, + /// 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, - /// The error result of the operation in case of failure or cancellation. - pub error: Option, -} - -impl ResponseResult for Operation {} - - -/// 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 apps](struct.AppLocationGetCall.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. + /// 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 Location {} +impl ResponseResult for Operation {} @@ -1451,7 +1464,9 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates an App Engine application for a Google Cloud Platform project. This requires a project that excludes an App Engine application. For details about creating a project without an application, see the Google Cloud Resource Manager create project topic (https://cloud.google.com/resource-manager/docs/creating-project). + /// Creates an App Engine application for a Google Cloud Platform project. Required fields: + /// id - The ID of the target Cloud Platform project. + /// location - 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/). /// /// # Arguments /// @@ -1468,7 +1483,7 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the instances of a version. + /// 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). /// /// # Arguments /// @@ -1576,7 +1591,9 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified Application resource. You can update the following fields: auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.auth_domain) default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.default_cookie_expiration) + /// Updates the specified Application resource. You can update the following fields: + /// auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.auth_domain) + /// default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.default_cookie_expiration) /// /// # Arguments /// @@ -1654,7 +1671,11 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. instance_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. automatic_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. automatic_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. + /// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: + /// serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. + /// instance_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. + /// automatic_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. + /// automatic_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. /// /// # Arguments /// @@ -1880,7 +1901,7 @@ impl<'a, C, A> AppModulePatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/modules/{modulesId}"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/modules/{modulesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2027,7 +2048,7 @@ impl<'a, C, A> AppModulePatchCall<'a, C, A> where C: BorrowMut, A self._modules_id = new_value.to_string(); self } - /// Set to true to gradually shift traffic from one version to another single version. By default, traffic is shifted immediately. For gradual traffic migration, the target version 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). + /// 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). /// /// Sets the *migrate traffic* query property to the given value. pub fn migrate_traffic(mut self, new_value: bool) -> AppModulePatchCall<'a, C, A> { @@ -2061,10 +2082,10 @@ impl<'a, C, A> AppModulePatchCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -2171,7 +2192,7 @@ impl<'a, C, A> AppModuleGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/modules/{modulesId}"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/modules/{modulesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -2314,10 +2335,10 @@ impl<'a, C, A> AppModuleGetCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -2428,7 +2449,7 @@ impl<'a, C, A> AppModuleVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppModuleVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppModuleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/modules"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/modules".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -2856,10 +2877,10 @@ impl<'a, C, A> AppModuleListCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -2894,7 +2915,9 @@ impl<'a, C, A> AppModuleListCall<'a, C, A> where C: BorrowMut, A: } -/// Creates an App Engine application for a Google Cloud Platform project. This requires a project that excludes an App Engine application. For details about creating a project without an application, see the Google Cloud Resource Manager create project topic (https://cloud.google.com/resource-manager/docs/creating-project). +/// Creates an App Engine application for a Google Cloud Platform project. Required fields: +/// id - The ID of the target Cloud Platform project. +/// location - 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/). /// /// A builder for the *create* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -2969,7 +2992,7 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3095,10 +3118,10 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3133,7 +3156,7 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau } -/// Lists the instances of a version. +/// 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). /// /// A builder for the *modules.versions.instances.list* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -3217,7 +3240,7 @@ impl<'a, C, A> AppModuleVersionInstanceListCall<'a, C, A> where C: BorrowMut AppModuleVersionInstanceListCall<'a, C, A> where C: BorrowMut AppModuleVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut AppModuleVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut AppModuleVersionInstanceDebugCall<'a, C, A> where C: BorrowMut AppModuleVersionInstanceDebugCall<'a, C, A> where C: BorrowMut AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4222,10 +4245,10 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4332,7 +4355,7 @@ impl<'a, C, A> AppModuleDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/modules/{modulesId}"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/modules/{modulesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4475,10 +4498,10 @@ impl<'a, C, A> AppModuleDeleteCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4513,7 +4536,9 @@ impl<'a, C, A> AppModuleDeleteCall<'a, C, A> where C: BorrowMut, } -/// Updates the specified Application resource. You can update the following fields: auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.auth_domain) default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.default_cookie_expiration) +/// Updates the specified Application resource. You can update the following fields: +/// auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.auth_domain) +/// default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta4/apps#Application.FIELDS.default_cookie_expiration) /// /// A builder for the *patch* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -4595,7 +4620,7 @@ impl<'a, C, A> AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4759,10 +4784,10 @@ impl<'a, C, A> AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4869,7 +4894,7 @@ impl<'a, C, A> AppOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/operations/{operationsId}"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/operations/{operationsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5012,10 +5037,10 @@ impl<'a, C, A> AppOperationGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5122,7 +5147,7 @@ impl<'a, C, A> AppLocationGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/locations/{locationsId}"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/locations/{locationsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5265,10 +5290,10 @@ impl<'a, C, A> AppLocationGetCall<'a, C, A> where C: BorrowMut, A /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5388,7 +5413,7 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/locations"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/locations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5542,10 +5567,10 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5580,7 +5605,11 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, } -/// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. instance_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. automatic_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. automatic_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. +/// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: +/// serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. +/// instance_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. +/// automatic_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. +/// automatic_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. /// /// A builder for the *modules.versions.patch* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -5666,7 +5695,7 @@ impl<'a, C, A> AppModuleVersionPatchCall<'a, C, A> where C: BorrowMut AppModuleVersionPatchCall<'a, C, A> where C: BorrowMut AppOperationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta4/apps/{appsId}/operations"; + let mut url = "https://appengine.googleapis.com/v1beta4/apps/{appsId}/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -6127,10 +6156,10 @@ impl<'a, C, A> AppOperationListCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6239,7 +6268,7 @@ impl<'a, C, A> AppModuleVersionDeleteCall<'a, C, A> where C: BorrowMut AppModuleVersionDeleteCall<'a, C, A> where C: BorrowMut AppModuleVersionCreateCall<'a, C, A> where C: BorrowMut AppModuleVersionCreateCall<'a, C, A> where C: BorrowMut AppModuleVersionGetCall<'a, C, A> where C: BorrowMut AppModuleVersionGetCall<'a, C, A> where C: BorrowMut AppModuleVersionListCall<'a, C, A> where C: BorrowMut AppModuleVersionListCall<'a, C, A> where C: BorrowMut AppModuleVersionListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with appengine (protocol v1beta5)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appengine1_beta5-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-appengine1_beta5] path = "../appengine1_beta5" -version = "1.0.4+20161208" +version = "1.0.4+20170522" diff --git a/gen/appengine1_beta5-cli/README.md b/gen/appengine1_beta5-cli/README.md index 4abe9b7b16..2a9d64739f 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 *20161208*. The CLI is at version *1.0.4*. +This documentation was generated from the *appengine* API at revision *20170522*. The CLI is at version *1.0.4*. ```bash appengine1-beta5 [options] diff --git a/gen/appengine1_beta5-cli/mkdocs.yml b/gen/appengine1_beta5-cli/mkdocs.yml index 772df30689..071329ea1d 100644 --- a/gen/appengine1_beta5-cli/mkdocs.yml +++ b/gen/appengine1_beta5-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appengine v1.0.4+20161208 +site_name: appengine v1.0.4+20170522 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 7246bc740e..c76fe44d42 100644 --- a/gen/appengine1_beta5-cli/src/main.rs +++ b/gen/appengine1_beta5-cli/src/main.rs @@ -74,11 +74,15 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "id", "location", "name"]); + 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())))); None } @@ -450,11 +454,15 @@ impl<'n> Engine<'n> { "code-bucket" => Some(("codeBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-bucket" => Some(("defaultBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-cookie-expiration" => Some(("defaultCookieExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.oauth2-client-id" => Some(("iap.oauth2ClientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.enabled" => Some(("iap.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "iap.oauth2-client-secret" => Some(("iap.oauth2ClientSecret", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "iap.oauth2-client-secret-sha256" => Some(("iap.oauth2ClientSecretSha256", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "auth-domain" => Some(("authDomain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["auth-domain", "code-bucket", "default-bucket", "default-cookie-expiration", "default-hostname", "id", "location", "name"]); + 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())))); None } @@ -706,8 +714,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "split.shard-by" => Some(("split.shardBy", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "split.allocations" => Some(("split.allocations", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Map })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["allocations", "id", "name", "shard-by", "split"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -801,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 })), - "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "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 })), @@ -812,7 +820,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 })), @@ -820,22 +831,21 @@ impl<'n> Engine<'n> { "health-check.host" => Some(("healthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.timeout" => Some(("healthCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "default-expiration" => Some(("defaultExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "env" => Some(("env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-usage-bytes" => Some(("diskUsageBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.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-received-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetSentPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.network-utilization.target-received-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetReadBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetReadOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-concurrent-requests" => Some(("automaticScaling.requestUtilization.targetConcurrentRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-request-count-per-sec" => Some(("automaticScaling.requestUtilization.targetRequestCountPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.cool-down-period" => Some(("automaticScaling.coolDownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -848,13 +858,11 @@ impl<'n> Engine<'n> { "resources.disk-gb" => Some(("resources.diskGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.cpu" => Some(("resources.cpu", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.memory-gb" => Some(("resources.memoryGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inbound-services" => Some(("inboundServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "deployment.container.image" => Some(("deployment.container.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "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 })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1364,9 +1372,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 })), - "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "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 })), @@ -1375,7 +1383,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 })), @@ -1383,22 +1394,21 @@ impl<'n> Engine<'n> { "health-check.host" => Some(("healthCheck.host", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.timeout" => Some(("healthCheck.timeout", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "health-check.disable-health-check" => Some(("healthCheck.disableHealthCheck", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "default-expiration" => Some(("defaultExpiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "env" => Some(("env", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "disk-usage-bytes" => Some(("diskUsageBytes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.min-pending-latency" => Some(("automaticScaling.minPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "automatic-scaling.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-received-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.network-utilization.target-sent-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetSentPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.network-utilization.target-received-packets-per-sec" => Some(("automaticScaling.networkUtilization.targetReceivedPacketsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetReadBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-read-ops-per-sec" => Some(("automaticScaling.diskUtilization.targetReadOpsPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.disk-utilization.target-write-bytes-per-sec" => Some(("automaticScaling.diskUtilization.targetWriteBytesPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.max-pending-latency" => Some(("automaticScaling.maxPendingLatency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "automatic-scaling.max-idle-instances" => Some(("automaticScaling.maxIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "automatic-scaling.min-idle-instances" => Some(("automaticScaling.minIdleInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-concurrent-requests" => Some(("automaticScaling.requestUtilization.targetConcurrentRequests", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.request-utilization.target-request-count-per-sec" => Some(("automaticScaling.requestUtilization.targetRequestCountPerSec", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "automatic-scaling.cool-down-period" => Some(("automaticScaling.coolDownPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1411,13 +1421,11 @@ impl<'n> Engine<'n> { "resources.disk-gb" => Some(("resources.diskGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.cpu" => Some(("resources.cpu", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "resources.memory-gb" => Some(("resources.memoryGb", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "manual-scaling.instances" => Some(("manualScaling.instances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "deployer" => Some(("deployer", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "inbound-services" => Some(("inboundServices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "beta-settings" => Some(("betaSettings", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "deployment.container.image" => Some(("deployment.container.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "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 })), "nobuild-files-regex" => Some(("nobuildFilesRegex", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1649,7 +1657,9 @@ fn main() { let arg_data = [ ("apps", "methods: 'create', 'get', 'locations-get', 'locations-list', 'operations-get', 'operations-list', 'patch', '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![ ("create", - Some(r##"Creates an App Engine application for a Google Cloud Platform project. This requires a project that excludes an App Engine application. For details about creating a project without an application, see the Google Cloud Resource Manager create project topic (https://cloud.google.com/resource-manager/docs/creating-project)."##), + Some(r##"Creates an App Engine application for a Google Cloud Platform project. Required fields: + id - The ID of the target Cloud Platform project. + location - 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/)."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_beta5_cli/apps_create", vec![ (Some(r##"kv"##), @@ -1793,7 +1803,9 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates the specified Application resource. You can update the following fields: auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.auth_domain) default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.default_cookie_expiration)"##), + Some(r##"Updates the specified Application resource. You can update the following fields: + auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.auth_domain) + default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.default_cookie_expiration)"##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_beta5_cli/apps_patch", vec![ (Some(r##"apps-id"##), @@ -2161,7 +2173,7 @@ fn main() { Some(false)), ]), ("services-versions-instances-list", - Some(r##"Lists the instances of a version."##), + Some(r##"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)."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_beta5_cli/apps_services-versions-instances-list", vec![ (Some(r##"apps-id"##), @@ -2223,7 +2235,11 @@ fn main() { Some(false)), ]), ("services-versions-patch", - Some(r##"Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. instance_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. automatic_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. automatic_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."##), + Some(r##"Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: + serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. + instance_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. + automatic_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. + automatic_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."##), "Details at http://byron.github.io/google-apis-rs/google_appengine1_beta5_cli/apps_services-versions-patch", vec![ (Some(r##"apps-id"##), @@ -2268,8 +2284,8 @@ fn main() { let mut app = App::new("appengine1-beta5") .author("Sebastian Thiel ") - .version("1.0.4+20161208") - .about("Provisions and manages App Engine applications.") + .version("1.0.4+20170522") + .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") .long("scope") diff --git a/gen/appengine1_beta5/Cargo.toml b/gen/appengine1_beta5/Cargo.toml index 1c4c20a2a4..2ecdeb2b93 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.4+20161208" +version = "1.0.4+20170522" 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.4+20161208" +documentation = "https://docs.rs/google-appengine1_beta5/1.0.4+20170522" license = "MIT" keywords = ["appengine", "google", "protocol", "web", "api"] diff --git a/gen/appengine1_beta5/README.md b/gen/appengine1_beta5/README.md index 580d7cf095..116f3b82dc 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.4+20161208*, where *20161208* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *appengine* crate version *1.0.4+20170522*, where *20170522* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161208/google_appengine1_beta5/struct.Appengine.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.Appengine.html) ... * apps - * [*create*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppPatchCall.html), [*services delete*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/struct.AppServiceVersionPatchCall.html) + * [*create*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppCreateCall.html), [*get*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppGetCall.html), [*locations get*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppLocationGetCall.html), [*locations list*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppLocationListCall.html), [*operations get*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppOperationGetCall.html), [*operations list*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppOperationListCall.html), [*patch*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppPatchCall.html), [*services delete*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceDeleteCall.html), [*services get*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceGetCall.html), [*services list*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceListCall.html), [*services patch*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServicePatchCall.html), [*services versions create*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceVersionCreateCall.html), [*services versions delete*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceVersionDeleteCall.html), [*services versions get*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceVersionGetCall.html), [*services versions instances debug*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceVersionInstanceDebugCall.html), [*services versions instances delete*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceVersionInstanceDeleteCall.html), [*services versions instances get*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceVersionInstanceGetCall.html), [*services versions instances list*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceVersionInstanceListCall.html), [*services versions list*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/struct.AppServiceVersionListCall.html) and [*services versions patch*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/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.4+20161208/google_appengine1_beta5/struct.Appengine.html)** +* **[Hub](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/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.4+20161208/google_appengine1_beta5/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/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.4+20161208/google_appengine1_beta5/trait.Part.html)** + * **[Parts](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/google_appengine1_beta5/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/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. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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")`. @@ -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-appengine1_beta5/1.0.4+20161208/google_appengine1_beta5/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/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.4+20170522/google_appengine1_beta5/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/google_appengine1_beta5/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appengine1_beta5/1.0.4+20161208/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.4+20170522/google_appengine1_beta5/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/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.4+20170522/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.4+20161208/google_appengine1_beta5/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appengine1_beta5/1.0.4+20170522/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 04fdfe1b10..9c8d121a75 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.4+20161208*, where *20161208* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *appengine* crate version *1.0.4+20170522*, where *20170522* is the exact revision of the *appengine:v1beta5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *appengine* *v1_beta5* API can be found at the //! [official documentation site](https://cloud.google.com/appengine/docs/admin-api/). @@ -185,7 +185,7 @@ // 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 +// 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)] @@ -324,8 +324,6 @@ pub struct Appengine { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Appengine {} @@ -338,8 +336,6 @@ impl<'a, C, A> Appengine client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://appengine.googleapis.com/".to_string(), - _root_url: "https://appengine.googleapis.com/".to_string(), } } @@ -356,26 +352,6 @@ impl<'a, C, A> Appengine self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://appengine.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://appengine.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -417,7 +393,10 @@ pub struct Network { 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, - /// Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network. If the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range. If the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network. If the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the Flex app. + /// Google Cloud Platform sub-network where the virtual machines are created. Specify the short name, not the resource path.If a subnetwork name is specified, a network name will also be required unless it is for the default network. + /// If the network the VM instance is being created in is a Legacy network, then the IP address is allocated from the IPv4Range. + /// If the network the VM instance is being created in is an auto Subnet Mode Network, then only network name should be specified (not the subnetwork_name) and the IP address is created from the IPCidrRange of the subnetwork that exists in that zone for that network. + /// If the network the VM instance is being created in is a custom Subnet Mode Network, then the subnetwork_name must be specified and the IP address is created from the IPCidrRange of the subnetwork.If specified, the subnetwork must exist in the same region as the Flex app. #[serde(rename="subnetworkName")] pub subnetwork_name: Option, } @@ -437,59 +416,74 @@ impl Part for Network {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Service { - /// Mapping that defines fractional HTTP traffic diversion to different versions within the service. - pub split: Option, /// Relative name of the service within the application. Example: default.@OutputOnly pub id: Option, /// Full path to the Service resource in the API. Example: apps/myapp/services/default.@OutputOnly pub name: Option, + /// Mapping that defines fractional HTTP traffic diversion to different versions within the service. + pub split: Option, } impl RequestValue for Service {} impl ResponseResult for Service {} -/// An Application resource contains the top-level configuration of an App Engine application. +/// An Instance resource is the computing unit that App Engine uses to automatically scale an application. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [create apps](struct.AppCreateCall.html) (request) -/// * [patch apps](struct.AppPatchCall.html) (request) -/// * [get apps](struct.AppGetCall.html) (response) +/// * [services versions instances get apps](struct.AppServiceVersionInstanceGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Application { - /// Hostname used to reach the application, as resolved by App Engine.@OutputOnly - #[serde(rename="defaultHostname")] - pub default_hostname: Option, - /// Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly +pub struct Instance { + /// Time that this instance was started.@OutputOnly + #[serde(rename="startTimestamp")] + pub start_timestamp: Option, + /// Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmId")] + pub vm_id: Option, + /// Total memory in use (bytes).@OutputOnly + #[serde(rename="memoryUsage")] + pub memory_usage: Option, + /// The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmIp")] + pub vm_ip: Option, + /// Average queries per second (QPS) over the last minute.@OutputOnly + pub qps: Option, + /// Availability of the instance.@OutputOnly + pub availability: Option, + /// Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly pub name: Option, - /// A 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, - /// A Google Cloud Storage bucket that can be used by the 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.@OutputOnly - #[serde(rename="dispatchRules")] - pub dispatch_rules: Option>, - /// Cookie expiration policy for this application. - #[serde(rename="defaultCookieExpiration")] - pub default_cookie_expiration: Option, - /// Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US - pub location: Option, - /// Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. - #[serde(rename="authDomain")] - pub auth_domain: Option, - /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. + /// Number of errors since this instance was started.@OutputOnly + pub errors: Option, + /// Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmStatus")] + pub vm_status: Option, + /// Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmUnlocked")] + pub vm_unlocked: Option, + /// Relative name of the instance within the version. Example: instance-1.@OutputOnly pub id: Option, + /// Average latency (ms) over the last minute.@OutputOnly + #[serde(rename="averageLatency")] + pub average_latency: Option, + /// Number of requests since this instance was started.@OutputOnly + pub requests: Option, + /// Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmName")] + pub vm_name: Option, + /// App Engine release this instance is running on.@OutputOnly + #[serde(rename="appEngineRelease")] + pub app_engine_release: Option, + /// Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly + #[serde(rename="vmZoneName")] + pub vm_zone_name: Option, } -impl RequestValue for Application {} -impl ResponseResult for Application {} +impl ResponseResult for Instance {} /// A Version resource is a specific set of source code and configuration files that are deployed into a service. @@ -508,26 +502,27 @@ 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, - /// Metadata settings that are supplied to this version to enable beta runtime features. - #[serde(rename="betaSettings")] - pub beta_settings: 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, - /// Time that this version was created.@OutputOnly - #[serde(rename="creationTime")] - pub creation_time: Option, + /// Email address of the user who created this version.@OutputOnly + pub deployer: Option, /// Whether to deploy this version in a container on a virtual machine. pub vm: Option, /// Before an application can receive email or XMPP messages, the application must be configured to enable the service. #[serde(rename="inboundServices")] pub inbound_services: Option>, - /// Instance class that is used to run this version. Valid values are: AutomaticScaling: F1, F2, F4, F4_1G ManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling. + /// Instance class that is used to run this version. Valid values are: + /// AutomaticScaling: F1, F2, F4, F4_1G + /// ManualScaling or BasicScaling: B1, B2, B4, B8, B4_1GDefaults to F1 for AutomaticScaling and B1 for ManualScaling or BasicScaling. #[serde(rename="instanceClass")] pub instance_class: Option, + /// Metadata settings that are supplied to this version to enable beta runtime features. + #[serde(rename="betaSettings")] + pub beta_settings: Option>, /// Code and application artifacts that make up this version.Only returned in GET requests if view=FULL is set. pub deployment: Option, /// Custom static error pages. Limited to 10KB per page.Only returned in GET requests if view=FULL is set. @@ -538,30 +533,31 @@ 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, /// Serving configuration for Google Cloud Endpoints (https://cloud.google.com/appengine/docs/python/endpoints/).Only returned in GET requests if view=FULL is set. #[serde(rename="apiConfig")] pub api_config: Option, /// Files that match this pattern will not be built into this version. Only applicable for Go runtimes.Only returned in GET requests if view=FULL is set. #[serde(rename="nobuildFilesRegex")] pub nobuild_files_regex: Option, - /// 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. #[serde(rename="healthCheck")] pub health_check: 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, + /// Time that this version was created.@OutputOnly + #[serde(rename="creationTime")] + pub creation_time: Option, /// Full path to the Version resource in the API. Example: apps/myapp/services/default/versions/v1.@OutputOnly pub name: Option, /// Configuration for third-party Python runtime libraries required by the application.Only returned in GET requests if view=FULL is set. pub libraries: Option>, - /// Email address of the user who created this version.@OutputOnly - pub deployer: 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, /// App Engine execution environment to use for this version.Defaults to 1. pub env: Option, /// Total size of version files hosted on App Engine disk in bytes.@OutputOnly @@ -583,7 +579,7 @@ impl RequestValue for Version {} impl ResponseResult for Version {} -/// The response message for LocationService.ListLocations. +/// The response message for Locations.ListLocations. /// /// # Activities /// @@ -615,7 +611,9 @@ impl ResponseResult for ListLocationsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Location { - /// Cross-service attributes for the location. For example {"cloud.googleapis.com/region": "us-east1"} + /// 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")] @@ -640,7 +638,9 @@ impl ResponseResult for Location {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DebugInstanceRequest { - /// Public SSH key to add to the instance. Examples: [USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME] [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). + /// Public SSH key to add to the instance. Examples: + /// [USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME] + /// [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). #[serde(rename="sshKey")] pub ssh_key: Option, } @@ -671,22 +671,29 @@ 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 {} -/// 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 which 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 purpose. Batch operations. If a client uses batch request and batch response, the Status message should be used directly inside batch response, one for each error sub-response. Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the Status message. Logging. If some API errors are stored in logs, the message Status could be used directly after any stripping needed for security/privacy reasons. +/// 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. /// @@ -762,12 +769,12 @@ pub struct NetworkUtilization { /// Target bytes sent per second. #[serde(rename="targetSentBytesPerSec")] pub target_sent_bytes_per_sec: Option, - /// Target packets sent per second. - #[serde(rename="targetSentPacketsPerSec")] - pub target_sent_packets_per_sec: Option, /// Target packets received per second. #[serde(rename="targetReceivedPacketsPerSec")] pub target_received_packets_per_sec: Option, + /// Target packets sent per second. + #[serde(rename="targetSentPacketsPerSec")] + pub target_sent_packets_per_sec: Option, } impl Part for NetworkUtilization {} @@ -824,7 +831,7 @@ pub struct Deployment { /// 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. #[serde(rename="sourceReferences")] pub source_references: Option>, - /// A Docker image that App Engine uses the run the version. Only applicable for instances in App Engine flexible environment. + /// The Docker image for the container that runs the version. Only applicable for instances running in the App Engine flexible environment. pub container: Option, } @@ -906,6 +913,28 @@ pub struct HealthCheck { impl Part for HealthCheck {} +/// 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, + /// 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 {} + + /// 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. @@ -938,18 +967,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, @@ -1015,7 +1044,7 @@ 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//'. + /// 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. @@ -1053,72 +1082,59 @@ impl Part for EndpointsApiService {} /// #[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 {} -/// An Instance resource is the computing unit that App Engine uses to automatically scale an application. +/// An Application resource contains the top-level configuration of an App Engine application. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [services versions instances get apps](struct.AppServiceVersionInstanceGetCall.html) (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 Instance { - /// App Engine release this instance is running on.@OutputOnly - #[serde(rename="appEngineRelease")] - pub app_engine_release: Option, - /// Virtual machine ID of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmId")] - pub vm_id: Option, - /// Total memory in use (bytes).@OutputOnly - #[serde(rename="memoryUsage")] - pub memory_usage: Option, - /// The IP address of this instance. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmIp")] - pub vm_ip: Option, - /// Average queries per second (QPS) over the last minute.@OutputOnly - pub qps: Option, - /// Availability of the instance.@OutputOnly - pub availability: Option, - /// Full path to the Instance resource in the API. Example: apps/myapp/services/default/versions/v1/instances/instance-1.@OutputOnly +pub struct Application { + /// Hostname used to reach the application, as resolved by App Engine.@OutputOnly + #[serde(rename="defaultHostname")] + pub default_hostname: Option, + /// Full path to the Application resource in the API. Example: apps/myapp.@OutputOnly pub name: Option, - /// Number of errors since this instance was started.@OutputOnly - pub errors: Option, - /// Status of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmStatus")] - pub vm_status: Option, - /// Whether this instance is in debug mode. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmUnlocked")] - pub vm_unlocked: Option, - /// Relative name of the instance within the version. Example: instance-1.@OutputOnly + /// A 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, + /// A Google Cloud Storage bucket that can be used by the 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.@OutputOnly + #[serde(rename="dispatchRules")] + pub dispatch_rules: Option>, + /// Cookie expiration policy for this application. + #[serde(rename="defaultCookieExpiration")] + pub default_cookie_expiration: Option, + /// Identifier of the Application resource. This identifier is equivalent to the project ID of the Google Cloud Platform project where you want to deploy your application. Example: myapp. pub id: Option, - /// Average latency (ms) over the last minute.@OutputOnly - #[serde(rename="averageLatency")] - pub average_latency: Option, - /// Number of requests since this instance was started.@OutputOnly - pub requests: Option, - /// Name of the virtual machine where this instance lives. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmName")] - pub vm_name: Option, - /// Time that this instance was started.@OutputOnly - #[serde(rename="startTimestamp")] - pub start_timestamp: Option, - /// Zone where the virtual machine is located. Only applicable for instances in App Engine flexible environment.@OutputOnly - #[serde(rename="vmZoneName")] - pub vm_zone_name: Option, + /// Location from which this application will be run. Application instances will run out of data centers in the chosen location, which is also where all of the application's end user content is stored.Defaults to us-central.Options are:us-central - Central USeurope-west - Western Europeus-east1 - Eastern US + pub location: Option, + /// Google Apps authentication domain that controls which users can access this application.Defaults to open access for any Google Account. + #[serde(rename="authDomain")] + pub auth_domain: Option, + /// no description provided + pub iap: Option, } -impl ResponseResult for Instance {} +impl RequestValue for Application {} +impl ResponseResult for Application {} /// A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. @@ -1134,13 +1150,13 @@ pub struct ManualScaling { impl Part for ManualScaling {} -/// Docker image that is used to start a VM container for the version you deploy. +/// Docker image that is used to create a container and start a VM instance for the version that you deploy. Only applicable for instances running in the App Engine flexible environment. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ContainerInfo { - /// URI to the hosted container image in a Docker repository. 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" + /// URI to the hosted container image in Google Container Registry. The URI must be fully qualified and include a tag or digest. Examples: "gcr.io/my-project/image:tag" or "gcr.io/my-project/image@digest" pub image: Option, } @@ -1298,16 +1314,16 @@ impl Part for TrafficSplit {} /// #[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>, + /// 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, - /// The error result of the operation in case of failure or cancellation. - pub error: 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 {} @@ -1358,7 +1374,7 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the instances of a version. + /// 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). /// /// # Arguments /// @@ -1402,7 +1418,9 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified Application resource. You can update the following fields: auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.auth_domain) default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.default_cookie_expiration) + /// Updates the specified Application resource. You can update the following fields: + /// auth_domain (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.auth_domain) + /// default_cookie_expiration (https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1beta5/apps#Application.FIELDS.default_cookie_expiration) /// /// # Arguments /// @@ -1489,7 +1507,11 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. instance_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. automatic_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. automatic_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. + /// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: + /// serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. + /// instance_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. + /// automatic_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. + /// automatic_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. /// /// # Arguments /// @@ -1736,7 +1758,9 @@ impl<'a, C, A> AppMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates an App Engine application for a Google Cloud Platform project. This requires a project that excludes an App Engine application. For details about creating a project without an application, see the Google Cloud Resource Manager create project topic (https://cloud.google.com/resource-manager/docs/creating-project). + /// Creates an App Engine application for a Google Cloud Platform project. Required fields: + /// id - The ID of the target Cloud Platform project. + /// location - 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/). /// /// # Arguments /// @@ -1782,7 +1806,7 @@ impl<'a, C, A> AppMethods<'a, C, A> { // CallBuilders ### // ################# -/// Lists the instances of a version. +/// 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). /// /// A builder for the *services.versions.instances.list* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -1866,7 +1890,7 @@ impl<'a, C, A> AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut AppServiceVersionInstanceListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionInstanceListCall<'a, C, A> @@ -2150,7 +2174,7 @@ impl<'a, C, A> AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionCreateCall<'a, C, A> @@ -2355,7 +2379,9 @@ impl<'a, C, A> AppServiceVersionCreateCall<'a, C, A> where C: BorrowMut AppPatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2606,12 +2632,12 @@ impl<'a, C, A> AppPatchCall<'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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppPatchCall<'a, C, A> @@ -2722,7 +2748,7 @@ impl<'a, C, A> AppServiceVersionInstanceDebugCall<'a, C, A> where C: BorrowMut AppServiceVersionInstanceDebugCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionInstanceDebugCall<'a, C, A> @@ -3019,7 +3045,7 @@ impl<'a, C, A> AppServiceGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/services/{servicesId}"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -3167,12 +3193,12 @@ impl<'a, C, A> AppServiceGetCall<'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) -> AppServiceGetCall<'a, C, A> @@ -3276,7 +3302,7 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}/versions/{versionsId}/instances/{instancesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3444,12 +3470,12 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'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) -> AppServiceVersionInstanceDeleteCall<'a, C, A> @@ -3477,7 +3503,11 @@ impl<'a, C, A> AppServiceVersionInstanceDeleteCall<'a, C, A> where C: BorrowMut< } -/// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. instance_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. automatic_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. automatic_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. +/// Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses: +/// serving_status (https://cloud.google.com/appengine/docs/admin-api/reference/rest/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. +/// instance_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. +/// automatic_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. +/// automatic_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. /// /// A builder for the *services.versions.patch* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -3563,7 +3593,7 @@ impl<'a, C, A> AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut AppServiceVersionPatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionPatchCall<'a, C, A> @@ -3872,7 +3902,7 @@ impl<'a, C, A> AppServiceVersionListCall<'a, C, A> where C: BorrowMut AppServiceVersionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionListCall<'a, C, A> @@ -4146,7 +4176,7 @@ impl<'a, C, A> AppOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/operations/{operationsId}"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/operations/{operationsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -4294,12 +4324,12 @@ impl<'a, C, A> AppOperationGetCall<'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) -> AppOperationGetCall<'a, C, A> @@ -4407,7 +4437,7 @@ impl<'a, C, A> AppServiceListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/services"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/services".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -4559,12 +4589,12 @@ impl<'a, C, A> AppServiceListCall<'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) -> AppServiceListCall<'a, C, A> @@ -4677,7 +4707,7 @@ impl<'a, C, A> AppLocationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/locations"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/locations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -4836,12 +4866,12 @@ impl<'a, C, A> AppLocationListCall<'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) -> AppLocationListCall<'a, C, A> @@ -4945,7 +4975,7 @@ impl<'a, C, A> AppServiceVersionInstanceGetCall<'a, C, A> where C: BorrowMut AppServiceVersionInstanceGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionInstanceGetCall<'a, C, A> @@ -5231,7 +5261,7 @@ impl<'a, C, A> AppOperationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/operations"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5390,12 +5420,12 @@ impl<'a, C, A> AppOperationListCall<'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) -> AppOperationListCall<'a, C, A> @@ -5497,7 +5527,7 @@ impl<'a, C, A> AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut AppServiceVersionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionDeleteCall<'a, C, A> @@ -5760,7 +5790,7 @@ impl<'a, C, A> AppLocationGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/locations/{locationsId}"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/locations/{locationsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Admin.as_ref().to_string(), ()); } @@ -5908,12 +5938,12 @@ impl<'a, C, A> AppLocationGetCall<'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) -> AppLocationGetCall<'a, C, A> @@ -6030,7 +6060,7 @@ impl<'a, C, A> AppServicePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/services/{servicesId}"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6177,7 +6207,7 @@ impl<'a, C, A> AppServicePatchCall<'a, C, A> where C: BorrowMut, self._services_id = new_value.to_string(); self } - /// Set to true to gradually shift traffic from one version to another single version. By default, traffic is shifted immediately. For gradual traffic migration, the target version 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). + /// 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). /// /// Sets the *migrate traffic* query property to the given value. pub fn migrate_traffic(mut self, new_value: bool) -> AppServicePatchCall<'a, C, A> { @@ -6216,12 +6246,12 @@ impl<'a, C, A> AppServicePatchCall<'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) -> AppServicePatchCall<'a, C, A> @@ -6324,7 +6354,7 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6469,12 +6499,12 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> AppGetCall<'a, C, A> @@ -6574,7 +6604,7 @@ impl<'a, C, A> AppServiceDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps/{appsId}/services/{servicesId}"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps/{appsId}/services/{servicesId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6722,12 +6752,12 @@ impl<'a, C, A> AppServiceDeleteCall<'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) -> AppServiceDeleteCall<'a, C, A> @@ -6755,7 +6785,9 @@ impl<'a, C, A> AppServiceDeleteCall<'a, C, A> where C: BorrowMut, } -/// Creates an App Engine application for a Google Cloud Platform project. This requires a project that excludes an App Engine application. For details about creating a project without an application, see the Google Cloud Resource Manager create project topic (https://cloud.google.com/resource-manager/docs/creating-project). +/// Creates an App Engine application for a Google Cloud Platform project. Required fields: +/// id - The ID of the target Cloud Platform project. +/// location - 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/). /// /// A builder for the *create* method supported by a *app* resource. /// It is not used directly, but through a `AppMethods` instance. @@ -6830,7 +6862,7 @@ impl<'a, C, A> AppCreateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta5/apps"; + let mut url = "https://appengine.googleapis.com/v1beta5/apps".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6961,12 +6993,12 @@ impl<'a, C, A> AppCreateCall<'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) -> AppCreateCall<'a, C, A> @@ -7073,7 +7105,7 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut AppServiceVersionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AppServiceVersionGetCall<'a, C, A> @@ -7271,3 +7303,4 @@ impl<'a, C, A> AppServiceVersionGetCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with appsactivity (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/appsactivity1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-appsactivity1] path = "../appsactivity1" -version = "1.0.4+20161202" +version = "1.0.4+20170215" diff --git a/gen/appsactivity1-cli/README.md b/gen/appsactivity1-cli/README.md index 54f3d436d6..64f0c22186 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 *20161202*. The CLI is at version *1.0.4*. +This documentation was generated from the *appsactivity* API at revision *20170215*. The CLI is at version *1.0.4*. ```bash appsactivity1 [options] diff --git a/gen/appsactivity1-cli/mkdocs.yml b/gen/appsactivity1-cli/mkdocs.yml index 018ba16346..c694d5f4e9 100644 --- a/gen/appsactivity1-cli/mkdocs.yml +++ b/gen/appsactivity1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: appsactivity v1.0.4+20161202 +site_name: appsactivity v1.0.4+20170215 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 912a45f51f..6e12b94700 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.4+20161202") + .version("1.0.4+20170215") .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 086627b3cf..f4427789df 100644 --- a/gen/appsactivity1/Cargo.toml +++ b/gen/appsactivity1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appsactivity1" -version = "1.0.4+20161202" +version = "1.0.4+20170215" 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.4+20161202" +documentation = "https://docs.rs/google-appsactivity1/1.0.4+20170215" license = "MIT" keywords = ["appsactivity", "google", "protocol", "web", "api"] diff --git a/gen/appsactivity1/README.md b/gen/appsactivity1/README.md index 1f3461ca10..9bb8ba9ae6 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.4+20161202*, where *20161202* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *appsactivity* crate version *1.0.4+20170215*, where *20170215* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161202/google_appsactivity1/struct.Appsactivity.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appsactivity1/1.0.4+20170215/google_appsactivity1/struct.Appsactivity.html) ... -* [activities](https://docs.rs/google-appsactivity1/1.0.4+20161202/google_appsactivity1/struct.Activity.html) - * [*list*](https://docs.rs/google-appsactivity1/1.0.4+20161202/google_appsactivity1/struct.ActivityListCall.html) +* [activities](https://docs.rs/google-appsactivity1/1.0.4+20170215/google_appsactivity1/struct.Activity.html) + * [*list*](https://docs.rs/google-appsactivity1/1.0.4+20170215/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.4+20161202/google_appsactivity1/struct.Appsactivity.html)** +* **[Hub](https://docs.rs/google-appsactivity1/1.0.4+20170215/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.4+20161202/google_appsactivity1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appsactivity1/1.0.4+20161202/google_appsactivity1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appsactivity1/1.0.4+20161202/google_appsactivity1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appsactivity1/1.0.4+20170215/google_appsactivity1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appsactivity1/1.0.4+20170215/google_appsactivity1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appsactivity1/1.0.4+20170215/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.4+20161202/google_appsactivity1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appsactivity1/1.0.4+20170215/google_appsactivity1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appsactivity1/1.0.4+20161202/google_appsactivity1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appsactivity1/1.0.4+20170215/google_appsactivity1/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-appsactivity1/1.0.4+20161202/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.4+20170215/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.4+20161202/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.4+20170215/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.4+20161202/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.4+20170215/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.4+20161202/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.4+20170215/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")`. @@ -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-appsactivity1/1.0.4+20161202/google_appsactivity1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appsactivity1/1.0.4+20161202/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.4+20170215/google_appsactivity1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appsactivity1/1.0.4+20170215/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.4+20161202/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.4+20170215/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.4+20161202/google_appsactivity1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appsactivity1/1.0.4+20161202/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.4+20170215/google_appsactivity1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appsactivity1/1.0.4+20170215/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.4+20161202/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.4+20170215/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.4+20161202/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.4+20170215/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.4+20161202/google_appsactivity1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appsactivity1/1.0.4+20170215/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 b1efcc8d0b..5d2bf59419 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.4+20161202*, where *20161202* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *appsactivity* crate version *1.0.4+20170215*, where *20170215* is the exact revision of the *appsactivity:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *appsactivity* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/activity/). @@ -177,7 +177,7 @@ // 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 +// 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)] @@ -225,7 +225,7 @@ pub enum Scope { /// View and manage the files in your Google Drive Drive, - /// View the activity history of your Google Apps + /// View the activity history of your Google apps Activity, /// View and manage metadata of files in your Google Drive @@ -325,8 +325,6 @@ pub struct Appsactivity { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Appsactivity {} @@ -339,8 +337,6 @@ impl<'a, C, A> Appsactivity client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/appsactivity/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -357,26 +353,6 @@ impl<'a, C, A> Appsactivity self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/appsactivity/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -780,7 +756,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activities"; + let mut url = "https://www.googleapis.com/appsactivity/v1/activities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DriveMetadataReadonly.as_ref().to_string(), ()); } @@ -964,3 +940,4 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/appstate1-cli/Cargo.toml b/gen/appstate1-cli/Cargo.toml index f35ab592ff..ca77ffe92a 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.4+20161207" +version = "1.0.4+20170511" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-appstate1] path = "../appstate1" -version = "1.0.4+20161207" +version = "1.0.4+20170511" diff --git a/gen/appstate1-cli/README.md b/gen/appstate1-cli/README.md index b899159465..a8bc371333 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 *20161207*. The CLI is at version *1.0.4*. +This documentation was generated from the *App State* API at revision *20170511*. The CLI is at version *1.0.4*. ```bash appstate1 [options] diff --git a/gen/appstate1-cli/mkdocs.yml b/gen/appstate1-cli/mkdocs.yml index 8fac27dd30..44a909385f 100644 --- a/gen/appstate1-cli/mkdocs.yml +++ b/gen/appstate1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: App State v1.0.4+20161207 +site_name: App State v1.0.4+20170511 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 69cc1d5111..25a362f9a8 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.4+20161207") + .version("1.0.4+20170511") .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 623e42da6c..4fbec4499a 100644 --- a/gen/appstate1/Cargo.toml +++ b/gen/appstate1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-appstate1" -version = "1.0.4+20161207" +version = "1.0.4+20170511" 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.4+20161207" +documentation = "https://docs.rs/google-appstate1/1.0.4+20170511" license = "MIT" keywords = ["appstate", "google", "protocol", "web", "api"] diff --git a/gen/appstate1/README.md b/gen/appstate1/README.md index f63378b026..556388f8d1 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.4+20161207*, where *20161207* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *App State* crate version *1.0.4+20170511*, where *20170511* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161207/google_appstate1/struct.AppState.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-appstate1/1.0.4+20170511/google_appstate1/struct.AppState.html) ... * states - * [*clear*](https://docs.rs/google-appstate1/1.0.4+20161207/google_appstate1/struct.StateClearCall.html), [*delete*](https://docs.rs/google-appstate1/1.0.4+20161207/google_appstate1/struct.StateDeleteCall.html), [*get*](https://docs.rs/google-appstate1/1.0.4+20161207/google_appstate1/struct.StateGetCall.html), [*list*](https://docs.rs/google-appstate1/1.0.4+20161207/google_appstate1/struct.StateListCall.html) and [*update*](https://docs.rs/google-appstate1/1.0.4+20161207/google_appstate1/struct.StateUpdateCall.html) + * [*clear*](https://docs.rs/google-appstate1/1.0.4+20170511/google_appstate1/struct.StateClearCall.html), [*delete*](https://docs.rs/google-appstate1/1.0.4+20170511/google_appstate1/struct.StateDeleteCall.html), [*get*](https://docs.rs/google-appstate1/1.0.4+20170511/google_appstate1/struct.StateGetCall.html), [*list*](https://docs.rs/google-appstate1/1.0.4+20170511/google_appstate1/struct.StateListCall.html) and [*update*](https://docs.rs/google-appstate1/1.0.4+20170511/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.4+20161207/google_appstate1/struct.AppState.html)** +* **[Hub](https://docs.rs/google-appstate1/1.0.4+20170511/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.4+20161207/google_appstate1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-appstate1/1.0.4+20161207/google_appstate1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-appstate1/1.0.4+20161207/google_appstate1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-appstate1/1.0.4+20170511/google_appstate1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-appstate1/1.0.4+20170511/google_appstate1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-appstate1/1.0.4+20170511/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.4+20161207/google_appstate1/trait.Part.html)** + * **[Parts](https://docs.rs/google-appstate1/1.0.4+20170511/google_appstate1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-appstate1/1.0.4+20161207/google_appstate1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-appstate1/1.0.4+20170511/google_appstate1/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-appstate1/1.0.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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")`. @@ -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-appstate1/1.0.4+20161207/google_appstate1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-appstate1/1.0.4+20161207/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.4+20170511/google_appstate1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-appstate1/1.0.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/google_appstate1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-appstate1/1.0.4+20161207/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.4+20170511/google_appstate1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-appstate1/1.0.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/google_appstate1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-appstate1/1.0.4+20170511/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 b3c2cf33d6..81abef866e 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.4+20161207*, where *20161207* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *App State* crate version *1.0.4+20170511*, where *20170511* is the exact revision of the *appstate:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! 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). @@ -178,7 +178,7 @@ // 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 +// 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)] @@ -310,8 +310,6 @@ pub struct AppState { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for AppState {} @@ -324,8 +322,6 @@ impl<'a, C, A> AppState client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/appstate/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -342,26 +338,6 @@ impl<'a, C, A> AppState self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/appstate/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -668,7 +644,7 @@ impl<'a, C, A> StateDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "states/{stateKey}"; + let mut url = "https://www.googleapis.com/appstate/v1/states/{stateKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -893,7 +869,7 @@ impl<'a, C, A> StateGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "states/{stateKey}"; + let mut url = "https://www.googleapis.com/appstate/v1/states/{stateKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1133,7 +1109,7 @@ impl<'a, C, A> StateClearCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "states/{stateKey}/clear"; + let mut url = "https://www.googleapis.com/appstate/v1/states/{stateKey}/clear".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1378,7 +1354,7 @@ impl<'a, C, A> StateListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "states"; + let mut url = "https://www.googleapis.com/appstate/v1/states".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1601,7 +1577,7 @@ impl<'a, C, A> StateUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "states/{stateKey}"; + let mut url = "https://www.googleapis.com/appstate/v1/states/{stateKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1797,3 +1773,4 @@ impl<'a, C, A> StateUpdateCall<'a, C, A> where C: BorrowMut, A: o } + diff --git a/gen/autoscaler1_beta2-cli/Cargo.toml b/gen/autoscaler1_beta2-cli/Cargo.toml index 803395c2ab..f97576c550 100644 --- a/gen/autoscaler1_beta2-cli/Cargo.toml +++ b/gen/autoscaler1_beta2-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/autoscaler1_beta2/src/lib.rs b/gen/autoscaler1_beta2/src/lib.rs index ffaf6eaddc..242e4b3560 100644 --- a/gen/autoscaler1_beta2/src/lib.rs +++ b/gen/autoscaler1_beta2/src/lib.rs @@ -182,7 +182,7 @@ // 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 +// 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)] @@ -314,8 +314,6 @@ pub struct AutoscalerHub { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for AutoscalerHub {} @@ -328,8 +326,6 @@ impl<'a, C, A> AutoscalerHub client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/autoscaler/v1beta2/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -352,26 +348,6 @@ impl<'a, C, A> AutoscalerHub self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/autoscaler/v1beta2/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1233,7 +1209,7 @@ impl<'a, C, A> ZoneListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones"; + let mut url = "https://www.googleapis.com/autoscaler/v1beta2/{project}/zones".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -1502,7 +1478,7 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations"; + let mut url = "https://www.googleapis.com/autoscaler/v1beta2/{project}/zones/{zone}/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -1766,7 +1742,7 @@ impl<'a, C, A> ZoneOperationDeleteCall<'a, C, A> where C: BorrowMut ZoneOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations/{operation}"; + let mut url = "https://www.googleapis.com/autoscaler/v1beta2/{project}/zones/{zone}/operations/{operation}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -2281,7 +2257,7 @@ impl<'a, C, A> AutoscalerListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers"; + let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -2555,7 +2531,7 @@ impl<'a, C, A> AutoscalerUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers/{autoscaler}"; + let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers/{autoscaler}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Compute.as_ref().to_string(), ()); } @@ -2845,7 +2821,7 @@ impl<'a, C, A> AutoscalerPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers/{autoscaler}"; + let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers/{autoscaler}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Compute.as_ref().to_string(), ()); } @@ -3128,7 +3104,7 @@ impl<'a, C, A> AutoscalerDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers/{autoscaler}"; + let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers/{autoscaler}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Compute.as_ref().to_string(), ()); } @@ -3392,7 +3368,7 @@ impl<'a, C, A> AutoscalerInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers"; + let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Compute.as_ref().to_string(), ()); } @@ -3665,7 +3641,7 @@ impl<'a, C, A> AutoscalerGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/zones/{zone}/autoscalers/{autoscaler}"; + let mut url = "https://www.googleapis.com/autoscaler/v1beta2/projects/{project}/zones/{zone}/autoscalers/{autoscaler}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -3850,3 +3826,4 @@ impl<'a, C, A> AutoscalerGetCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/bigquery2-cli/Cargo.toml b/gen/bigquery2-cli/Cargo.toml index b038f9e4b4..35e35356f0 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.4+20161130" +version = "1.0.4+20170511" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-bigquery2] path = "../bigquery2" -version = "1.0.4+20161130" +version = "1.0.4+20170511" diff --git a/gen/bigquery2-cli/README.md b/gen/bigquery2-cli/README.md index b0247c17c0..9daa68823e 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 *20161130*. The CLI is at version *1.0.4*. +This documentation was generated from the *bigquery* API at revision *20170511*. The CLI is at version *1.0.4*. ```bash bigquery2 [options] diff --git a/gen/bigquery2-cli/mkdocs.yml b/gen/bigquery2-cli/mkdocs.yml index 9c01700c35..64a8cc529d 100644 --- a/gen/bigquery2-cli/mkdocs.yml +++ b/gen/bigquery2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: bigquery v1.0.4+20161130 +site_name: bigquery v1.0.4+20170511 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 5af610e5e4..da7ef2565d 100644 --- a/gen/bigquery2-cli/src/main.rs +++ b/gen/bigquery2-cli/src/main.rs @@ -1163,6 +1163,9 @@ impl<'n> Engine<'n> { "start-index" => { call = call.start_index(value.unwrap_or("")); }, + "selected-fields" => { + call = call.selected_fields(value.unwrap_or("")); + }, "page-token" => { call = call.page_token(value.unwrap_or("")); }, @@ -1182,7 +1185,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", "start-index", "max-results"].iter().map(|v|*v)); + v.extend(["page-token", "start-index", "max-results", "selected-fields"].iter().map(|v|*v)); v } )); } } @@ -1266,6 +1269,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 { + "selected-fields" => { + call = call.selected_fields(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1279,6 +1285,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(["selected-fields"].iter().map(|v|*v)); v } )); } } @@ -2583,7 +2590,7 @@ fn main() { let mut app = App::new("bigquery2") .author("Sebastian Thiel ") - .version("1.0.4+20161130") + .version("1.0.4+20170511") .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 c7f838420e..c0ebf63761 100644 --- a/gen/bigquery2/Cargo.toml +++ b/gen/bigquery2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-bigquery2" -version = "1.0.4+20161130" +version = "1.0.4+20170511" 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.4+20161130" +documentation = "https://docs.rs/google-bigquery2/1.0.4+20170511" license = "MIT" keywords = ["bigquery", "google", "protocol", "web", "api"] diff --git a/gen/bigquery2/README.md b/gen/bigquery2/README.md index 3d263fedaa..5af7cbdcfc 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.4+20161130*, where *20161130* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *bigquery* crate version *1.0.4+20170511*, where *20170511* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161130/google_bigquery2/struct.Bigquery.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.Bigquery.html) ... -* [datasets](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.Dataset.html) - * [*delete*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.DatasetGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.DatasetInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.DatasetPatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.DatasetUpdateCall.html) -* [jobs](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.Job.html) - * [*cancel*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.JobCancelCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.JobGetCall.html), [*get query results*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.JobGetQueryResultCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.JobInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.JobListCall.html) and [*query*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.JobQueryCall.html) +* [datasets](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.Dataset.html) + * [*delete*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.DatasetGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.DatasetInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.DatasetPatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.DatasetUpdateCall.html) +* [jobs](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.Job.html) + * [*cancel*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.JobCancelCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.JobGetCall.html), [*get query results*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.JobGetQueryResultCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.JobInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.JobListCall.html) and [*query*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.JobQueryCall.html) * projects - * [*list*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.ProjectListCall.html) + * [*list*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.ProjectListCall.html) * tabledata - * [*insert all*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.TabledataInsertAllCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.TabledataListCall.html) -* [tables](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.Table.html) - * [*delete*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.TableGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.TableListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.TablePatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.TableUpdateCall.html) + * [*insert all*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.TabledataInsertAllCall.html) and [*list*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.TabledataListCall.html) +* [tables](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.Table.html) + * [*delete*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.TableGetCall.html), [*insert*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.TableListCall.html), [*patch*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.TablePatchCall.html) and [*update*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/struct.TableUpdateCall.html) Upload supported by ... -* [*insert jobs*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/struct.JobInsertCall.html) +* [*insert jobs*](https://docs.rs/google-bigquery2/1.0.4+20170511/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.4+20161130/google_bigquery2/struct.Bigquery.html)** +* **[Hub](https://docs.rs/google-bigquery2/1.0.4+20170511/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.4+20161130/google_bigquery2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-bigquery2/1.0.4+20170511/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.4+20161130/google_bigquery2/trait.Part.html)** + * **[Parts](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-bigquery2/1.0.4+20161130/google_bigquery2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-bigquery2/1.0.4+20170511/google_bigquery2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -138,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-bigquery2/1.0.4+20161130/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.4+20170511/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.4+20161130/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.4+20170511/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.4+20161130/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.4+20170511/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.4+20161130/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.4+20170511/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")`. @@ -158,29 +158,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.4+20161130/google_bigquery2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-bigquery2/1.0.4+20161130/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.4+20170511/google_bigquery2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-bigquery2/1.0.4+20170511/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.4+20161130/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.4+20170511/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.4+20161130/google_bigquery2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-bigquery2/1.0.4+20161130/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.4+20170511/google_bigquery2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-bigquery2/1.0.4+20170511/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.4+20161130/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.4+20170511/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.4+20161130/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.4+20170511/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.4+20161130/google_bigquery2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-bigquery2/1.0.4+20170511/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 f19459ea54..9fde52b678 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.4+20161130*, where *20161130* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *bigquery* crate version *1.0.4+20170511*, where *20170511* is the exact revision of the *bigquery:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *bigquery* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/bigquery/). @@ -193,7 +193,7 @@ // 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 +// 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)] @@ -348,8 +348,6 @@ pub struct Bigquery { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Bigquery {} @@ -362,8 +360,6 @@ impl<'a, C, A> Bigquery client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/bigquery/v2/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -392,26 +388,6 @@ impl<'a, C, A> Bigquery self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/bigquery/v2/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -468,7 +444,7 @@ pub struct QueryRequest { /// [Optional] If set to true, BigQuery doesn't run the job. Instead, if the query is valid, BigQuery returns statistics about the job such as how many bytes would be processed. If the query is invalid, an error returns. The default value is false. #[serde(rename="dryRun")] pub dry_run: Option, - /// [Experimental] Standard SQL only. Whether to use positional (?) or named (@myparam) query parameters in this query. + /// Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query. #[serde(rename="parameterMode")] pub parameter_mode: Option, /// [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. The default value is true. @@ -483,7 +459,7 @@ pub struct QueryRequest { /// [Optional] The maximum number of rows of data to return per page of results. Setting this flag to a small value such as 1000 and then paging through results might improve reliability when the query result set is large. In addition to this limit, responses are also limited to 10 MB. By default, there is no maximum row count, and only the byte limit applies. #[serde(rename="maxResults")] pub max_results: Option, - /// [Experimental] Query parameters for Standard SQL queries. + /// Query parameters for Standard SQL queries. #[serde(rename="queryParameters")] pub query_parameters: Option>, /// [Required] A query string, following the BigQuery query syntax, of the query to execute. Example: "SELECT count(f1) FROM [myProjectId:myDatasetId.myTableId]". @@ -502,7 +478,7 @@ impl RequestValue for QueryRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobStatistics2 { - /// [Output-only, Experimental] Describes execution plan for the query. + /// [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. @@ -526,7 +502,7 @@ pub struct JobStatistics2 { /// [Output-only] Billing tier for the job. #[serde(rename="billingTier")] pub billing_tier: Option, - /// [Output-only, Experimental] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. + /// [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] The schema of the results. Present only for successful dry run of non-legacy SQL queries. @@ -559,6 +535,21 @@ pub struct JobStatistics3 { impl Part for JobStatistics3 {} +/// Additional details for a view. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TableListTablesView { + /// True if view is defined in legacy SQL dialect, false if in standard SQL. + #[serde(rename="useLegacySql")] + pub use_legacy_sql: Option, +} + +impl NestedType for TableListTablesView {} +impl Part for TableListTablesView {} + + /// Represents a single JSON object. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -605,7 +596,7 @@ impl ResponseResult for ProjectList {} pub struct TableFieldSchema { /// [Optional] Describes the nested schema fields if the type property is set to RECORD. pub fields: Option>, - /// [Optional] The field description. The maximum length is 16K characters. + /// [Optional] The field description. The maximum length is 512 characters. pub description: Option, /// [Required] The field data type. Possible values include STRING, BYTES, INTEGER, INT64 (same as INTEGER), FLOAT, FLOAT64 (same as FLOAT), BOOLEAN, BOOL (same as BOOLEAN), TIMESTAMP, DATE, TIME, DATETIME, RECORD (where RECORD indicates that the field contains a nested schema) or STRUCT (same as RECORD). #[serde(rename="type")] @@ -782,6 +773,8 @@ impl Part for JobReference {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ExplainQueryStage { + /// Current status for the stage. + pub status: Option, /// Relative amount of time the slowest shard spent on CPU-bound tasks. #[serde(rename="computeRatioMax")] pub compute_ratio_max: Option, @@ -834,7 +827,7 @@ pub struct DatasetListDatasets { pub friendly_name: Option, /// The resource type. This property always returns the value "bigquery#dataset". pub kind: Option, - /// [Experimental] The labels associated with this dataset. You can use these to organize and group your datasets. + /// The labels associated with this dataset. You can use these to organize and group your datasets. pub labels: Option>, /// The fully-qualified, unique, opaque ID of the dataset. pub id: Option, @@ -892,6 +885,8 @@ impl Part for UserDefinedFunctionResource {} pub struct TableListTables { /// The resource type. pub kind: Option, + /// Additional details for a view. + pub view: Option, /// The user-friendly name for this table. #[serde(rename="friendlyName")] pub friendly_name: Option, @@ -1084,7 +1079,7 @@ pub struct JobConfigurationLoad { /// [Optional] The number of rows at the top of a CSV file that BigQuery will skip when loading the data. The default value is 0. This property is useful if you have header rows in the file that should be skipped. #[serde(rename="skipLeadingRows")] pub skip_leading_rows: Option, - /// [Experimental] Indicates if we should automatically infer the options and schema for CSV and JSON sources. + /// Indicates if we should automatically infer the options and schema for CSV and JSON sources. pub autodetect: Option, /// [Required] The destination table to load the data into. #[serde(rename="destinationTable")] @@ -1092,10 +1087,10 @@ pub struct JobConfigurationLoad { /// [Required] The fully-qualified URIs that point to your data in Google Cloud Storage. Each URI can contain one '*' wildcard character and it must come after the 'bucket' name. #[serde(rename="sourceUris")] pub source_uris: Option>, - /// [Optional] This string will be interpreted as a null value when it appears in a CSV file. The default value is the empty string. Please refer to the documentation for further information. + /// [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 sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result. + /// If sourceFormat is set to "DATASTORE_BACKUP", indicates which entity properties to load into BigQuery from a Cloud Datastore backup. Property names are case sensitive and must be top-level properties. If no properties are specified, BigQuery loads all properties. If any named property isn't found in the Cloud Datastore backup, an invalid error is returned in the job result. #[serde(rename="projectionFields")] pub projection_fields: Option>, /// Indicates if BigQuery should allow quoted data sections that contain newline characters in a CSV file. The default value is false. @@ -1233,7 +1228,7 @@ pub struct GetQueryResultsResponse { pub etag: Option, /// An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above. Present only when the query completes successfully. pub rows: Option>, - /// [Output-only, Experimental] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. + /// [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, /// The schema of the results. Present only when the query completes successfully. @@ -1301,7 +1296,7 @@ pub struct ExternalDataConfiguration { /// Additional properties to set if sourceFormat is set to CSV. #[serde(rename="csvOptions")] pub csv_options: Option, - /// [Experimental] Try to detect schema and format options automatically. Any option specified explicitly will be honored. + /// Try to detect schema and format options automatically. Any option specified explicitly will be honored. pub autodetect: Option, /// [Optional] The maximum number of bad records that BigQuery can ignore when reading data. 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. This setting is ignored for Google Cloud Bigtable, Google Cloud Datastore backups and Avro formats. #[serde(rename="maxBadRecords")] @@ -1315,7 +1310,7 @@ pub struct ExternalDataConfiguration { /// [Optional] Additional options if sourceFormat is set to BIGTABLE. #[serde(rename="bigtableOptions")] pub bigtable_options: Option, - /// [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". [Experimental] For Google Cloud Bigtable, specify "BIGTABLE". Please note that reading from Google Cloud Bigtable is experimental and has to be enabled for your project. Please contact Google Cloud Support to enable this for your project. + /// [Required] The data format. For CSV files, specify "CSV". For Google sheets, specify "GOOGLE_SHEETS". For newline-delimited JSON, specify "NEWLINE_DELIMITED_JSON". For Avro files, specify "AVRO". For Google Cloud Datastore backups, specify "DATASTORE_BACKUP". [Beta] For Google Cloud Bigtable, specify "BIGTABLE". #[serde(rename="sourceFormat")] pub source_format: Option, /// [Optional] Additional options if sourceFormat is set to GOOGLE_SHEETS. @@ -1374,7 +1369,7 @@ pub struct ViewDefinition { /// Specifies whether to use BigQuery's legacy SQL for this view. The default value is true. If set to false, the view will use BigQuery's standard SQL: https://cloud.google.com/bigquery/sql-reference/ Queries and views that reference this view must use the same flag value. #[serde(rename="useLegacySql")] pub use_legacy_sql: Option, - /// [Experimental] Describes user-defined function resources used in the query. + /// Describes user-defined function resources used in the query. #[serde(rename="userDefinedFunctionResources")] pub user_defined_function_resources: Option>, } @@ -1566,7 +1561,7 @@ impl Part for JobStatistics {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobConfigurationQuery { - /// [Optional] Flattens all nested and repeated fields in the query results. The default value is true. allowLargeResults must be true if this is set to false. + /// [Optional] If true and query uses legacy SQL dialect, flattens all nested and repeated fields in the query results. allowLargeResults must be true if this is set to false. For standard SQL queries, this flag is ignored and results are never flattened. #[serde(rename="flattenResults")] pub flatten_results: Option, /// [Optional] Whether to look for the result in the query cache. The query cache is a best-effort cache that will be flushed whenever tables in the query are modified. Moreover, the query cache is only available when a query does not have a destination table specified. The default value is true. @@ -1578,7 +1573,7 @@ pub struct JobConfigurationQuery { /// Query parameters for standard SQL queries. #[serde(rename="queryParameters")] pub query_parameters: Option>, - /// [Required] BigQuery SQL query to execute. + /// [Required] SQL query text to execute. The useLegacySql field can be used to indicate whether the query uses legacy SQL or standard SQL. pub query: Option, /// [Deprecated] This property is deprecated. #[serde(rename="preserveNulls")] @@ -1589,7 +1584,7 @@ pub struct JobConfigurationQuery { /// [Optional] Limits the billing tier for this job. Queries that have resource usage beyond this tier will fail (without incurring a charge). If unspecified, this will be set to your project default. #[serde(rename="maximumBillingTier")] pub maximum_billing_tier: Option, - /// [Experimental] Standard SQL only. Whether to use positional (?) or named (@myparam) query parameters in this query. + /// Standard SQL only. Set to POSITIONAL to use positional (?) query parameters or to NAMED to use named (@myparam) query parameters in this query. #[serde(rename="parameterMode")] pub parameter_mode: Option, /// [Optional] Specifies the default dataset to use for unqualified table names in the query. @@ -1606,13 +1601,13 @@ pub struct JobConfigurationQuery { /// [Optional] Specifies the action that occurs if the destination table already exists. The following values are supported: WRITE_TRUNCATE: If the table already exists, BigQuery overwrites the table data. WRITE_APPEND: If the table already exists, BigQuery appends the data to the table. WRITE_EMPTY: If the table already exists and contains data, a 'duplicate' error is returned in the job result. The default value is WRITE_EMPTY. Each action is atomic and only occurs if BigQuery is able to complete the job successfully. Creation, truncation and append actions occur as one atomic update upon job completion. #[serde(rename="writeDisposition")] pub write_disposition: Option, - /// If true, allows the query to produce arbitrarily large result tables at a slight cost in performance. Requires destinationTable to be set. + /// [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. #[serde(rename="allowLargeResults")] pub allow_large_results: Option, /// [Optional] Specifies whether the job is allowed to create new tables. The following values are supported: CREATE_IF_NEEDED: If the table does not exist, BigQuery creates the table. CREATE_NEVER: The table must already exist. If it does not, a 'notFound' error is returned in the job result. The default value is CREATE_IF_NEEDED. Creation, truncation and append actions occur as one atomic update upon job completion. #[serde(rename="createDisposition")] pub create_disposition: Option, - /// [Experimental] Describes user-defined function resources used in the query. + /// Describes user-defined function resources used in the query. #[serde(rename="userDefinedFunctionResources")] pub user_defined_function_resources: Option>, /// [Optional] If querying an external data source outside of BigQuery, describes the data format, location and other properties of the data source. By defining these properties, the data source can then be queried as if it were a standard BigQuery table. @@ -1668,7 +1663,7 @@ pub struct JobConfiguration { pub dry_run: Option, /// [Pick one] Configures a query job. pub query: Option, - /// [Experimental] The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 characters, can only contain letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and must be unique within a dataset. Both keys and values are additionally constrained to be <= 128 bytes in size. + /// [Experimental] The labels associated with this job. You can use these to organize and group your jobs. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key. pub labels: Option>, /// [Pick one] Configures an extract job. pub extract: Option, @@ -1745,7 +1740,7 @@ pub struct Dataset { /// [Required] A reference that identifies the dataset. #[serde(rename="datasetReference")] pub dataset_reference: Option, - /// [Experimental] The labels associated with this dataset. You can use these to organize and group your datasets. You can set this property when inserting or updating a dataset. See Labeling Datasets for more information. + /// The labels associated with this dataset. You can use these to organize and group your datasets. You can set this property when inserting or updating a dataset. See Labeling Datasets for more information. pub labels: Option>, /// [Output-only] The time when this dataset was created, in milliseconds since the epoch. #[serde(rename="creationTime")] @@ -1757,7 +1752,7 @@ pub struct Dataset { pub default_table_expiration_ms: Option, /// [Output-only] A hash of the resource. pub etag: Option, - /// [Experimental] The geographic location where the dataset should reside. Possible values include EU and US. The default value is US. + /// The geographic location where the dataset should reside. Possible values include EU and US. The default value is US. pub location: Option, /// [Optional] A descriptive name for the dataset. #[serde(rename="friendlyName")] @@ -1817,7 +1812,7 @@ pub struct Table { /// [Output-only] The time when this table was created, in milliseconds since the epoch. #[serde(rename="creationTime")] pub creation_time: Option, - /// [Experimental] The labels associated with this table. You can use these to organize and group your tables. Label keys and values can be no longer than 63 characters, can only contain letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and must be unique within a dataset. Both keys and values are additionally constrained to be <= 128 bytes in size. + /// [Experimental] The labels associated with this table. You can use these to organize and group your tables. Label keys and values can be no longer than 63 characters, can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter and each label in the list must have a different key. pub labels: Option>, /// [Output-only] The size of this table in bytes, excluding any data in the streaming buffer. #[serde(rename="numBytes")] @@ -1930,7 +1925,7 @@ pub struct QueryResponse { pub page_token: Option, /// An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call GetQueryResults and specify the jobReference returned above. pub rows: Option>, - /// [Output-only, Experimental] The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. + /// [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, /// The schema of the results. Present only when the query completes successfully. @@ -2124,6 +2119,7 @@ impl<'a, C, A> TableMethods<'a, C, A> { _project_id: project_id.to_string(), _dataset_id: dataset_id.to_string(), _table_id: table_id.to_string(), + _selected_fields: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2557,6 +2553,7 @@ impl<'a, C, A> TabledataMethods<'a, C, A> { _dataset_id: dataset_id.to_string(), _table_id: table_id.to_string(), _start_index: Default::default(), + _selected_fields: Default::default(), _page_token: Default::default(), _max_results: Default::default(), _delegate: Default::default(), @@ -2710,7 +2707,7 @@ impl<'a, C, A> TableUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2998,7 +2995,7 @@ impl<'a, C, A> TableInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3279,7 +3276,7 @@ impl<'a, C, A> TableListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3541,7 +3538,7 @@ impl<'a, C, A> TableDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3743,6 +3740,7 @@ impl<'a, C, A> TableDeleteCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.tables().get("projectId", "datasetId", "tableId") +/// .selected_fields("et") /// .doit(); /// # } /// ``` @@ -3753,6 +3751,7 @@ pub struct TableGetCall<'a, C, A> _project_id: String, _dataset_id: String, _table_id: String, + _selected_fields: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3774,11 +3773,14 @@ impl<'a, C, A> TableGetCall<'a, C, A> where C: BorrowMut, A: oaut }; dlg.begin(MethodInfo { id: "bigquery.tables.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(("projectId", self._project_id.to_string())); params.push(("datasetId", self._dataset_id.to_string())); params.push(("tableId", self._table_id.to_string())); - for &field in ["alt", "projectId", "datasetId", "tableId"].iter() { + if let Some(value) = self._selected_fields { + params.push(("selectedFields", value.to_string())); + } + for &field in ["alt", "projectId", "datasetId", "tableId", "selectedFields"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3790,7 +3792,7 @@ impl<'a, C, A> TableGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3923,6 +3925,13 @@ impl<'a, C, A> TableGetCall<'a, C, A> where C: BorrowMut, A: oaut self._table_id = new_value.to_string(); self } + /// List of fields to return (comma-separated). If unspecified, all fields are returned + /// + /// Sets the *selected fields* query property to the given value. + pub fn selected_fields(mut self, new_value: &str) -> TableGetCall<'a, C, A> { + self._selected_fields = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4056,7 +4065,7 @@ impl<'a, C, A> TablePatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4344,7 +4353,7 @@ impl<'a, C, A> DatasetPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4615,7 +4624,7 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4817,10 +4826,10 @@ impl<'a, C, A> DatasetGetCall<'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.datasets().list("projectId") -/// .page_token("Lorem") -/// .max_results(26) -/// .filter("erat") -/// .all(false) +/// .page_token("eos") +/// .max_results(20) +/// .filter("sadipscing") +/// .all(true) /// .doit(); /// # } /// ``` @@ -4880,7 +4889,7 @@ impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5152,7 +5161,7 @@ impl<'a, C, A> DatasetUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5378,7 +5387,7 @@ impl<'a, C, A> DatasetUpdateCall<'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.datasets().delete("projectId", "datasetId") -/// .delete_contents(false) +/// .delete_contents(true) /// .doit(); /// # } /// ``` @@ -5427,7 +5436,7 @@ impl<'a, C, A> DatasetDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5676,7 +5685,7 @@ impl<'a, C, A> DatasetInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5937,7 +5946,7 @@ impl<'a, C, A> JobCancelCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/jobs/{jobId}/cancel"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/jobs/{jobId}/cancel".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6189,7 +6198,7 @@ impl<'a, C, A> JobQueryCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/queries"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/queries".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6405,10 +6414,10 @@ impl<'a, C, A> JobQueryCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.jobs().get_query_results("projectId", "jobId") -/// .timeout_ms(45) -/// .start_index("sea") -/// .page_token("et") -/// .max_results(31) +/// .timeout_ms(92) +/// .start_index("et") +/// .page_token("duo") +/// .max_results(80) /// .doit(); /// # } /// ``` @@ -6470,7 +6479,7 @@ impl<'a, C, A> JobGetQueryResultCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/queries/{jobId}"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/queries/{jobId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6700,10 +6709,10 @@ impl<'a, C, A> JobGetQueryResultCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.jobs().list("projectId") -/// .add_state_filter("eirmod") -/// .projection("sanctus") -/// .page_token("et") -/// .max_results(55) +/// .add_state_filter("sanctus") +/// .projection("et") +/// .page_token("amet") +/// .max_results(78) /// .all_users(true) /// .doit(); /// # } @@ -6770,7 +6779,7 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/jobs"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/jobs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7043,7 +7052,7 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/jobs/{jobId}"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/jobs/{jobId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7299,9 +7308,9 @@ impl<'a, C, A> JobInsertCall<'a, C, A> where C: BorrowMut, A: oau let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/bigquery/v2/projects/{projectId}/jobs", "multipart") + ("https://www.googleapis.com/upload/bigquery/v2/projects/{projectId}/jobs".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/bigquery/v2/projects/{projectId}/jobs", "resumable") + ("https://www.googleapis.com/resumable/upload/bigquery/v2/projects/{projectId}/jobs".to_string(), "resumable") } else { unreachable!() }; @@ -7675,7 +7684,7 @@ impl<'a, C, A> TabledataInsertAllCall<'a, C, A> where C: BorrowMut TabledataInsertAllCall<'a, C, A> where C: BorrowMut _dataset_id: String, _table_id: String, _start_index: Option, + _selected_fields: Option, _page_token: Option, _max_results: Option, _delegate: Option<&'a mut Delegate>, @@ -7948,20 +7959,23 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "bigquery.tabledata.list", http_method: hyper::method::Method::Get }); - 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(("projectId", self._project_id.to_string())); params.push(("datasetId", self._dataset_id.to_string())); params.push(("tableId", self._table_id.to_string())); if let Some(value) = self._start_index { params.push(("startIndex", value.to_string())); } + if let Some(value) = self._selected_fields { + params.push(("selectedFields", value.to_string())); + } if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); } if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } - for &field in ["alt", "projectId", "datasetId", "tableId", "startIndex", "pageToken", "maxResults"].iter() { + for &field in ["alt", "projectId", "datasetId", "tableId", "startIndex", "selectedFields", "pageToken", "maxResults"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7973,7 +7987,7 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects/{projectId}/datasets/{datasetId}/tables/{tableId}/data".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8113,6 +8127,13 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: self._start_index = Some(new_value.to_string()); self } + /// List of fields to return (comma-separated). If unspecified, all fields are returned + /// + /// Sets the *selected fields* query property to the given value. + pub fn selected_fields(mut self, new_value: &str) -> TabledataListCall<'a, C, A> { + self._selected_fields = Some(new_value.to_string()); + self + } /// Page token, returned by a previous call, identifying the result set /// /// Sets the *page token* query property to the given value. @@ -8206,8 +8227,8 @@ impl<'a, C, A> TabledataListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.projects().list() -/// .page_token("gubergren") -/// .max_results(81) +/// .page_token("sit") +/// .max_results(75) /// .doit(); /// # } /// ``` @@ -8257,7 +8278,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects"; + let mut url = "https://www.googleapis.com/bigquery/v2/projects".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8405,3 +8426,4 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o } + diff --git a/gen/blogger3-cli/Cargo.toml b/gen/blogger3-cli/Cargo.toml index f2610d14f9..bb32470036 100644 --- a/gen/blogger3-cli/Cargo.toml +++ b/gen/blogger3-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/blogger3/src/lib.rs b/gen/blogger3/src/lib.rs index 792c6ebc6d..f6fe1ee546 100644 --- a/gen/blogger3/src/lib.rs +++ b/gen/blogger3/src/lib.rs @@ -203,7 +203,7 @@ // 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 +// 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)] @@ -342,8 +342,6 @@ pub struct Blogger { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Blogger {} @@ -356,8 +354,6 @@ impl<'a, C, A> Blogger client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/blogger/v3/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -395,26 +391,6 @@ impl<'a, C, A> Blogger self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/blogger/v3/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -2377,7 +2353,7 @@ impl<'a, C, A> PageViewGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pageviews"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pageviews".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2619,7 +2595,7 @@ impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userId}"; + let mut url = "https://www.googleapis.com/blogger/v3/users/{userId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2878,7 +2854,7 @@ impl<'a, C, A> BlogListByUserCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userId}/blogs"; + let mut url = "https://www.googleapis.com/blogger/v3/users/{userId}/blogs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3153,7 +3129,7 @@ impl<'a, C, A> BlogGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3407,7 +3383,7 @@ impl<'a, C, A> BlogGetByUrlCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/byurl"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/byurl".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3662,7 +3638,7 @@ impl<'a, C, A> PostUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3978,7 +3954,7 @@ impl<'a, C, A> PostGetByPathCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/bypath"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/bypath".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4259,7 +4235,7 @@ impl<'a, C, A> PostGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4554,7 +4530,7 @@ impl<'a, C, A> PostInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4841,7 +4817,7 @@ impl<'a, C, A> PostPublishCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/publish"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/publish".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5094,7 +5070,7 @@ impl<'a, C, A> PostDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5331,7 +5307,7 @@ impl<'a, C, A> PostRevertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/revert"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/revert".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5588,7 +5564,7 @@ impl<'a, C, A> PostSearchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/search"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/search".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5881,7 +5857,7 @@ impl<'a, C, A> PostPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6237,7 +6213,7 @@ impl<'a, C, A> PostListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6552,7 +6528,7 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/comments/{commentId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6818,7 +6794,7 @@ impl<'a, C, A> CommentRemoveContentCall<'a, C, A> where C: BorrowMut CommentListByBlogCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/comments"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7386,7 +7362,7 @@ impl<'a, C, A> CommentMarkAsSpamCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/comments/{commentId}/spam"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/spam".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7680,7 +7656,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/comments"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7978,7 +7954,7 @@ impl<'a, C, A> CommentApproveCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/comments/{commentId}/approve"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}/approve".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8236,7 +8212,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/posts/{postId}/comments/{commentId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/posts/{postId}/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8490,7 +8466,7 @@ impl<'a, C, A> PostUserInfoGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userId}/blogs/{blogId}/posts/{postId}"; + let mut url = "https://www.googleapis.com/blogger/v3/users/{userId}/blogs/{blogId}/posts/{postId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8801,7 +8777,7 @@ impl<'a, C, A> PostUserInfoListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userId}/blogs/{blogId}/posts"; + let mut url = "https://www.googleapis.com/blogger/v3/users/{userId}/blogs/{blogId}/posts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9116,7 +9092,7 @@ impl<'a, C, A> BlogUserInfoGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userId}/blogs/{blogId}"; + let mut url = "https://www.googleapis.com/blogger/v3/users/{userId}/blogs/{blogId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9375,7 +9351,7 @@ impl<'a, C, A> PageGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9653,7 +9629,7 @@ impl<'a, C, A> PageListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9925,7 +9901,7 @@ impl<'a, C, A> PageRevertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}/revert"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}/revert".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10182,7 +10158,7 @@ impl<'a, C, A> PageInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10467,7 +10443,7 @@ impl<'a, C, A> PagePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10752,7 +10728,7 @@ impl<'a, C, A> PagePublishCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}/publish"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}/publish".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11016,7 +10992,7 @@ impl<'a, C, A> PageUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11300,7 +11276,7 @@ impl<'a, C, A> PageDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "blogs/{blogId}/pages/{pageId}"; + let mut url = "https://www.googleapis.com/blogger/v3/blogs/{blogId}/pages/{pageId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11465,3 +11441,4 @@ impl<'a, C, A> PageDeleteCall<'a, C, A> where C: BorrowMut, A: oa } + diff --git a/gen/books1-cli/Cargo.toml b/gen/books1-cli/Cargo.toml index 709db1d41a..7c5fb0fd11 100644 --- a/gen/books1-cli/Cargo.toml +++ b/gen/books1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-books1-cli" -version = "1.0.4+20161206" +version = "1.0.4+20170313" authors = ["Sebastian Thiel "] description = "A complete library to interact with books (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/books1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-books1] path = "../books1" -version = "1.0.4+20161206" +version = "1.0.4+20170313" diff --git a/gen/books1-cli/README.md b/gen/books1-cli/README.md index 09267b2579..a3f4e06da7 100644 --- a/gen/books1-cli/README.md +++ b/gen/books1-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 *books* API at revision *20161206*. The CLI is at version *1.0.4*. +This documentation was generated from the *books* API at revision *20170313*. The CLI is at version *1.0.4*. ```bash books1 [options] diff --git a/gen/books1-cli/mkdocs.yml b/gen/books1-cli/mkdocs.yml index 301e33d6bd..01f9d8666f 100644 --- a/gen/books1-cli/mkdocs.yml +++ b/gen/books1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: books v1.0.4+20161206 +site_name: books v1.0.4+20170313 site_url: http://byron.github.io/google-apis-rs/google-books1-cli site_description: A complete library to interact with books (protocol v1) diff --git a/gen/books1-cli/src/main.rs b/gen/books1-cli/src/main.rs index 8b10f2b6aa..33d01bc2a9 100644 --- a/gen/books1-cli/src/main.rs +++ b/gen/books1-cli/src/main.rs @@ -1160,12 +1160,13 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "notification.more-from-series.opted-state" => Some(("notification.moreFromSeries.opted_state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "notification.reward-expirations.opted-state" => Some(("notification.rewardExpirations.opted_state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "notification.more-from-authors.opted-state" => Some(("notification.moreFromAuthors.opted_state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "notes-export.is-enabled" => Some(("notesExport.isEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "notes-export.folder-name" => Some(("notesExport.folderName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["folder-name", "is-enabled", "kind", "more-from-authors", "more-from-series", "notes-export", "notification", "opted-state"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["folder-name", "is-enabled", "kind", "more-from-authors", "more-from-series", "notes-export", "notification", "opted-state", "reward-expirations"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1371,6 +1372,9 @@ impl<'n> Engine<'n> { "country" => { call = call.country(value.unwrap_or("")); }, + "annotation-id" => { + call = call.annotation_id(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1384,7 +1388,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["source", "show-only-summary-in-response", "country"].iter().map(|v|*v)); + v.extend(["source", "show-only-summary-in-response", "annotation-id", "country"].iter().map(|v|*v)); v } )); } } @@ -4702,7 +4706,7 @@ fn main() { let mut app = App::new("books1") .author("Sebastian Thiel ") - .version("1.0.4+20161206") + .version("1.0.4+20170313") .about("Searches for books and manages your Google Books library.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_books1_cli") .arg(Arg::with_name("url") diff --git a/gen/books1/Cargo.toml b/gen/books1/Cargo.toml index f251c90b61..dd040c02ed 100644 --- a/gen/books1/Cargo.toml +++ b/gen/books1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-books1" -version = "1.0.4+20161206" +version = "1.0.4+20170313" authors = ["Sebastian Thiel "] description = "A complete library to interact with books (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/books1" homepage = "https://developers.google.com/books/docs/v1/getting_started" -documentation = "https://docs.rs/google-books1/1.0.4+20161206" +documentation = "https://docs.rs/google-books1/1.0.4+20170313" license = "MIT" keywords = ["books", "google", "protocol", "web", "api"] diff --git a/gen/books1/README.md b/gen/books1/README.md index 3eece49977..27b2661351 100644 --- a/gen/books1/README.md +++ b/gen/books1/README.md @@ -5,38 +5,38 @@ DO NOT EDIT ! --> The `google-books1` library allows access to all features of the *Google books* service. -This documentation was generated from *books* crate version *1.0.4+20161206*, where *20161206* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *books* crate version *1.0.4+20170313*, where *20170313* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *books* *v1* API can be found at the [official documentation site](https://developers.google.com/books/docs/v1/getting_started). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.Books.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.Books.html) ... * bookshelves - * [*get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.BookshelveGetCall.html), [*list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.BookshelveListCall.html) and [*volumes list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.BookshelveVolumeListCall.html) + * [*get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.BookshelveGetCall.html), [*list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.BookshelveListCall.html) and [*volumes list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.BookshelveVolumeListCall.html) * cloudloading - * [*add book*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.CloudloadingAddBookCall.html), [*delete book*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.CloudloadingDeleteBookCall.html) and [*update book*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.CloudloadingUpdateBookCall.html) + * [*add book*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.CloudloadingAddBookCall.html), [*delete book*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.CloudloadingDeleteBookCall.html) and [*update book*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.CloudloadingUpdateBookCall.html) * dictionary - * [*list offline metadata*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.DictionaryListOfflineMetadataCall.html) + * [*list offline metadata*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.DictionaryListOfflineMetadataCall.html) * layers - * [*annotation data get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.LayerAnnotationDataGetCall.html), [*annotation data list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.LayerAnnotationDataListCall.html), [*get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.LayerGetCall.html), [*list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.LayerListCall.html), [*volume annotations get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.LayerVolumeAnnotationGetCall.html) and [*volume annotations list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.LayerVolumeAnnotationListCall.html) + * [*annotation data get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.LayerAnnotationDataGetCall.html), [*annotation data list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.LayerAnnotationDataListCall.html), [*get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.LayerGetCall.html), [*list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.LayerListCall.html), [*volume annotations get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.LayerVolumeAnnotationGetCall.html) and [*volume annotations list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.LayerVolumeAnnotationListCall.html) * myconfig - * [*get user settings*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MyconfigGetUserSettingCall.html), [*release download access*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MyconfigReleaseDownloadAccesCall.html), [*request access*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MyconfigRequestAccesCall.html), [*sync volume licenses*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MyconfigSyncVolumeLicenseCall.html) and [*update user settings*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MyconfigUpdateUserSettingCall.html) + * [*get user settings*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MyconfigGetUserSettingCall.html), [*release download access*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MyconfigReleaseDownloadAccesCall.html), [*request access*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MyconfigRequestAccesCall.html), [*sync volume licenses*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MyconfigSyncVolumeLicenseCall.html) and [*update user settings*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MyconfigUpdateUserSettingCall.html) * mylibrary - * [*annotations delete*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryAnnotationDeleteCall.html), [*annotations insert*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryAnnotationInsertCall.html), [*annotations list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryAnnotationListCall.html), [*annotations summary*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryAnnotationSummaryCall.html), [*annotations update*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryAnnotationUpdateCall.html), [*bookshelves add volume*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryBookshelveAddVolumeCall.html), [*bookshelves clear volumes*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryBookshelveClearVolumeCall.html), [*bookshelves get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryBookshelveGetCall.html), [*bookshelves list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryBookshelveListCall.html), [*bookshelves move volume*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryBookshelveMoveVolumeCall.html), [*bookshelves remove volume*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryBookshelveRemoveVolumeCall.html), [*bookshelves volumes list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryBookshelveVolumeListCall.html), [*readingpositions get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryReadingpositionGetCall.html) and [*readingpositions set position*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.MylibraryReadingpositionSetPositionCall.html) -* [notification](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.Notification.html) - * [*get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.NotificationGetCall.html) + * [*annotations delete*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryAnnotationDeleteCall.html), [*annotations insert*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryAnnotationInsertCall.html), [*annotations list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryAnnotationListCall.html), [*annotations summary*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryAnnotationSummaryCall.html), [*annotations update*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryAnnotationUpdateCall.html), [*bookshelves add volume*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryBookshelveAddVolumeCall.html), [*bookshelves clear volumes*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryBookshelveClearVolumeCall.html), [*bookshelves get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryBookshelveGetCall.html), [*bookshelves list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryBookshelveListCall.html), [*bookshelves move volume*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryBookshelveMoveVolumeCall.html), [*bookshelves remove volume*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryBookshelveRemoveVolumeCall.html), [*bookshelves volumes list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryBookshelveVolumeListCall.html), [*readingpositions get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryReadingpositionGetCall.html) and [*readingpositions set position*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.MylibraryReadingpositionSetPositionCall.html) +* [notification](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.Notification.html) + * [*get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.NotificationGetCall.html) * onboarding - * [*list categories*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.OnboardingListCategoryCall.html) and [*list category volumes*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.OnboardingListCategoryVolumeCall.html) + * [*list categories*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.OnboardingListCategoryCall.html) and [*list category volumes*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.OnboardingListCategoryVolumeCall.html) * personalizedstream - * [*get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.PersonalizedstreamGetCall.html) + * [*get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.PersonalizedstreamGetCall.html) * promooffer - * [*accept*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.PromoofferAcceptCall.html), [*dismiss*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.PromoofferDismisCall.html) and [*get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.PromoofferGetCall.html) + * [*accept*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.PromoofferAcceptCall.html), [*dismiss*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.PromoofferDismisCall.html) and [*get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.PromoofferGetCall.html) * series - * [*get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.SeryGetCall.html) and [*membership get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.SeryMembershipGetCall.html) -* [volumes](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.Volume.html) - * [*associated list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.VolumeAssociatedListCall.html), [*get*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.VolumeGetCall.html), [*list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.VolumeListCall.html), [*mybooks list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.VolumeMybookListCall.html), [*recommended list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.VolumeRecommendedListCall.html), [*recommended rate*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.VolumeRecommendedRateCall.html) and [*useruploaded list*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.VolumeUseruploadedListCall.html) + * [*get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.SeryGetCall.html) and [*membership get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.SeryMembershipGetCall.html) +* [volumes](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.Volume.html) + * [*associated list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.VolumeAssociatedListCall.html), [*get*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.VolumeGetCall.html), [*list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.VolumeListCall.html), [*mybooks list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.VolumeMybookListCall.html), [*recommended list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.VolumeRecommendedListCall.html), [*recommended rate*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.VolumeRecommendedRateCall.html) and [*useruploaded list*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.VolumeUseruploadedListCall.html) @@ -45,17 +45,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-books1/1.0.4+20161206/google_books1/struct.Books.html)** +* **[Hub](https://docs.rs/google-books1/1.0.4+20170313/google_books1/struct.Books.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-books1/1.0.4+20161206/google_books1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-books1/1.0.4+20161206/google_books1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-books1/1.0.4+20170313/google_books1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-books1/1.0.4+20170313/google_books1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-books1/1.0.4+20161206/google_books1/trait.Part.html)** + * **[Parts](https://docs.rs/google-books1/1.0.4+20170313/google_books1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-books1/1.0.4+20161206/google_books1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-books1/1.0.4+20170313/google_books1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -157,17 +157,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-books1/1.0.4+20161206/google_books1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-books1/1.0.4+20170313/google_books1/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-books1/1.0.4+20161206/google_books1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-books1/1.0.4+20170313/google_books1/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-books1/1.0.4+20161206/google_books1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-books1/1.0.4+20170313/google_books1/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-books1/1.0.4+20161206/google_books1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-books1/1.0.4+20170313/google_books1/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")`. @@ -177,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-books1/1.0.4+20161206/google_books1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-books1/1.0.4+20161206/google_books1/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-books1/1.0.4+20170313/google_books1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-books1/1.0.4+20170313/google_books1/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-books1/1.0.4+20161206/google_books1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-books1/1.0.4+20170313/google_books1/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-books1/1.0.4+20161206/google_books1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-books1/1.0.4+20161206/google_books1/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-books1/1.0.4+20170313/google_books1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-books1/1.0.4+20170313/google_books1/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-books1/1.0.4+20161206/google_books1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-books1/1.0.4+20170313/google_books1/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-books1/1.0.4+20161206/google_books1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-books1/1.0.4+20170313/google_books1/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-books1/1.0.4+20161206/google_books1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-books1/1.0.4+20170313/google_books1/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/books1/src/lib.rs b/gen/books1/src/lib.rs index fb6c81cbd7..ff70dda1ce 100644 --- a/gen/books1/src/lib.rs +++ b/gen/books1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *books* crate version *1.0.4+20161206*, where *20161206* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *books* crate version *1.0.4+20170313*, where *20170313* is the exact revision of the *books:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *books* *v1* API can be found at the //! [official documentation site](https://developers.google.com/books/docs/v1/getting_started). @@ -212,7 +212,7 @@ // 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 +// 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)] @@ -350,8 +350,6 @@ pub struct Books { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Books {} @@ -364,8 +362,6 @@ impl<'a, C, A> Books client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/books/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -415,26 +411,6 @@ impl<'a, C, A> Books self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/books/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -2131,6 +2107,9 @@ pub struct UsersettingsNotification { #[serde(rename="moreFromSeries")] pub more_from_series: Option, /// no description provided + #[serde(rename="rewardExpirations")] + pub reward_expirations: Option, + /// no description provided #[serde(rename="moreFromAuthors")] pub more_from_authors: Option, } @@ -2276,6 +2255,20 @@ impl NestedType for VolumeUserInfo {} impl Part for VolumeUserInfo {} +/// 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 UsersettingsNotificationRewardExpirations { + /// no description provided + pub opted_state: Option, +} + +impl NestedType for UsersettingsNotificationRewardExpirations {} +impl Part for UsersettingsNotificationRewardExpirations {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3637,6 +3630,7 @@ impl<'a, C, A> MylibraryMethods<'a, C, A> { _source: Default::default(), _show_only_summary_in_response: Default::default(), _country: Default::default(), + _annotation_id: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -4047,7 +4041,7 @@ impl<'a, C, A> LayerAnnotationDataGetCall<'a, C, A> where C: BorrowMut LayerVolumeAnnotationGetCall<'a, C, A> where C: BorrowMut LayerListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "volumes/{volumeId}/layersummary"; + let mut url = "https://www.googleapis.com/books/v1/volumes/{volumeId}/layersummary".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4932,7 +4926,7 @@ impl<'a, C, A> LayerGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "volumes/{volumeId}/layersummary/{summaryId}"; + let mut url = "https://www.googleapis.com/books/v1/volumes/{volumeId}/layersummary/{summaryId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5255,7 +5249,7 @@ impl<'a, C, A> LayerVolumeAnnotationListCall<'a, C, A> where C: BorrowMut LayerAnnotationDataListCall<'a, C, A> where C: BorrowMut VolumeRecommendedRateCall<'a, C, A> where C: BorrowMut VolumeGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "volumes/{volumeId}"; + let mut url = "https://www.googleapis.com/books/v1/volumes/{volumeId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6569,7 +6563,7 @@ impl<'a, C, A> VolumeMybookListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "volumes/mybooks"; + let mut url = "https://www.googleapis.com/books/v1/volumes/mybooks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6889,7 +6883,7 @@ impl<'a, C, A> VolumeListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "volumes"; + let mut url = "https://www.googleapis.com/books/v1/volumes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7226,7 +7220,7 @@ impl<'a, C, A> VolumeUseruploadedListCall<'a, C, A> where C: BorrowMut VolumeAssociatedListCall<'a, C, A> where C: BorrowMut VolumeRecommendedListCall<'a, C, A> where C: BorrowMut DictionaryListOfflineMetadataCall<'a, C, A> where C: BorrowMut SeryGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "series/get"; + let mut url = "https://www.googleapis.com/books/v1/series/get".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8438,7 +8432,7 @@ impl<'a, C, A> SeryMembershipGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "series/membership/get"; + let mut url = "https://www.googleapis.com/books/v1/series/membership/get".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8688,7 +8682,7 @@ impl<'a, C, A> BookshelveVolumeListCall<'a, C, A> where C: BorrowMut BookshelveListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userId}/bookshelves"; + let mut url = "https://www.googleapis.com/books/v1/users/{userId}/bookshelves".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9215,7 +9209,7 @@ impl<'a, C, A> BookshelveGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/{userId}/bookshelves/{shelf}"; + let mut url = "https://www.googleapis.com/books/v1/users/{userId}/bookshelves/{shelf}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9504,7 +9498,7 @@ impl<'a, C, A> PromoofferAcceptCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "promooffer/accept"; + let mut url = "https://www.googleapis.com/books/v1/promooffer/accept".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9785,7 +9779,7 @@ impl<'a, C, A> PromoofferDismisCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "promooffer/dismiss"; + let mut url = "https://www.googleapis.com/books/v1/promooffer/dismiss".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10056,7 +10050,7 @@ impl<'a, C, A> PromoofferGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "promooffer/get"; + let mut url = "https://www.googleapis.com/books/v1/promooffer/get".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10315,7 +10309,7 @@ impl<'a, C, A> PersonalizedstreamGetCall<'a, C, A> where C: BorrowMut OnboardingListCategoryCall<'a, C, A> where C: BorrowMut OnboardingListCategoryVolumeCall<'a, C, A> where C: BorrowMut MyconfigRequestAccesCall<'a, C, A> where C: BorrowMut MyconfigReleaseDownloadAccesCall<'a, C, A> where C: BorrowMut MyconfigSyncVolumeLicenseCall<'a, C, A> where C: BorrowMut MyconfigGetUserSettingCall<'a, C, A> where C: BorrowMut MyconfigUpdateUserSettingCall<'a, C, A> where C: BorrowMut MylibraryBookshelveClearVolumeCall<'a, C, A> where C: BorrowMut MylibraryBookshelveMoveVolumeCall<'a, C, A> where C: BorrowMut MylibraryBookshelveVolumeListCall<'a, C, A> where C: BorrowMut MylibraryAnnotationSummaryCall<'a, C, A> where C: BorrowMut MylibraryAnnotationDeleteCall<'a, C, A> where C: BorrowMut MylibraryBookshelveAddVolumeCall<'a, C, A> where C: BorrowMut MylibraryBookshelveAddVolumeCall<'a, C, A> where C: BorrowMut _source: Option, _show_only_summary_in_response: Option, _country: Option, + _annotation_id: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -13827,7 +13823,7 @@ impl<'a, C, A> MylibraryAnnotationInsertCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); if let Some(value) = self._source { params.push(("source", value.to_string())); } @@ -13837,7 +13833,10 @@ impl<'a, C, A> MylibraryAnnotationInsertCall<'a, C, A> where C: BorrowMut MylibraryAnnotationInsertCall<'a, C, A> where C: BorrowMut MylibraryAnnotationInsertCall<'a, C, A> where C: BorrowMut MylibraryAnnotationInsertCall<'a, C, A> { + self._annotation_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. /// @@ -14055,8 +14061,8 @@ impl<'a, C, A> MylibraryAnnotationInsertCall<'a, C, A> where C: BorrowMut MylibraryBookshelveRemoveVolumeCall<'a, C, A> where C: BorrowMut< } - let mut url = self.hub._base_url.clone() + "mylibrary/bookshelves/{shelf}/removeVolume"; + let mut url = "https://www.googleapis.com/books/v1/mylibrary/bookshelves/{shelf}/removeVolume".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14315,16 +14321,16 @@ impl<'a, C, A> MylibraryBookshelveRemoveVolumeCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.mylibrary().annotations_list() -/// .volume_id("consetetur") -/// .updated_min("vero") -/// .updated_max("consetetur") -/// .source("eos") +/// .volume_id("vero") +/// .updated_min("consetetur") +/// .updated_max("eos") +/// .source("justo") /// .show_deleted(true) -/// .page_token("tempor") -/// .max_results(40) -/// .add_layer_ids("dolore") -/// .layer_id("amet.") -/// .content_version("dolore") +/// .page_token("gubergren") +/// .max_results(17) +/// .add_layer_ids("amet.") +/// .layer_id("dolore") +/// .content_version("magna") /// .doit(); /// # } /// ``` @@ -14408,7 +14414,7 @@ impl<'a, C, A> MylibraryAnnotationListCall<'a, C, A> where C: BorrowMut MylibraryAnnotationListCall<'a, C, A> where C: BorrowMut MylibraryAnnotationUpdateCall<'a, C, A> where C: BorrowMut MylibraryAnnotationUpdateCall<'a, C, A> where C: BorrowMut MylibraryReadingpositionSetPositionCall<'a, C, A> where C: Borrow } - let mut url = self.hub._base_url.clone() + "mylibrary/readingpositions/{volumeId}/setPosition"; + let mut url = "https://www.googleapis.com/books/v1/mylibrary/readingpositions/{volumeId}/setPosition".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15214,7 +15220,7 @@ impl<'a, C, A> MylibraryReadingpositionSetPositionCall<'a, C, A> where C: Borrow /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.mylibrary().bookshelves_get("shelf") -/// .source("diam") +/// .source("magna") /// .doit(); /// # } /// ``` @@ -15262,7 +15268,7 @@ impl<'a, C, A> MylibraryBookshelveGetCall<'a, C, A> where C: BorrowMut MylibraryBookshelveGetCall<'a, C, A> where C: BorrowMut MylibraryBookshelveListCall<'a, C, A> where C: BorrowMut MylibraryBookshelveListCall<'a, C, A> where C: BorrowMut MylibraryReadingpositionGetCall<'a, C, A> where C: BorrowMut MylibraryReadingpositionGetCall<'a, C, A> where C: BorrowMut NotificationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "notification/get"; + let mut url = "https://www.googleapis.com/books/v1/notification/get".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16172,10 +16178,10 @@ impl<'a, C, A> NotificationGetCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.cloudloading().add_book() -/// .upload_client_token("dolores") -/// .name("consetetur") -/// .mime_type("erat") -/// .drive_document_id("amet.") +/// .upload_client_token("consetetur") +/// .name("erat") +/// .mime_type("amet.") +/// .drive_document_id("dolores") /// .doit(); /// # } /// ``` @@ -16233,7 +16239,7 @@ impl<'a, C, A> CloudloadingAddBookCall<'a, C, A> where C: BorrowMut CloudloadingUpdateBookCall<'a, C, A> where C: BorrowMut CloudloadingDeleteBookCall<'a, C, A> where C: BorrowMut CloudloadingDeleteBookCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with calendar (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/calendar3-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-calendar3] path = "../calendar3" -version = "1.0.4+20161211" +version = "1.0.4+20170514" diff --git a/gen/calendar3-cli/README.md b/gen/calendar3-cli/README.md index 0aaf68972c..8ca5b869e5 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 *20161211*. The CLI is at version *1.0.4*. +This documentation was generated from the *calendar* API at revision *20170514*. The CLI is at version *1.0.4*. ```bash calendar3 [options] diff --git a/gen/calendar3-cli/mkdocs.yml b/gen/calendar3-cli/mkdocs.yml index 8d0edfb77f..6dbaf70848 100644 --- a/gen/calendar3-cli/mkdocs.yml +++ b/gen/calendar3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: calendar v1.0.4+20161211 +site_name: calendar v1.0.4+20170514 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 52cc000447..8184da525f 100644 --- a/gen/calendar3-cli/src/main.rs +++ b/gen/calendar3-cli/src/main.rs @@ -4386,7 +4386,7 @@ fn main() { let mut app = App::new("calendar3") .author("Sebastian Thiel ") - .version("1.0.4+20161211") + .version("1.0.4+20170514") .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 2392ca3259..e132aefb4a 100644 --- a/gen/calendar3/Cargo.toml +++ b/gen/calendar3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-calendar3" -version = "1.0.4+20161211" +version = "1.0.4+20170514" 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.4+20161211" +documentation = "https://docs.rs/google-calendar3/1.0.4+20170514" license = "MIT" keywords = ["calendar", "google", "protocol", "web", "api"] diff --git a/gen/calendar3/README.md b/gen/calendar3/README.md index 418b12c990..b6fa995009 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.4+20161211*, where *20161211* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *calendar* crate version *1.0.4+20170514*, where *20170514* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161211/google_calendar3/struct.CalendarHub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarHub.html) ... -* [acl](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.Acl.html) - * [*delete*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.AclDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.AclGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.AclInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.AclListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.AclPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.AclUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.AclWatchCall.html) -* [calendar list](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarList.html) - * [*delete*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarListDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarListGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarListInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarListListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarListPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarListUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarListWatchCall.html) -* [calendars](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.Calendar.html) - * [*clear*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarClearCall.html), [*delete*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarInsertCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarPatchCall.html) and [*update*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarUpdateCall.html) -* [channels](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.Channel.html) - * [*stop*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.ChannelStopCall.html) +* [acl](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.Acl.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.AclDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.AclGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.AclInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.AclListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.AclPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.AclUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.AclWatchCall.html) +* [calendar list](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarList.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarListDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarListGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarListInsertCall.html), [*list*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarListListCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarListPatchCall.html), [*update*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarListUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarListWatchCall.html) +* [calendars](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.Calendar.html) + * [*clear*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarClearCall.html), [*delete*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarGetCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarInsertCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarPatchCall.html) and [*update*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarUpdateCall.html) +* [channels](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.Channel.html) + * [*stop*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.ChannelStopCall.html) * colors - * [*get*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.ColorGetCall.html) -* [events](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.Event.html) - * [*delete*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventGetCall.html), [*import*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventImportCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventInsertCall.html), [*instances*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventInstanceCall.html), [*list*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventListCall.html), [*move*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventMoveCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventPatchCall.html), [*quick add*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventQuickAddCall.html), [*update*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventWatchCall.html) + * [*get*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.ColorGetCall.html) +* [events](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.Event.html) + * [*delete*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventDeleteCall.html), [*get*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventGetCall.html), [*import*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventImportCall.html), [*insert*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventInsertCall.html), [*instances*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventInstanceCall.html), [*list*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventListCall.html), [*move*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventMoveCall.html), [*patch*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventPatchCall.html), [*quick add*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventQuickAddCall.html), [*update*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventUpdateCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventWatchCall.html) * freebusy - * [*query*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.FreebusyQueryCall.html) -* [settings](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.Setting.html) - * [*get*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.SettingGetCall.html), [*list*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.SettingListCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.SettingWatchCall.html) + * [*query*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.FreebusyQueryCall.html) +* [settings](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.Setting.html) + * [*get*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.SettingGetCall.html), [*list*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.SettingListCall.html) and [*watch*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.SettingWatchCall.html) Subscription supported by ... -* [*list settings*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.SettingListCall.html) -* [*list events*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventListCall.html) -* [*list calendar list*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarListListCall.html) -* [*watch events*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventWatchCall.html) -* [*instances events*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.EventInstanceCall.html) -* [*watch settings*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.SettingWatchCall.html) -* [*watch acl*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.AclWatchCall.html) -* [*list acl*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.AclListCall.html) -* [*watch calendar list*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/struct.CalendarListWatchCall.html) +* [*list settings*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.SettingListCall.html) +* [*list events*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventListCall.html) +* [*list calendar list*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.CalendarListListCall.html) +* [*watch events*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventWatchCall.html) +* [*instances events*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.EventInstanceCall.html) +* [*watch settings*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.SettingWatchCall.html) +* [*watch acl*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.AclWatchCall.html) +* [*list acl*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/struct.AclListCall.html) +* [*watch calendar list*](https://docs.rs/google-calendar3/1.0.4+20170514/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.4+20161211/google_calendar3/struct.CalendarHub.html)** +* **[Hub](https://docs.rs/google-calendar3/1.0.4+20170514/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.4+20161211/google_calendar3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-calendar3/1.0.4+20170514/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.4+20161211/google_calendar3/trait.Part.html)** + * **[Parts](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-calendar3/1.0.4+20161211/google_calendar3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-calendar3/1.0.4+20170514/google_calendar3/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-calendar3/1.0.4+20161211/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.4+20170514/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.4+20161211/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.4+20170514/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.4+20161211/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.4+20170514/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.4+20161211/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.4+20170514/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")`. @@ -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-calendar3/1.0.4+20161211/google_calendar3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-calendar3/1.0.4+20161211/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.4+20170514/google_calendar3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-calendar3/1.0.4+20170514/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.4+20161211/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.4+20170514/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.4+20161211/google_calendar3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-calendar3/1.0.4+20161211/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.4+20170514/google_calendar3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-calendar3/1.0.4+20170514/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.4+20161211/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.4+20170514/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.4+20161211/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.4+20170514/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.4+20161211/google_calendar3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-calendar3/1.0.4+20170514/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 006b886067..12dedc99bc 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.4+20161211*, where *20161211* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *calendar* crate version *1.0.4+20170514*, where *20170514* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *calendar* *v3* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/calendar/firstapp). @@ -229,7 +229,7 @@ // 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 +// 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)] @@ -381,8 +381,6 @@ pub struct CalendarHub { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for CalendarHub {} @@ -395,8 +393,6 @@ impl<'a, C, A> CalendarHub client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/calendar/v3/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -434,26 +430,6 @@ impl<'a, C, A> CalendarHub self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/calendar/v3/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -492,21 +468,6 @@ impl NestedType for EventGadget {} impl Part for EventGadget {} -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FreeBusyCalendar { - /// List of time ranges during which this calendar should be regarded as busy. - pub busy: Option>, - /// Optional error(s) (if computation for the calendar failed). - pub errors: Option>, -} - -impl Part for FreeBusyCalendar {} - - /// The scope of the rule. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -528,34 +489,6 @@ impl NestedType for AclRuleScope {} impl Part for AclRuleScope {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list settings](struct.SettingListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Settings { - /// Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// List of user settings. - pub items: Option>, - /// Type of the collection ("calendar#settings"). - pub kind: Option, - /// Etag of the collection. - pub etag: Option, - /// Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided. - #[serde(rename="nextSyncToken")] - pub next_sync_token: Option, -} - -impl ResponseResult for Settings {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -621,6 +554,28 @@ impl Resource for Calendar {} impl ResponseResult for Calendar {} +/// The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EventOrganizer { + /// Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. + #[serde(rename="self")] + pub self_: Option, + /// The organizer's name, if available. + #[serde(rename="displayName")] + pub display_name: Option, + /// The organizer's email address, if available. It must be a valid email address as per RFC5322. + pub email: Option, + /// The organizer's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API + pub id: Option, +} + +impl NestedType for EventOrganizer {} +impl Part for EventOrganizer {} + + /// There is no detailed description. /// /// # Activities @@ -917,51 +872,6 @@ pub struct Events { impl ResponseResult for Events {} -/// There is no detailed description. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [stop channels](struct.ChannelStopCall.html) (request) -/// * [watch settings](struct.SettingWatchCall.html) (request|response) -/// * [watch acl](struct.AclWatchCall.html) (request|response) -/// * [watch calendar list](struct.CalendarListWatchCall.html) (request|response) -/// * [watch events](struct.EventWatchCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Channel { - /// A version-specific identifier for the watched resource. - #[serde(rename="resourceUri")] - pub resource_uri: Option, - /// Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". - pub kind: Option, - /// An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. - #[serde(rename="resourceId")] - pub resource_id: Option, - /// A UUID or similar unique string that identifies this channel. - pub id: Option, - /// An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. - pub token: Option, - /// Additional parameters controlling delivery channel behavior. Optional. - pub params: Option>, - /// Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. - pub expiration: Option, - /// The address where notifications are delivered for this channel. - pub address: Option, - /// The type of delivery mechanism used for this channel. - #[serde(rename="type")] - pub type_: Option, - /// A Boolean value to indicate whether payload is wanted. Optional. - pub payload: Option, -} - -impl RequestValue for Channel {} -impl Resource for Channel {} -impl ResponseResult for Channel {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1001,6 +911,22 @@ pub struct EventAttendee { impl Part for EventAttendee {} +/// Extended properties of the event. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EventExtendedProperties { + /// Properties that are shared between copies of the event on other attendees' calendars. + pub shared: Option>, + /// Properties that are private to the copy of the event that appears on this calendar. + pub private: Option>, +} + +impl NestedType for EventExtendedProperties {} +impl Part for EventExtendedProperties {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1033,6 +959,21 @@ impl NestedType for EventReminders {} impl Part for EventReminders {} +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FreeBusyCalendar { + /// List of time ranges during which this calendar should be regarded as busy. + pub busy: Option>, + /// Optional error(s) (if computation for the calendar failed). + pub errors: Option>, +} + +impl Part for FreeBusyCalendar {} + + /// There is no detailed description. /// /// # Activities @@ -1061,20 +1002,32 @@ pub struct CalendarList { impl ResponseResult for CalendarList {} -/// Extended properties of the event. +/// There is no detailed description. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list settings](struct.SettingListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EventExtendedProperties { - /// Properties that are shared between copies of the event on other attendees' calendars. - pub shared: Option>, - /// Properties that are private to the copy of the event that appears on this calendar. - pub private: Option>, +pub struct Settings { + /// Token used to access the next page of this result. Omitted if no further results are available, in which case nextSyncToken is provided. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// List of user settings. + pub items: Option>, + /// Type of the collection ("calendar#settings"). + pub kind: Option, + /// Etag of the collection. + pub etag: Option, + /// Token used at a later point in time to retrieve only the entries that have changed since this result was returned. Omitted if further results are available, in which case nextPageToken is provided. + #[serde(rename="nextSyncToken")] + pub next_sync_token: Option, } -impl NestedType for EventExtendedProperties {} -impl Part for EventExtendedProperties {} +impl ResponseResult for Settings {} /// There is no detailed description. @@ -1175,6 +1128,69 @@ pub struct FreeBusyRequest { impl RequestValue for FreeBusyRequest {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [stop channels](struct.ChannelStopCall.html) (request) +/// * [watch settings](struct.SettingWatchCall.html) (request|response) +/// * [watch acl](struct.AclWatchCall.html) (request|response) +/// * [watch calendar list](struct.CalendarListWatchCall.html) (request|response) +/// * [watch events](struct.EventWatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Channel { + /// A version-specific identifier for the watched resource. + #[serde(rename="resourceUri")] + pub resource_uri: Option, + /// Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". + pub kind: Option, + /// An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. + #[serde(rename="resourceId")] + pub resource_id: Option, + /// A UUID or similar unique string that identifies this channel. + pub id: Option, + /// An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. + pub token: Option, + /// Additional parameters controlling delivery channel behavior. Optional. + pub params: Option>, + /// Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. + pub expiration: Option, + /// The address where notifications are delivered for this channel. + pub address: Option, + /// The type of delivery mechanism used for this channel. + #[serde(rename="type")] + pub type_: Option, + /// A Boolean value to indicate whether payload is wanted. Optional. + pub payload: Option, +} + +impl RequestValue for Channel {} +impl Resource for Channel {} +impl ResponseResult for Channel {} + + +/// There is no detailed description. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EventReminder { + /// Number of minutes before the start of the event when the reminder should trigger. Valid values are between 0 and 40320 (4 weeks in minutes). + pub minutes: Option, + /// The method used by this reminder. Possible values are: + /// - "email" - Reminders are sent via email. + /// - "sms" - Reminders are sent via SMS. These are only available for G Suite customers. Requests to set SMS reminders for other account types are ignored. + /// - "popup" - Reminders are sent via a UI popup. + pub method: Option, +} + +impl Part for EventReminder {} + + /// Source from which the event was created. For example, a web page, an email message or any document identifiable by an URL with HTTP or HTTPS scheme. Can only be seen or modified by the creator of the event. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1191,46 +1207,6 @@ impl NestedType for EventSource {} impl Part for EventSource {} -/// The organizer of the event. If the organizer is also an attendee, this is indicated with a separate entry in attendees with the organizer field set to True. To change the organizer, use the move operation. Read-only, except when importing an event. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EventOrganizer { - /// Whether the organizer corresponds to the calendar on which this copy of the event appears. Read-only. The default is False. - #[serde(rename="self")] - pub self_: Option, - /// The organizer's name, if available. - #[serde(rename="displayName")] - pub display_name: Option, - /// The organizer's email address, if available. It must be a valid email address as per RFC5322. - pub email: Option, - /// The organizer's Profile ID, if available. It corresponds to theid field in the People collection of the Google+ API - pub id: Option, -} - -impl NestedType for EventOrganizer {} -impl Part for EventOrganizer {} - - -/// There is no detailed description. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EventReminder { - /// Number of minutes before the start of the event when the reminder should trigger. Valid values are between 0 and 40320 (4 weeks in minutes). - pub minutes: Option, - /// The method used by this reminder. Possible values are: - /// - "email" - Reminders are sent via email. - /// - "sms" - Reminders are sent via SMS. These are only available for Google Apps for Work, Education, and Government customers. Requests to set SMS reminders for other account types are ignored. - /// - "popup" - Reminders are sent via a UI popup. - pub method: Option, -} - -impl Part for EventReminder {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1262,7 +1238,7 @@ pub struct CalendarNotification { pub type_: Option, /// The method used to deliver the notification. Possible values are: /// - "email" - Reminders are sent via email. - /// - "sms" - Reminders are sent via SMS. This value is read-only and is ignored on inserts and updates. SMS reminders are only available for Google Apps for Work, Education, and Government customers. + /// - "sms" - Reminders are sent via SMS. This value is read-only and is ignored on inserts and updates. SMS reminders are only available for G Suite customers. pub method: Option, } @@ -2570,7 +2546,7 @@ impl<'a, C, A> FreebusyQueryCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "freeBusy"; + let mut url = "https://www.googleapis.com/calendar/v3/freeBusy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2811,7 +2787,7 @@ impl<'a, C, A> SettingListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/me/settings"; + let mut url = "https://www.googleapis.com/calendar/v3/users/me/settings".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3059,7 +3035,7 @@ impl<'a, C, A> SettingWatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/me/settings/watch"; + let mut url = "https://www.googleapis.com/calendar/v3/users/me/settings/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3311,7 +3287,7 @@ impl<'a, C, A> SettingGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/me/settings/{setting}"; + let mut url = "https://www.googleapis.com/calendar/v3/users/me/settings/{setting}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3558,7 +3534,7 @@ impl<'a, C, A> CalendarListUpdateCall<'a, C, A> where C: BorrowMut CalendarListDeleteCall<'a, C, A> where C: BorrowMut CalendarListGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/me/calendarList/{calendarId}"; + let mut url = "https://www.googleapis.com/calendar/v3/users/me/calendarList/{calendarId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4311,7 +4287,7 @@ impl<'a, C, A> CalendarListListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/me/calendarList"; + let mut url = "https://www.googleapis.com/calendar/v3/users/me/calendarList".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4571,7 +4547,7 @@ impl<'a, C, A> CalendarListInsertCall<'a, C, A> where C: BorrowMut CalendarListPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/me/calendarList/{calendarId}"; + let mut url = "https://www.googleapis.com/calendar/v3/users/me/calendarList/{calendarId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5119,7 +5095,7 @@ impl<'a, C, A> CalendarListWatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/me/calendarList/watch"; + let mut url = "https://www.googleapis.com/calendar/v3/users/me/calendarList/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5400,7 +5376,7 @@ impl<'a, C, A> CalendarPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5658,7 +5634,7 @@ impl<'a, C, A> CalendarDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5883,7 +5859,7 @@ impl<'a, C, A> CalendarGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6117,7 +6093,7 @@ impl<'a, C, A> CalendarClearCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/clear"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/clear".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6347,7 +6323,7 @@ impl<'a, C, A> CalendarInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6582,7 +6558,7 @@ impl<'a, C, A> CalendarUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6868,7 +6844,7 @@ impl<'a, C, A> AclWatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl/watch"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7165,7 +7141,7 @@ impl<'a, C, A> AclInsertCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7433,7 +7409,7 @@ impl<'a, C, A> AclUpdateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl/{ruleId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl/{ruleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7711,7 +7687,7 @@ impl<'a, C, A> AclPatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl/{ruleId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl/{ruleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8000,7 +7976,7 @@ impl<'a, C, A> AclListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8267,7 +8243,7 @@ impl<'a, C, A> AclDeleteCall<'a, C, A> where C: BorrowMut, A: oau } - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl/{ruleId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl/{ruleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8504,7 +8480,7 @@ impl<'a, C, A> AclGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/acl/{ruleId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/acl/{ruleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8753,7 +8729,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "channels/stop"; + let mut url = "https://www.googleapis.com/calendar/v3/channels/stop".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8969,7 +8945,7 @@ impl<'a, C, A> ColorGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "colors"; + let mut url = "https://www.googleapis.com/calendar/v3/colors".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9179,7 +9155,7 @@ impl<'a, C, A> EventDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9443,7 +9419,7 @@ impl<'a, C, A> EventInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9735,7 +9711,7 @@ impl<'a, C, A> EventImportCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/import"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/import".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10048,7 +10024,7 @@ impl<'a, C, A> EventInstanceCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}/instances"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}/instances".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10373,7 +10349,7 @@ impl<'a, C, A> EventGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10728,7 +10704,7 @@ impl<'a, C, A> EventListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11126,7 +11102,7 @@ impl<'a, C, A> EventPatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11432,7 +11408,7 @@ impl<'a, C, A> EventMoveCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}/move"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}/move".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11723,7 +11699,7 @@ impl<'a, C, A> EventUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/{eventId}"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/{eventId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12116,7 +12092,7 @@ impl<'a, C, A> EventWatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/watch"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12516,7 +12492,7 @@ impl<'a, C, A> EventQuickAddCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "calendars/{calendarId}/events/quickAdd"; + let mut url = "https://www.googleapis.com/calendar/v3/calendars/{calendarId}/events/quickAdd".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12698,3 +12674,4 @@ impl<'a, C, A> EventQuickAddCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/classroom1-cli/Cargo.toml b/gen/classroom1-cli/Cargo.toml index d7e1213df5..9b9b3e68d5 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.4+20161006" +version = "1.0.4+20170510" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-classroom1] path = "../classroom1" -version = "1.0.4+20161006" +version = "1.0.4+20170510" diff --git a/gen/classroom1-cli/README.md b/gen/classroom1-cli/README.md index b9cf3463ae..6b05ecd622 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 *20161006*. The CLI is at version *1.0.4*. +This documentation was generated from the *classroom* API at revision *20170510*. The CLI is at version *1.0.4*. ```bash classroom1 [options] @@ -34,8 +34,10 @@ classroom1 [options] aliases-delete [-p ]... [-o ] aliases-list [-p ]... [-o ] course-work-create (-r )... [-p ]... [-o ] + course-work-delete [-p ]... [-o ] course-work-get [-p ]... [-o ] course-work-list [-p ]... [-o ] + course-work-patch (-r )... [-p ]... [-o ] course-work-student-submissions-get [-p ]... [-o ] course-work-student-submissions-list [-p ]... [-o ] course-work-student-submissions-modify-attachments (-r )... [-p ]... [-o ] diff --git a/gen/classroom1-cli/mkdocs.yml b/gen/classroom1-cli/mkdocs.yml index f925d640ff..7e1aa2311a 100644 --- a/gen/classroom1-cli/mkdocs.yml +++ b/gen/classroom1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: classroom v1.0.4+20161006 +site_name: classroom v1.0.4+20170510 site_url: http://byron.github.io/google-apis-rs/google-classroom1-cli site_description: A complete library to interact with classroom (protocol v1) @@ -13,8 +13,10 @@ pages: - ['courses_aliases-delete.md', 'Courses', 'Aliases Delete'] - ['courses_aliases-list.md', 'Courses', 'Aliases List'] - ['courses_course-work-create.md', 'Courses', 'Course Work Create'] +- ['courses_course-work-delete.md', 'Courses', 'Course Work Delete'] - ['courses_course-work-get.md', 'Courses', 'Course Work Get'] - ['courses_course-work-list.md', 'Courses', 'Course Work List'] +- ['courses_course-work-patch.md', 'Courses', 'Course Work Patch'] - ['courses_course-work-student-submissions-get.md', 'Courses', 'Course Work Student Submissions Get'] - ['courses_course-work-student-submissions-list.md', 'Courses', 'Course Work Student Submissions List'] - ['courses_course-work-student-submissions-modify-attachments.md', 'Courses', 'Course Work Student Submissions Modify Attachments'] diff --git a/gen/classroom1-cli/src/main.rs b/gen/classroom1-cli/src/main.rs index 30d5de4dc5..1640b3ad33 100644 --- a/gen/classroom1-cli/src/main.rs +++ b/gen/classroom1-cli/src/main.rs @@ -268,25 +268,25 @@ impl<'n> Engine<'n> { "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "submission-modification-mode" => Some(("submissionModificationMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "title" => Some(("title", 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 })), "assignment.student-work-folder.alternate-link" => Some(("assignment.studentWorkFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "assignment.student-work-folder.id" => Some(("assignment.studentWorkFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "assignment.student-work-folder.title" => Some(("assignment.studentWorkFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "associated-with-developer" => Some(("associatedWithDeveloper", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-points" => Some(("maxPoints", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "multiple-choice-question.choices" => Some(("multipleChoiceQuestion.choices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "due-date.month" => Some(("dueDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "due-date.day" => Some(("dueDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "due-date.year" => Some(("dueDate.year", JsonTypeInfo { jtype: JsonType::Int, 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 })), - "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 })), "due-time.minutes" => Some(("dueTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "due-time.nanos" => Some(("dueTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "work-type" => Some(("workType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "assignment", "associated-with-developer", "choices", "course-id", "creation-time", "day", "description", "due-date", "due-time", "hours", "id", "max-points", "minutes", "month", "multiple-choice-question", "nanos", "seconds", "state", "student-work-folder", "submission-modification-mode", "title", "update-time", "work-type", "year"]); @@ -349,6 +349,58 @@ impl<'n> Engine<'n> { } } + fn _courses_course_work_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.courses().course_work_delete(opt.value_of("course-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _courses_course_work_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.courses().course_work_get(opt.value_of("course-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); @@ -466,6 +518,117 @@ impl<'n> Engine<'n> { } } + fn _courses_course_work_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 })), + "submission-modification-mode" => Some(("submissionModificationMode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", 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 })), + "assignment.student-work-folder.alternate-link" => Some(("assignment.studentWorkFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "assignment.student-work-folder.id" => Some(("assignment.studentWorkFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "assignment.student-work-folder.title" => Some(("assignment.studentWorkFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "associated-with-developer" => Some(("associatedWithDeveloper", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "max-points" => Some(("maxPoints", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "multiple-choice-question.choices" => Some(("multipleChoiceQuestion.choices", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "due-date.month" => Some(("dueDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "due-date.day" => Some(("dueDate.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "due-date.year" => Some(("dueDate.year", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "due-time.hours" => Some(("dueTime.hours", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "due-time.nanos" => Some(("dueTime.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "due-time.seconds" => Some(("dueTime.seconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "due-time.minutes" => Some(("dueTime.minutes", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "work-type" => Some(("workType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "assignment", "associated-with-developer", "choices", "course-id", "creation-time", "day", "description", "due-date", "due-time", "hours", "id", "max-points", "minutes", "month", "multiple-choice-question", "nanos", "seconds", "state", "student-work-folder", "submission-modification-mode", "title", "update-time", "work-type", "year"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CourseWork = json::value::from_value(object).unwrap(); + let mut call = self.hub.courses().course_work_patch(request, opt.value_of("course-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _courses_course_work_student_submissions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.courses().course_work_student_submissions_get(opt.value_of("course-id").unwrap_or(""), opt.value_of("course-work-id").unwrap_or(""), opt.value_of("id").unwrap_or("")); @@ -1050,22 +1213,22 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "room" => Some(("room", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enrollment-code" => Some(("enrollmentCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "section" => Some(("section", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "guardians-enabled" => Some(("guardiansEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "course-group-email" => Some(("courseGroupEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-group-email" => Some(("teacherGroupEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner-id" => Some(("ownerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.alternate-link" => Some(("teacherFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.id" => Some(("teacherFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.title" => Some(("teacherFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "course-state" => Some(("courseState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description-heading" => Some(("descriptionHeading", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "room" => Some(("room", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "course-group-email", "course-state", "creation-time", "description", "description-heading", "enrollment-code", "guardians-enabled", "id", "name", "owner-id", "room", "section", "teacher-folder", "teacher-group-email", "title", "update-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -1324,22 +1487,22 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "room" => Some(("room", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enrollment-code" => Some(("enrollmentCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "section" => Some(("section", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "guardians-enabled" => Some(("guardiansEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "course-group-email" => Some(("courseGroupEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-group-email" => Some(("teacherGroupEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner-id" => Some(("ownerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.alternate-link" => Some(("teacherFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.id" => Some(("teacherFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.title" => Some(("teacherFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "course-state" => Some(("courseState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description-heading" => Some(("descriptionHeading", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "room" => Some(("room", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "course-group-email", "course-state", "creation-time", "description", "description-heading", "enrollment-code", "guardians-enabled", "id", "name", "owner-id", "room", "section", "teacher-folder", "teacher-group-email", "title", "update-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -1947,22 +2110,22 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "update-time" => Some(("updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "room" => Some(("room", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "enrollment-code" => Some(("enrollmentCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "section" => Some(("section", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "guardians-enabled" => Some(("guardiansEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "course-group-email" => Some(("courseGroupEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-group-email" => Some(("teacherGroupEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner-id" => Some(("ownerId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.alternate-link" => Some(("teacherFolder.alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.id" => Some(("teacherFolder.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "teacher-folder.title" => Some(("teacherFolder.title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "course-state" => Some(("courseState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description-heading" => Some(("descriptionHeading", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "room" => Some(("room", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["alternate-link", "course-group-email", "course-state", "creation-time", "description", "description-heading", "enrollment-code", "guardians-enabled", "id", "name", "owner-id", "room", "section", "teacher-folder", "teacher-group-email", "title", "update-time"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -2100,8 +2263,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"]); @@ -2408,11 +2571,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "invitation-id" => Some(("invitationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "student-id" => Some(("studentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "invited-email-address" => Some(("invitedEmailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "invitation-id" => Some(("invitationId", 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())))); @@ -2605,11 +2768,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "invitation-id" => Some(("invitationId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "student-id" => Some(("studentId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "invited-email-address" => Some(("invitedEmailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "invitation-id" => Some(("invitationId", 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())))); @@ -2848,12 +3011,18 @@ impl<'n> Engine<'n> { ("course-work-create", Some(opt)) => { call_result = self._courses_course_work_create(opt, dry_run, &mut err); }, + ("course-work-delete", Some(opt)) => { + call_result = self._courses_course_work_delete(opt, dry_run, &mut err); + }, ("course-work-get", Some(opt)) => { call_result = self._courses_course_work_get(opt, dry_run, &mut err); }, ("course-work-list", Some(opt)) => { call_result = self._courses_course_work_list(opt, dry_run, &mut err); }, + ("course-work-patch", Some(opt)) => { + call_result = self._courses_course_work_patch(opt, dry_run, &mut err); + }, ("course-work-student-submissions-get", Some(opt)) => { call_result = self._courses_course_work_student_submissions_get(opt, dry_run, &mut err); }, @@ -3064,14 +3233,26 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("courses", "methods: 'aliases-create', 'aliases-delete', 'aliases-list', 'course-work-create', 'course-work-get', 'course-work-list', 'course-work-student-submissions-get', 'course-work-student-submissions-list', 'course-work-student-submissions-modify-attachments', 'course-work-student-submissions-patch', 'course-work-student-submissions-reclaim', 'course-work-student-submissions-return', 'course-work-student-submissions-turn-in', 'create', 'delete', 'get', 'list', 'patch', 'students-create', 'students-delete', 'students-get', 'students-list', 'teachers-create', 'teachers-delete', 'teachers-get', 'teachers-list' and 'update'", vec![ + ("courses", "methods: 'aliases-create', 'aliases-delete', 'aliases-list', 'course-work-create', 'course-work-delete', 'course-work-get', 'course-work-list', 'course-work-patch', 'course-work-student-submissions-get', 'course-work-student-submissions-list', 'course-work-student-submissions-modify-attachments', 'course-work-student-submissions-patch', 'course-work-student-submissions-reclaim', 'course-work-student-submissions-return', 'course-work-student-submissions-turn-in', 'create', 'delete', 'get', 'list', 'patch', 'students-create', 'students-delete', 'students-get', 'students-list', 'teachers-create', 'teachers-delete', 'teachers-get', 'teachers-list' and 'update'", vec![ ("aliases-create", - Some(r##"Creates an alias for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for access errors. * `NOT_FOUND` if the course does not exist. * `ALREADY_EXISTS` if the alias already exists."##), + Some(r##"Creates an alias for a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to create the + alias or for access errors. + * `NOT_FOUND` if the course does not exist. + * `ALREADY_EXISTS` if the alias already exists. + * `FAILED_PRECONDITION` if the alias requested does not make sense for the + requesting user or course (for example, if a user not in a domain + attempts to access a domain-scoped alias)."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_aliases-create", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course to alias. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course to alias. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3094,18 +3275,30 @@ fn main() { Some(false)), ]), ("aliases-delete", - Some(r##"Deletes an alias of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to remove the alias or for access errors. * `NOT_FOUND` if the alias does not exist."##), + Some(r##"Deletes an alias of a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to remove the + alias or for access errors. + * `NOT_FOUND` if the alias does not exist. + * `FAILED_PRECONDITION` if the alias requested does not make sense for the + requesting user or course (for example, if a user not in a domain + attempts to delete a domain-scoped alias)."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_aliases-delete", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course whose alias should be deleted. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course whose alias should be deleted. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), (Some(r##"alias"##), None, - Some(r##"Alias to delete. This may not be the Classroom-assigned identifier."##), + Some(r##"Alias to delete. + This may not be the Classroom-assigned identifier."##), Some(true), Some(false)), @@ -3122,12 +3315,20 @@ fn main() { Some(false)), ]), ("aliases-list", - Some(r##"Returns a list of aliases for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the course or for access errors. * `NOT_FOUND` if the course does not exist."##), + Some(r##"Returns a list of aliases for a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + course or for access errors. + * `NOT_FOUND` if the course does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_aliases-list", vec![ (Some(r##"course-id"##), None, - Some(r##"The identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"The identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3144,12 +3345,31 @@ fn main() { Some(false)), ]), ("course-work-create", - Some(r##"Creates course work. The resulting course work (and corresponding student submissions) are associated with the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to make the request. Classroom API requests to modify course work and student submissions must be made with an OAuth client ID from the associated Developer Console project. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create course work in the requested course, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist."##), + Some(r##"Creates course work. + + The resulting course work (and corresponding student submissions) are + associated with the Developer Console project of the + [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + make the request. Classroom API requests to modify course work and student + submissions must be made with an OAuth client ID from the associated + Developer Console project. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course, create course work in the requested course, share a + Drive attachment, or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course does not exist. + * `FAILED_PRECONDITION` for the following request error: + * AttachmentNotVisible"##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-create", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3165,6 +3385,50 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("course-work-delete", + Some(r##"Deletes a course work. + + This request must be made by the Developer Console project of the + [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + create the corresponding course work item. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting developer project did not create + the corresponding course work, if the requesting user is not permitted + to delete the requested course or for access errors. + * `FAILED_PRECONDITION` if the requested course work has already been + deleted. + * `NOT_FOUND` if no course exists with the requested ID."##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-delete", + vec![ + (Some(r##"course-id"##), + None, + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Identifier of the course work to delete. + This identifier is a Classroom-assigned identifier."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3172,12 +3436,21 @@ fn main() { Some(false)), ]), ("course-work-get", - Some(r##"Returns course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or course work does not exist."##), + Some(r##"Returns course work. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course or course work, or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course or course work does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-get", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3200,12 +3473,24 @@ fn main() { Some(false)), ]), ("course-work-list", - Some(r##"Returns a list of course work that the requester is permitted to view. Course students may only view `PUBLISHED` course work. Course teachers and domain administrators may view all course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist."##), + Some(r##"Returns a list of course work that the requester is permitted to view. + + Course students may only view `PUBLISHED` course work. Course teachers + and domain administrators may view all course work. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access + the requested course or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-list", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3215,6 +3500,61 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("course-work-patch", + Some(r##"Updates one or more fields of a course work. + + See google.classroom.v1.CourseWork for details + of which fields may be updated and who may change them. + + This request must be made by the Developer Console project of the + [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + create the corresponding course work item. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting developer project did not create + the corresponding course work, if the user is not permitted to make the + requested modification to the student submission, or for + access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `FAILED_PRECONDITION` if the requested course work has already been + deleted. + * `NOT_FOUND` if the requested course, course work, or student submission + does not exist."##), + "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-patch", + vec![ + (Some(r##"course-id"##), + None, + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"Identifier of the course work."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3222,12 +3562,21 @@ fn main() { Some(false)), ]), ("course-work-student-submissions-get", - Some(r##"Returns a student submission. * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, course work, or student submission or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist."##), + Some(r##"Returns a student submission. + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course, course work, or student submission or for + access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course, course work, or student submission + does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-student-submissions-get", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3256,18 +3605,35 @@ fn main() { Some(false)), ]), ("course-work-student-submissions-list", - Some(r##"Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. `-` may be specified as the `course_work_id` to include student submissions for multiple course work items. Course students may only view their own work. Course teachers and domain administrators may view all student submissions. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist."##), + Some(r##"Returns a list of student submissions that the requester is permitted to + view, factoring in the OAuth scopes of the request. + `-` may be specified as the `course_work_id` to include student + submissions for multiple course work items. + + Course students may only view their own work. Course teachers + and domain administrators may view all student submissions. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course or course work, or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-student-submissions-list", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), (Some(r##"course-work-id"##), None, - Some(r##"Identifer of the student work to request. This may be set to the string literal `"-"` to request student work for all course work in the specified course."##), + Some(r##"Identifer of the student work to request. + This may be set to the string literal `"-"` to request student work for + all course work in the specified course."##), Some(true), Some(false)), @@ -3284,12 +3650,31 @@ fn main() { Some(false)), ]), ("course-work-student-submissions-modify-attachments", - Some(r##"Modifies attachments of student submission. Attachments may only be added to student submissions whose type is `ASSIGNMENT`. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, if the user is not permitted to modify attachments on the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist."##), + Some(r##"Modifies attachments of student submission. + + Attachments may only be added to student submissions belonging to course + work objects with a `workType` of `ASSIGNMENT`. + + This request must be made by the Developer Console project of the + [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + create the corresponding course work item. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course or course work, if the user is not permitted to modify + attachments on the requested student submission, or for + access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course, course work, or student submission + does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-student-submissions-modify-attachments", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3324,12 +3709,31 @@ fn main() { Some(false)), ]), ("course-work-student-submissions-patch", - Some(r##"Updates one or more fields of a student submission. See google.classroom.v1.StudentSubmission for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist."##), + Some(r##"Updates one or more fields of a student submission. + + See google.classroom.v1.StudentSubmission for details + of which fields may be updated and who may change them. + + This request must be made by the Developer Console project of the + [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + create the corresponding course work item. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting developer project did not create + the corresponding course work, if the user is not permitted to make the + requested modification to the student submission, or for + access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course, course work, or student submission + does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-student-submissions-patch", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3364,12 +3768,34 @@ fn main() { Some(false)), ]), ("course-work-student-submissions-reclaim", - Some(r##"Reclaims a student submission on behalf of the student that owns it. Reclaiming a student submission transfers ownership of attached Drive files to the student and update the submission state. Only the student that ownes the requested student submission may call this method, and only for a student submission that has been turned in. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, unsubmit the requested student submission, or for access errors. * `FAILED_PRECONDITION` if the student submission has not been turned in. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist."##), + Some(r##"Reclaims a student submission on behalf of the student that owns it. + + Reclaiming a student submission transfers ownership of attached Drive + files to the student and update the submission state. + + Only the student that owns the requested student submission may call this + method, and only for a student submission that has been turned in. + + This request must be made by the Developer Console project of the + [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + create the corresponding course work item. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course or course work, unsubmit the requested student submission, + or for access errors. + * `FAILED_PRECONDITION` if the student submission has not been turned in. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course, course work, or student submission + does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-student-submissions-reclaim", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3404,12 +3830,35 @@ fn main() { Some(false)), ]), ("course-work-student-submissions-return", - Some(r##"Returns a student submission. Returning a student submission transfers ownership of attached Drive files to the student and may also update the submission state. Unlike the Classroom application, returning a student submission does not set assignedGrade to the draftGrade value. Only a teacher of the course that contains the requested student submission may call this method. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, return the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist."##), + Some(r##"Returns a student submission. + + Returning a student submission transfers ownership of attached Drive + files to the student and may also update the submission state. + Unlike the Classroom application, returning a student submission does not + set assignedGrade to the draftGrade value. + + Only a teacher of the course that contains the requested student submission + may call this method. + + This request must be made by the Developer Console project of the + [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + create the corresponding course work item. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course or course work, return the requested student submission, + or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course, course work, or student submission + does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-student-submissions-return", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3444,12 +3893,33 @@ fn main() { Some(false)), ]), ("course-work-student-submissions-turn-in", - Some(r##"Turns in a student submission. Turning in a student submission transfers ownership of attached Drive files to the teacher and may also update the submission state. This may only be called by the student that owns the specified student submission. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, turn in the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist."##), + Some(r##"Turns in a student submission. + + Turning in a student submission transfers ownership of attached Drive + files to the teacher and may also update the submission state. + + This may only be called by the student that owns the specified student + submission. + + This request must be made by the Developer Console project of the + [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + create the corresponding course work item. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course or course work, turn in the requested student submission, + or for access errors. + * `INVALID_ARGUMENT` if the request is malformed. + * `NOT_FOUND` if the requested course, course work, or student submission + does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_course-work-student-submissions-turn-in", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3484,7 +3954,21 @@ fn main() { Some(false)), ]), ("create", - Some(r##"Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors. * `NOT_FOUND` if the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was specified in the `id` and already exists."##), + Some(r##"Creates a course. + + The user specified in `ownerId` is the owner of the created course + and added as a teacher. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to create + courses or for access errors. + * `NOT_FOUND` if the primary teacher is not a valid user. + * `FAILED_PRECONDITION` if the course owner's account is disabled or for + the following request errors: + * UserGroupsMembershipLimitReached + * `ALREADY_EXISTS` if an alias was specified in the `id` and + already exists."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_create", vec![ (Some(r##"kv"##), @@ -3506,12 +3990,20 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID."##), + Some(r##"Deletes a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + requested course or for access errors. + * `NOT_FOUND` if no course exists with the requested ID."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_delete", vec![ (Some(r##"id"##), None, - Some(r##"Identifier of the course to delete. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course to delete. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3528,12 +4020,20 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Returns a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID."##), + Some(r##"Returns a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access the + requested course or for access errors. + * `NOT_FOUND` if no course exists with the requested ID."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_get", vec![ (Some(r##"id"##), None, - Some(r##"Identifier of the course to return. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course to return. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3550,7 +4050,14 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the query argument is malformed. * `NOT_FOUND` if any users specified in the query arguments do not exist."##), + Some(r##"Returns a list of courses that the requesting user is permitted to view, + restricted to those that match the request. + + This method returns the following error codes: + + * `PERMISSION_DENIED` for access errors. + * `INVALID_ARGUMENT` if the query argument is malformed. + * `NOT_FOUND` if any users specified in the query arguments do not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_list", vec![ (Some(r##"v"##), @@ -3566,12 +4073,24 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates one or more fields in a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable"##), + Some(r##"Updates one or more fields in a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + requested course or for access errors. + * `NOT_FOUND` if no course exists with the requested ID. + * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or + if no update mask is supplied. + * `FAILED_PRECONDITION` for the following request errors: + * CourseNotModifiable"##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_patch", vec![ (Some(r##"id"##), None, - Some(r##"Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course to update. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3594,12 +4113,27 @@ fn main() { Some(false)), ]), ("students-create", - Some(r##"Adds a user as a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create students in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is already a student or teacher in the course."##), + Some(r##"Adds a user as a student of a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to create + students in this course or for access errors. + * `NOT_FOUND` if the requested course ID does not exist. + * `FAILED_PRECONDITION` if the requested user's account is disabled, + for the following request errors: + * CourseMemberLimitReached + * CourseNotModifiable + * UserGroupsMembershipLimitReached + * `ALREADY_EXISTS` if the user is already a student or teacher in the + course."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_students-create", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course to create the student in. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course to create the student in. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3622,18 +4156,32 @@ fn main() { Some(false)), ]), ("students-delete", - Some(r##"Deletes a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist."##), + Some(r##"Deletes a student of a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to delete + students of this course or for access errors. + * `NOT_FOUND` if no student of this course has the requested ID or if the + course does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_students-delete", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), (Some(r##"user-id"##), None, - Some(r##"Identifier of the student to delete. 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"##), + Some(r##"Identifier of the student to delete. 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"##), Some(true), Some(false)), @@ -3650,18 +4198,32 @@ fn main() { Some(false)), ]), ("students-get", - Some(r##"Returns a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist."##), + Some(r##"Returns a student of a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to view + students of this course or for access errors. + * `NOT_FOUND` if no student of this course has the requested ID or if the + course does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_students-get", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), (Some(r##"user-id"##), None, - Some(r##"Identifier of the student to return. 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"##), + Some(r##"Identifier of the student to return. 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"##), Some(true), Some(false)), @@ -3678,12 +4240,20 @@ fn main() { Some(false)), ]), ("students-list", - Some(r##"Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors."##), + Some(r##"Returns a list of students of this course that the requester + is permitted to view. + + This method returns the following error codes: + + * `NOT_FOUND` if the course does not exist. + * `PERMISSION_DENIED` for access errors."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_students-list", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3700,12 +4270,28 @@ fn main() { Some(false)), ]), ("teachers-create", - Some(r##"Creates a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create teachers in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is already a teacher or student in the course."##), + Some(r##"Creates a teacher of a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to create + teachers in this course or for access errors. + * `NOT_FOUND` if the requested course ID does not exist. + * `FAILED_PRECONDITION` if the requested user's account is disabled, + for the following request errors: + * CourseMemberLimitReached + * CourseNotModifiable + * CourseTeacherLimitReached + * UserGroupsMembershipLimitReached + * `ALREADY_EXISTS` if the user is already a teacher or student in the + course."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_teachers-create", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3728,18 +4314,34 @@ fn main() { Some(false)), ]), ("teachers-delete", - Some(r##"Deletes a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher of this course."##), + Some(r##"Deletes a teacher of a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to delete + teachers of this course or for access errors. + * `NOT_FOUND` if no teacher of this course has the requested ID or if the + course does not exist. + * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher + of this course."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_teachers-delete", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), (Some(r##"user-id"##), None, - Some(r##"Identifier of the teacher to delete. 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"##), + Some(r##"Identifier of the teacher to delete. 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"##), Some(true), Some(false)), @@ -3756,18 +4358,32 @@ fn main() { Some(false)), ]), ("teachers-get", - Some(r##"Returns a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist."##), + Some(r##"Returns a teacher of a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to view + teachers of this course or for access errors. + * `NOT_FOUND` if no teacher of this course has the requested ID or if the + course does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_teachers-get", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), (Some(r##"user-id"##), None, - Some(r##"Identifier of the teacher to return. 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"##), + Some(r##"Identifier of the teacher to return. 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"##), Some(true), Some(false)), @@ -3784,12 +4400,20 @@ fn main() { Some(false)), ]), ("teachers-list", - Some(r##"Returns a list of teachers of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors."##), + Some(r##"Returns a list of teachers of this course that the requester + is permitted to view. + + This method returns the following error codes: + + * `NOT_FOUND` if the course does not exist. + * `PERMISSION_DENIED` for access errors."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_teachers-list", vec![ (Some(r##"course-id"##), None, - Some(r##"Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3806,12 +4430,22 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable"##), + Some(r##"Updates a course. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + requested course or for access errors. + * `NOT_FOUND` if no course exists with the requested ID. + * `FAILED_PRECONDITION` for the following request errors: + * CourseNotModifiable"##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/courses_update", vec![ (Some(r##"id"##), None, - Some(r##"Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias."##), + Some(r##"Identifier of the course to update. + This identifier can be either the Classroom-assigned identifier or an + alias."##), Some(true), Some(false)), @@ -3837,7 +4471,20 @@ fn main() { ("invitations", "methods: 'accept', 'create', 'delete', 'get' and 'list'", vec![ ("accept", - Some(r##"Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to accept the requested invitation or for access errors. * `FAILED_PRECONDITION` for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `NOT_FOUND` if no invitation exists with the requested ID."##), + Some(r##"Accepts an invitation, removing it and adding the invited user to the + teachers or students (as appropriate) of the specified course. Only the + invited user may accept an invitation. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to accept the + requested invitation or for access errors. + * `FAILED_PRECONDITION` for the following request errors: + * CourseMemberLimitReached + * CourseNotModifiable + * CourseTeacherLimitReached + * UserGroupsMembershipLimitReached + * `NOT_FOUND` if no invitation exists with the requested ID."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/invitations_accept", vec![ (Some(r##"id"##), @@ -3859,7 +4506,18 @@ fn main() { Some(false)), ]), ("create", - Some(r##"Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create invitations for this course or for access errors. * `NOT_FOUND` if the course or the user does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled or if the user already has this role or a role with greater permissions. * `ALREADY_EXISTS` if an invitation for the specified user and course already exists."##), + Some(r##"Creates an invitation. Only one invitation for a user and course may exist + at a time. Delete and re-create an invitation to make changes. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to create + invitations for this course or for access errors. + * `NOT_FOUND` if the course or the user does not exist. + * `FAILED_PRECONDITION` if the requested user's account is disabled or if + the user already has this role or a role with greater permissions. + * `ALREADY_EXISTS` if an invitation for the specified user and course + already exists."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/invitations_create", vec![ (Some(r##"kv"##), @@ -3881,7 +4539,13 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID."##), + Some(r##"Deletes an invitation. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + requested invitation or for access errors. + * `NOT_FOUND` if no invitation exists with the requested ID."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/invitations_delete", vec![ (Some(r##"id"##), @@ -3903,7 +4567,13 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Returns an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID."##), + Some(r##"Returns an invitation. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to view the + requested invitation or for access errors. + * `NOT_FOUND` if no invitation exists with the requested ID."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/invitations_get", vec![ (Some(r##"id"##), @@ -3925,7 +4595,15 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` or `course_id` must be supplied. Both fields can be supplied. This method returns the following error codes: * `PERMISSION_DENIED` for access errors."##), + Some(r##"Returns a list of invitations that the requesting user is permitted to + view, restricted to those that match the list request. + + *Note:* At least one of `user_id` or `course_id` must be supplied. Both + fields can be supplied. + + This method returns the following error codes: + + * `PERMISSION_DENIED` for access errors."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/invitations_list", vec![ (Some(r##"v"##), @@ -3944,12 +4622,23 @@ fn main() { ("user-profiles", "methods: 'get', 'guardian-invitations-create', 'guardian-invitations-get', 'guardian-invitations-list', 'guardian-invitations-patch', 'guardians-delete', 'guardians-get' and 'guardians-list'", vec![ ("get", - Some(r##"Returns a user profile. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile or if no profile exists with the requested ID or for access errors."##), + Some(r##"Returns a user profile. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to access + this user profile, if no profile exists with the requested ID, or for + access errors."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/user-profiles_get", vec![ (Some(r##"user-id"##), None, - Some(r##"Identifier of the profile to return. 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"##), + Some(r##"Identifier of the profile to return. 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"##), Some(true), Some(false)), @@ -3966,7 +4655,36 @@ fn main() { Some(false)), ]), ("guardian-invitations-create", - Some(r##"Creates a guardian invitation, and sends an email to the guardian asking them to confirm that they are the student's guardian. Once the guardian accepts the invitation, their `state` will change to `COMPLETED` and they will start receiving guardian notifications. A `Guardian` resource will also be created to represent the active guardian. The request object must have the `student_id` and `invited_email_address` fields set. Failing to set these fields, or setting any other fields in the request, will result in an error. This method returns the following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if the guardian in question has already rejected too many requests for that student, if guardians are not enabled for the domain in question, or for other access errors. * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian link limit. * `INVALID_ARGUMENT` if the guardian email address is not valid (for example, if it is too long), or if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API). This error will also be returned if read-only fields are set, or if the `state` field is set to to a value other than `PENDING`. * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student. * `ALREADY_EXISTS` if there is already a pending guardian invitation for the student and `invited_email_address` provided, or if the provided `invited_email_address` matches the Google account of an existing `Guardian` for this user."##), + Some(r##"Creates a guardian invitation, and sends an email to the guardian asking + them to confirm that they are the student's guardian. + + Once the guardian accepts the invitation, their `state` will change to + `COMPLETED` and they will start receiving guardian notifications. A + `Guardian` resource will also be created to represent the active guardian. + + The request object must have the `student_id` and + `invited_email_address` fields set. Failing to set these fields, or + setting any other fields in the request, will result in an error. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the current user does not have permission to + manage guardians, if the guardian in question has already rejected + too many requests for that student, if guardians are not enabled for the + domain in question, or for other access errors. + * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian + link limit. + * `INVALID_ARGUMENT` if the guardian email address is not valid (for + example, if it is too long), or if the format of the student ID provided + cannot be recognized (it is not an email address, nor a `user_id` from + this API). This error will also be returned if read-only fields are set, + or if the `state` field is set to to a value other than `PENDING`. + * `NOT_FOUND` if the student ID provided is a valid student ID, but + Classroom has no record of that student. + * `ALREADY_EXISTS` if there is already a pending guardian invitation for + the student and `invited_email_address` provided, or if the provided + `invited_email_address` matches the Google account of an existing + `Guardian` for this user."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/user-profiles_guardian-invitations-create", vec![ (Some(r##"student-id"##), @@ -3994,7 +4712,20 @@ fn main() { Some(false)), ]), ("guardian-invitations-get", - Some(r##"Returns a specific guardian invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view guardian invitations 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, nor the literal string `me`). * `NOT_FOUND` if Classroom cannot find any record of the given student or `invitation_id`. May also be returned if the student exists, but the requesting user does not have access to see that student."##), + Some(r##"Returns a specific guardian invitation. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the requesting user is not permitted to view + guardian invitations 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, nor the literal string `me`). + * `NOT_FOUND` if Classroom cannot find any record of the given student or + `invitation_id`. May also be returned if the student exists, but the + requesting user does not have access to see that student."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/user-profiles_guardian-invitations-get", vec![ (Some(r##"student-id"##), @@ -4022,12 +4753,35 @@ fn main() { Some(false)), ]), ("guardian-invitations-list", - Some(r##"Returns a list of guardian invitations that the requesting user is permitted to view, filtered by the parameters provided. This method returns the following error codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian invitations for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, 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, nor the literal string `me`). May also be returned if an invalid `page_token` or `state` is provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student."##), + Some(r##"Returns a list of guardian invitations that the requesting user is + permitted to view, filtered by the parameters provided. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting + user is not permitted to view guardian invitations for that student, if + `"-"` is specified as the `student_id` and the user is not a domain + administrator, 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, nor the literal string `me`). May also be returned if an invalid + `page_token` or `state` is provided. + * `NOT_FOUND` if a `student_id` is specified, and its format can be + recognized, but Classroom has no record of that student."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/user-profiles_guardian-invitations-list", vec![ (Some(r##"student-id"##), None, - Some(r##"The ID of the student whose guardian invitations are to be returned. 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 * the string literal `"-"`, indicating that results should be returned for all students that the requesting user is permitted to view guardian invitations."##), + Some(r##"The ID of the student whose guardian invitations are to be returned. + 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 + * the string literal `"-"`, indicating that results should be returned for + all students that the requesting user is permitted to view guardian + invitations."##), Some(true), Some(false)), @@ -4044,7 +4798,24 @@ fn main() { Some(false)), ]), ("guardian-invitations-patch", - Some(r##"Modifies a guardian invitation. Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other access errors. * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. * `INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`. * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom."##), + Some(r##"Modifies a guardian invitation. + + Currently, the only valid modification is to change the `state` from + `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if the current user does not have permission to + manage guardians, if guardians are not enabled for the domain in question + or for other access errors. + * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. + * `INVALID_ARGUMENT` if the format of the student ID provided + cannot be recognized (it is not an email address, nor a `user_id` from + this API), or if the passed `GuardianInvitation` has a `state` other than + `COMPLETE`, or if it modifies fields other than `state`. + * `NOT_FOUND` if the student ID provided is a valid student ID, but + Classroom has no record of that student, or if the `id` field does not + refer to a guardian invitation known to Classroom."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/user-profiles_guardian-invitations-patch", vec![ (Some(r##"student-id"##), @@ -4078,12 +4849,33 @@ fn main() { Some(false)), ]), ("guardians-delete", - Some(r##"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 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 Classroom cannot find any record of the given `student_id` or `guardian_id`, or if the guardian has already been disabled."##), + Some(r##"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`."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/user-profiles_guardians-delete", vec![ (Some(r##"student-id"##), None, - Some(r##"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"##), + Some(r##"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"##), Some(true), Some(false)), @@ -4106,12 +4898,30 @@ fn main() { Some(false)), ]), ("guardians-get", - Some(r##"Returns a specific guardian. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view guardian information 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, nor the literal string `me`). * `NOT_FOUND` if Classroom cannot find any record of the given student or `guardian_id`, or if the guardian has been disabled."##), + Some(r##"Returns a specific guardian. + + 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 view guardian information 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, nor the literal string `me`). + * `NOT_FOUND` if the requesting user is permitted to view guardians for + the requested `student_id`, but no `Guardian` record exists for that + student that matches the provided `guardian_id`."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/user-profiles_guardians-get", vec![ (Some(r##"student-id"##), None, - Some(r##"The student whose guardian is being requested. One of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user"##), + Some(r##"The student whose guardian is being requested. One of the following: + + * the numeric identifier for the user + * the email address of the user + * the string literal `"me"`, indicating the requesting user"##), Some(true), Some(false)), @@ -4134,12 +4944,38 @@ fn main() { Some(false)), ]), ("guardians-list", - Some(r##"Returns a list of guardians that the requesting user is permitted to view, restricted to those that match the request. To list guardians for any student that the requesting user may view guardians for, use the literal character `-` for the student ID. This method returns the following error codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian information for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, if the `invited_email_address` filter is set by a user who is not a domain administrator, 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, nor the literal string `me`). May also be returned if an invalid `page_token` is provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student."##), + Some(r##"Returns a list of guardians that the requesting user is permitted to + view, restricted to those that match the request. + + To list guardians for any student that the requesting user may view + guardians for, use the literal character `-` for the student ID. + + This method returns the following error codes: + + * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting + user is not permitted to view guardian information for that student, if + `"-"` is specified as the `student_id` and the user is not a domain + administrator, if guardians are not enabled for the domain in question, + if the `invited_email_address` filter is set by a user who is not a + domain administrator, 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, nor the literal string `me`). May also be returned if an invalid + `page_token` is provided. + * `NOT_FOUND` if a `student_id` is specified, and its format can be + recognized, but Classroom has no record of that student."##), "Details at http://byron.github.io/google-apis-rs/google_classroom1_cli/user-profiles_guardians-list", vec![ (Some(r##"student-id"##), None, - Some(r##"Filter results by the student who the guardian is linked to. 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 * the string literal `"-"`, indicating that results should be returned for all students that the requesting user has access to view."##), + Some(r##"Filter results by the student who the guardian is linked to. + 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 + * the string literal `"-"`, indicating that results should be returned for + all students that the requesting user has access to view."##), Some(true), Some(false)), @@ -4161,7 +4997,7 @@ fn main() { let mut app = App::new("classroom1") .author("Sebastian Thiel ") - .version("1.0.4+20161006") + .version("1.0.4+20170510") .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 6ba710f5de..e9c9ba59d7 100644 --- a/gen/classroom1/Cargo.toml +++ b/gen/classroom1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-classroom1" -version = "1.0.4+20161006" +version = "1.0.4+20170510" 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.4+20161006" +documentation = "https://docs.rs/google-classroom1/1.0.4+20170510" license = "MIT" keywords = ["classroom", "google", "protocol", "web", "api"] diff --git a/gen/classroom1/README.md b/gen/classroom1/README.md index 7f77423a39..78db608607 100644 --- a/gen/classroom1/README.md +++ b/gen/classroom1/README.md @@ -5,20 +5,20 @@ 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.4+20161006*, where *20161006* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *classroom* crate version *1.0.4+20170510*, where *20170510* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161006/google_classroom1/struct.Classroom.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.Classroom.html) ... -* [courses](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.Course.html) - * [*aliases create*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseAliaseCreateCall.html), [*aliases delete*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseAliaseDeleteCall.html), [*aliases list*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseAliaseListCall.html), [*course work create*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCourseWorkCreateCall.html), [*course work get*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCourseWorkGetCall.html), [*course work list*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCourseWorkListCall.html), [*course work student submissions get*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseGetCall.html), [*list*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseListCall.html), [*patch*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CoursePatchCall.html), [*students create*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseStudentCreateCall.html), [*students delete*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseStudentDeleteCall.html), [*students get*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseStudentGetCall.html), [*students list*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseStudentListCall.html), [*teachers create*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseTeacherCreateCall.html), [*teachers delete*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseTeacherDeleteCall.html), [*teachers get*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseTeacherGetCall.html), [*teachers list*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseTeacherListCall.html) and [*update*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.CourseUpdateCall.html) -* [invitations](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.Invitation.html) - * [*accept*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.InvitationAcceptCall.html), [*create*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.InvitationCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.InvitationDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.InvitationGetCall.html) and [*list*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.InvitationListCall.html) -* [user profiles](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.UserProfile.html) - * [*get*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.UserProfileGetCall.html), [*guardian invitations create*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.UserProfileGuardianInvitationCreateCall.html), [*guardian invitations get*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.UserProfileGuardianInvitationGetCall.html), [*guardian invitations list*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.UserProfileGuardianInvitationListCall.html), [*guardian invitations patch*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.UserProfileGuardianInvitationPatchCall.html), [*guardians delete*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.UserProfileGuardianDeleteCall.html), [*guardians get*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.UserProfileGuardianGetCall.html) and [*guardians list*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/struct.UserProfileGuardianListCall.html) +* [courses](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.Course.html) + * [*aliases create*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseAliaseCreateCall.html), [*aliases delete*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseAliaseDeleteCall.html), [*aliases list*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseAliaseListCall.html), [*course work create*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkCreateCall.html), [*course work delete*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkDeleteCall.html), [*course work get*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkGetCall.html), [*course work list*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkListCall.html), [*course work patch*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkPatchCall.html), [*course work student submissions get*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseGetCall.html), [*list*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseListCall.html), [*patch*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CoursePatchCall.html), [*students create*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseStudentCreateCall.html), [*students delete*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseStudentDeleteCall.html), [*students get*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseStudentGetCall.html), [*students list*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseStudentListCall.html), [*teachers create*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseTeacherCreateCall.html), [*teachers delete*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseTeacherDeleteCall.html), [*teachers get*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseTeacherGetCall.html), [*teachers list*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseTeacherListCall.html) and [*update*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.CourseUpdateCall.html) +* [invitations](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.Invitation.html) + * [*accept*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.InvitationAcceptCall.html), [*create*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.InvitationCreateCall.html), [*delete*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.InvitationDeleteCall.html), [*get*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.InvitationGetCall.html) and [*list*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.InvitationListCall.html) +* [user profiles](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.UserProfile.html) + * [*get*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.UserProfileGetCall.html), [*guardian invitations create*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.UserProfileGuardianInvitationCreateCall.html), [*guardian invitations get*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.UserProfileGuardianInvitationGetCall.html), [*guardian invitations list*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.UserProfileGuardianInvitationListCall.html), [*guardian invitations patch*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.UserProfileGuardianInvitationPatchCall.html), [*guardians delete*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.UserProfileGuardianDeleteCall.html), [*guardians get*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.UserProfileGuardianGetCall.html) and [*guardians list*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/struct.UserProfileGuardianListCall.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-classroom1/1.0.4+20161006/google_classroom1/struct.Classroom.html)** +* **[Hub](https://docs.rs/google-classroom1/1.0.4+20170510/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.4+20161006/google_classroom1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-classroom1/1.0.4+20170510/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.4+20161006/google_classroom1/trait.Part.html)** + * **[Parts](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-classroom1/1.0.4+20161006/google_classroom1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-classroom1/1.0.4+20170510/google_classroom1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -55,29 +55,31 @@ let r = hub.courses().course_work_student_submissions_patch(...).doit() let r = hub.courses().course_work_student_submissions_list(...).doit() let r = hub.courses().get(...).doit() let r = hub.courses().update(...).doit() -let r = hub.courses().students_delete(...).doit() +let r = hub.courses().students_get(...).doit() let r = hub.courses().teachers_get(...).doit() let r = hub.courses().course_work_list(...).doit() -let r = hub.courses().teachers_list(...).doit() +let r = hub.courses().course_work_get(...).doit() let r = hub.courses().course_work_student_submissions_turn_in(...).doit() let r = hub.courses().course_work_student_submissions_modify_attachments(...).doit() +let r = hub.courses().teachers_list(...).doit() let r = hub.courses().course_work_student_submissions_return(...).doit() -let r = hub.courses().course_work_get(...).doit() +let r = hub.courses().aliases_list(...).doit() let r = hub.courses().course_work_create(...).doit() let r = hub.courses().list(...).doit() let r = hub.courses().course_work_student_submissions_reclaim(...).doit() let r = hub.courses().aliases_create(...).doit() let r = hub.courses().students_create(...).doit() let r = hub.courses().aliases_delete(...).doit() +let r = hub.courses().course_work_delete(...).doit() let r = hub.courses().create(...).doit() let r = hub.courses().students_list(...).doit() let r = hub.courses().delete(...).doit() +let r = hub.courses().course_work_patch(...).doit() let r = hub.courses().patch(...).doit() -let r = hub.courses().aliases_list(...).doit() +let r = hub.courses().students_delete(...).doit() let r = hub.courses().teachers_delete(...).doit() let r = hub.courses().teachers_create(...).doit() let r = hub.courses().course_work_student_submissions_get(...).doit() -let r = hub.courses().students_get(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -150,17 +152,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-classroom1/1.0.4+20161006/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.4+20170510/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.4+20161006/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.4+20170510/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.4+20161006/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.4+20170510/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.4+20161006/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.4+20170510/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")`. @@ -170,29 +172,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.4+20161006/google_classroom1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-classroom1/1.0.4+20161006/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.4+20170510/google_classroom1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-classroom1/1.0.4+20170510/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.4+20161006/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.4+20170510/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.4+20161006/google_classroom1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-classroom1/1.0.4+20161006/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.4+20170510/google_classroom1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-classroom1/1.0.4+20170510/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.4+20161006/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.4+20170510/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.4+20161006/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.4+20170510/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.4+20161006/google_classroom1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-classroom1/1.0.4+20170510/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 62b3077e55..ed2cd94b81 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.4+20161006*, where *20161006* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *classroom* crate version *1.0.4+20170510*, where *20170510* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *classroom* *v1* API can be found at the //! [official documentation site](https://developers.google.com/classroom/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Classroom.html) ... //! //! * [courses](struct.Course.html) -//! * [*aliases create*](struct.CourseAliaseCreateCall.html), [*aliases delete*](struct.CourseAliaseDeleteCall.html), [*aliases list*](struct.CourseAliaseListCall.html), [*course work create*](struct.CourseCourseWorkCreateCall.html), [*course work get*](struct.CourseCourseWorkGetCall.html), [*course work list*](struct.CourseCourseWorkListCall.html), [*course work student submissions get*](struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](struct.CourseCreateCall.html), [*delete*](struct.CourseDeleteCall.html), [*get*](struct.CourseGetCall.html), [*list*](struct.CourseListCall.html), [*patch*](struct.CoursePatchCall.html), [*students create*](struct.CourseStudentCreateCall.html), [*students delete*](struct.CourseStudentDeleteCall.html), [*students get*](struct.CourseStudentGetCall.html), [*students list*](struct.CourseStudentListCall.html), [*teachers create*](struct.CourseTeacherCreateCall.html), [*teachers delete*](struct.CourseTeacherDeleteCall.html), [*teachers get*](struct.CourseTeacherGetCall.html), [*teachers list*](struct.CourseTeacherListCall.html) and [*update*](struct.CourseUpdateCall.html) +//! * [*aliases create*](struct.CourseAliaseCreateCall.html), [*aliases delete*](struct.CourseAliaseDeleteCall.html), [*aliases list*](struct.CourseAliaseListCall.html), [*course work create*](struct.CourseCourseWorkCreateCall.html), [*course work delete*](struct.CourseCourseWorkDeleteCall.html), [*course work get*](struct.CourseCourseWorkGetCall.html), [*course work list*](struct.CourseCourseWorkListCall.html), [*course work patch*](struct.CourseCourseWorkPatchCall.html), [*course work student submissions get*](struct.CourseCourseWorkStudentSubmissionGetCall.html), [*course work student submissions list*](struct.CourseCourseWorkStudentSubmissionListCall.html), [*course work student submissions modify attachments*](struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html), [*course work student submissions patch*](struct.CourseCourseWorkStudentSubmissionPatchCall.html), [*course work student submissions reclaim*](struct.CourseCourseWorkStudentSubmissionReclaimCall.html), [*course work student submissions return*](struct.CourseCourseWorkStudentSubmissionReturnCall.html), [*course work student submissions turn in*](struct.CourseCourseWorkStudentSubmissionTurnInCall.html), [*create*](struct.CourseCreateCall.html), [*delete*](struct.CourseDeleteCall.html), [*get*](struct.CourseGetCall.html), [*list*](struct.CourseListCall.html), [*patch*](struct.CoursePatchCall.html), [*students create*](struct.CourseStudentCreateCall.html), [*students delete*](struct.CourseStudentDeleteCall.html), [*students get*](struct.CourseStudentGetCall.html), [*students list*](struct.CourseStudentListCall.html), [*teachers create*](struct.CourseTeacherCreateCall.html), [*teachers delete*](struct.CourseTeacherDeleteCall.html), [*teachers get*](struct.CourseTeacherGetCall.html), [*teachers list*](struct.CourseTeacherListCall.html) and [*update*](struct.CourseUpdateCall.html) //! * [invitations](struct.Invitation.html) //! * [*accept*](struct.InvitationAcceptCall.html), [*create*](struct.InvitationCreateCall.html), [*delete*](struct.InvitationDeleteCall.html), [*get*](struct.InvitationGetCall.html) and [*list*](struct.InvitationListCall.html) //! * [user profiles](struct.UserProfile.html) @@ -55,29 +55,31 @@ //! let r = hub.courses().course_work_student_submissions_list(...).doit() //! let r = hub.courses().get(...).doit() //! let r = hub.courses().update(...).doit() -//! let r = hub.courses().students_delete(...).doit() +//! let r = hub.courses().students_get(...).doit() //! let r = hub.courses().teachers_get(...).doit() //! let r = hub.courses().course_work_list(...).doit() -//! let r = hub.courses().teachers_list(...).doit() +//! let r = hub.courses().course_work_get(...).doit() //! let r = hub.courses().course_work_student_submissions_turn_in(...).doit() //! let r = hub.courses().course_work_student_submissions_modify_attachments(...).doit() +//! let r = hub.courses().teachers_list(...).doit() //! let r = hub.courses().course_work_student_submissions_return(...).doit() -//! let r = hub.courses().course_work_get(...).doit() +//! let r = hub.courses().aliases_list(...).doit() //! let r = hub.courses().course_work_create(...).doit() //! let r = hub.courses().list(...).doit() //! let r = hub.courses().course_work_student_submissions_reclaim(...).doit() //! let r = hub.courses().aliases_create(...).doit() //! let r = hub.courses().students_create(...).doit() //! let r = hub.courses().aliases_delete(...).doit() +//! let r = hub.courses().course_work_delete(...).doit() //! let r = hub.courses().create(...).doit() //! let r = hub.courses().students_list(...).doit() //! let r = hub.courses().delete(...).doit() +//! let r = hub.courses().course_work_patch(...).doit() //! let r = hub.courses().patch(...).doit() -//! let r = hub.courses().aliases_list(...).doit() +//! let r = hub.courses().students_delete(...).doit() //! let r = hub.courses().teachers_delete(...).doit() //! let r = hub.courses().teachers_create(...).doit() //! let r = hub.courses().course_work_student_submissions_get(...).doit() -//! let r = hub.courses().students_get(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -205,7 +207,7 @@ // 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 +// 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)] @@ -250,30 +252,24 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { - /// View the email addresses of people in your classes - ProfileEmail, + /// View your course work and grades in Google Classroom + StudentSubmissionMeReadonly, /// View your Google Classroom class rosters RosterReadonly, - /// Manage your Google Classroom classes - Course, + /// View your course work and grades in Google Classroom + CourseworkMeReadonly, /// View course work and grades for students in the Google Classroom classes you teach or administer CourseworkStudentReadonly, - /// View instructions for teacher-assigned work in your Google Classroom classes - CourseWorkReadonly, - - /// View your course work and grades in Google Classroom - StudentSubmissionMeReadonly, + /// View the email addresses of people in your classes + ProfileEmail, /// View the profile photos of people in your classes ProfilePhoto, - /// View your course work and grades in Google Classroom - CourseworkMeReadonly, - /// Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer CourseworkStudent, @@ -288,31 +284,33 @@ pub enum Scope { /// Manage your course work and view your grades in Google Classroom CourseworkMe, + + /// Manage your Google Classroom classes + Course, } impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { - Scope::ProfileEmail => "https://www.googleapis.com/auth/classroom.profile.emails", - Scope::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::CourseWorkReadonly => "https://www.googleapis.com/auth/classroom.course-work.readonly", Scope::StudentSubmissionMeReadonly => "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly", - Scope::ProfilePhoto => "https://www.googleapis.com/auth/classroom.profile.photos", + Scope::RosterReadonly => "https://www.googleapis.com/auth/classroom.rosters.readonly", Scope::CourseworkMeReadonly => "https://www.googleapis.com/auth/classroom.coursework.me.readonly", + Scope::CourseworkStudentReadonly => "https://www.googleapis.com/auth/classroom.coursework.students.readonly", + Scope::ProfileEmail => "https://www.googleapis.com/auth/classroom.profile.emails", + Scope::ProfilePhoto => "https://www.googleapis.com/auth/classroom.profile.photos", Scope::CourseworkStudent => "https://www.googleapis.com/auth/classroom.coursework.students", Scope::StudentSubmissionStudentReadonly => "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly", Scope::CourseReadonly => "https://www.googleapis.com/auth/classroom.courses.readonly", Scope::Roster => "https://www.googleapis.com/auth/classroom.rosters", Scope::CourseworkMe => "https://www.googleapis.com/auth/classroom.coursework.me", + Scope::Course => "https://www.googleapis.com/auth/classroom.courses", } } } impl Default for Scope { fn default() -> Scope { - Scope::RosterReadonly + Scope::StudentSubmissionMeReadonly } } @@ -383,8 +381,6 @@ pub struct Classroom { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Classroom {} @@ -397,8 +393,6 @@ impl<'a, C, A> Classroom client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://classroom.googleapis.com/".to_string(), - _root_url: "https://classroom.googleapis.com/".to_string(), } } @@ -421,26 +415,6 @@ impl<'a, C, A> Classroom self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://classroom.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://classroom.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -458,10 +432,12 @@ impl<'a, C, A> Classroom /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListGuardiansResponse { - /// Token identifying the next page of results to return. If empty, no further results are available. + /// Token identifying the next page of results to return. If empty, no further + /// results are available. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// Guardians on this page of results that met the criteria specified in the request. + /// Guardians on this page of results that met the criteria specified in + /// the request. pub guardians: Option>, } @@ -492,7 +468,10 @@ impl Part for MultipleChoiceSubmission {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyAttachmentsRequest { - /// Attachments to add. A student submission may not have more than 20 attachments. This may only contain link attachments. + /// Attachments to add. + /// A student submission may not have more than 20 attachments. + /// + /// Form attachments are not supported. #[serde(rename="addAttachments")] pub add_attachments: Option>, } @@ -513,7 +492,9 @@ pub struct ShortAnswerSubmission { impl Part for ShortAnswerSubmission {} -/// Attachment added to student assignment work. When creating attachments, only the Link field may be specified. +/// Attachment added to student assignment work. +/// +/// When creating attachments, setting the `form` field is not supported. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -534,17 +515,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 SUBMISSION_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 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. @@ -562,7 +553,15 @@ pub struct ReturnStudentSubmissionRequest { _never_set: Option } impl RequestValue for ReturnStudentSubmissionRequest {} -/// 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 `{}`. +/// 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 /// @@ -570,12 +569,13 @@ impl RequestValue for ReturnStudentSubmissionRequest {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [delete invitations](struct.InvitationDeleteCall.html) (response) -/// * [course work student submissions turn in courses](struct.CourseCourseWorkStudentSubmissionTurnInCall.html) (response) +/// * [course work delete courses](struct.CourseCourseWorkDeleteCall.html) (response) /// * [course work student submissions reclaim courses](struct.CourseCourseWorkStudentSubmissionReclaimCall.html) (response) /// * [teachers delete courses](struct.CourseTeacherDeleteCall.html) (response) /// * [guardians delete user profiles](struct.UserProfileGuardianDeleteCall.html) (response) /// * [students delete courses](struct.CourseStudentDeleteCall.html) (response) /// * [aliases delete courses](struct.CourseAliaseDeleteCall.html) (response) +/// * [course work student submissions turn in courses](struct.CourseCourseWorkStudentSubmissionTurnInCall.html) (response) /// * [course work student submissions return courses](struct.CourseCourseWorkStudentSubmissionReturnCall.html) (response) /// * [delete courses](struct.CourseDeleteCall.html) (response) /// * [accept invitations](struct.InvitationAcceptCall.html) (response) @@ -604,17 +604,27 @@ impl ResponseResult for Empty {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UserProfile { - /// URL of user's profile photo. Read-only. + /// URL of user's profile photo. + /// + /// Read-only. #[serde(rename="photoUrl")] pub photo_url: Option, - /// Email address of the user. Read-only. + /// Email address of the user. + /// + /// Read-only. #[serde(rename="emailAddress")] pub email_address: Option, - /// Identifier of the user. Read-only. + /// Identifier of the user. + /// + /// Read-only. pub id: Option, - /// Name of the user. Read-only. + /// Name of the user. + /// + /// Read-only. pub name: Option, - /// Global permissions of the user. Read-only. + /// Global permissions of the user. + /// + /// Read-only. pub permissions: Option>, } @@ -622,7 +632,9 @@ impl Resource for UserProfile {} impl ResponseResult for UserProfile {} -/// A set of materials that appears on the "About" page of the course. These materials might include a syllabus, schedule, or other background information relating to the course as a whole. +/// A set of materials that appears on the "About" page of the course. +/// These materials might include a syllabus, schedule, or other background +/// information relating to the course as a whole. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -637,23 +649,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 chose 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, - /// 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, - /// Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. - pub nanos: 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. @@ -665,20 +678,29 @@ pub struct Form { /// URL of the form. #[serde(rename="formUrl")] pub form_url: Option, - /// URL of a thumbnail image of the Form. Read-only. + /// URL of a thumbnail image of the Form. + /// + /// Read-only. #[serde(rename="thumbnailUrl")] pub thumbnail_url: Option, - /// URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only. + /// URL of the form responses document. + /// Only set if respsonses have been recorded and only when the + /// requesting user is an editor of the form. + /// + /// Read-only. #[serde(rename="responseUrl")] pub response_url: Option, - /// Title of the Form. Read-only. + /// Title of the Form. + /// + /// Read-only. pub title: Option, } impl Part for Form {} -/// Association between a student and a guardian of that student. The guardian may receive information about the student's course work. +/// Association between a student and a guardian of that student. The guardian +/// may receive information about the student's course work. /// /// # Activities /// @@ -692,7 +714,8 @@ pub struct Guardian { /// Identifier for the guardian. #[serde(rename="guardianId")] pub guardian_id: Option, - /// The email address to which the initial guardian invitation was sent. This field is only visible to domain administrators. + /// The email address to which the initial guardian invitation was sent. + /// This field is only visible to domain administrators. #[serde(rename="invitedEmailAddress")] pub invited_email_address: Option, /// Identifier for the student to whom the guardian relationship applies. @@ -721,20 +744,23 @@ pub struct TurnInStudentSubmissionRequest { _never_set: Option } impl RequestValue for TurnInStudentSubmissionRequest {} -/// Material attached to course work. When creating attachments, only the Link field may be specified. +/// Material attached to course work. +/// +/// When creating attachments, setting the `form` field is not supported. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Material { - /// YouTube video material. - #[serde(rename="youtubeVideo")] - pub youtube_video: Option, + /// Link material. On creation, will be upgraded to a more appropriate type + /// if possible, and this will be reflected in the response. + pub link: Option, /// Google Drive file material. #[serde(rename="driveFile")] pub drive_file: Option, - /// Link material. - pub link: Option, + /// YouTube video material. + #[serde(rename="youtubeVideo")] + pub youtube_video: Option, /// Google Forms material. pub form: Option
, } @@ -748,16 +774,22 @@ impl Part for Material {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct YouTubeVideo { - /// Title of the YouTube video. Read-only. - pub title: Option, - /// URL of a thumbnail image of the YouTube video. Read-only. + /// URL that can be used to view the YouTube video. + /// + /// Read-only. + #[serde(rename="alternateLink")] + pub alternate_link: Option, + /// URL of a thumbnail image of the YouTube video. + /// + /// Read-only. #[serde(rename="thumbnailUrl")] pub thumbnail_url: Option, /// YouTube API resource ID. pub id: Option, - /// URL that can be used to view the YouTube video. Read-only. - #[serde(rename="alternateLink")] - pub alternate_link: Option, + /// Title of the YouTube video. + /// + /// Read-only. + pub title: Option, } impl Part for YouTubeVideo {} @@ -774,7 +806,8 @@ impl Part for YouTubeVideo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListTeachersResponse { - /// Token identifying the next page of results to return. If empty, no further results are available. + /// Token identifying the next page of results to return. If empty, no further + /// results are available. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// Teachers who match the list request. @@ -790,14 +823,20 @@ impl ResponseResult for ListTeachersResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DriveFile { - /// Title of the Drive item. Read-only. + /// Title of the Drive item. + /// + /// Read-only. pub title: Option, - /// URL of a thumbnail image of the Drive item. Read-only. + /// URL of a thumbnail image of the Drive item. + /// + /// Read-only. #[serde(rename="thumbnailUrl")] pub thumbnail_url: Option, /// Drive API resource ID. pub id: Option, - /// URL that can be used to access the Drive item. Read-only. + /// URL that can be used to access the Drive item. + /// + /// Read-only. #[serde(rename="alternateLink")] pub alternate_link: Option, } @@ -811,12 +850,17 @@ impl Part for DriveFile {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Link { - /// URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters. + /// URL to link to. + /// This must be a valid UTF-8 string containing between 1 and 2024 characters. pub url: Option, - /// URL of a thumbnail image of the target URL. Read-only. + /// URL of a thumbnail image of the target URL. + /// + /// Read-only. #[serde(rename="thumbnailUrl")] pub thumbnail_url: Option, - /// Title of the target of the URL. Read-only. + /// Title of the target of the URL. + /// + /// Read-only. pub title: Option, } @@ -835,15 +879,29 @@ impl Part for Link {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Student { - /// Identifier of the course. Read-only. + /// Identifier of the course. + /// + /// Read-only. #[serde(rename="courseId")] pub course_id: Option, - /// Global user information for the student. Read-only. + /// 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. Read-only. + /// Information about a Drive Folder for this student's work in this course. + /// Only visible to the student and domain administrators. + /// + /// Read-only. #[serde(rename="studentWorkFolder")] pub student_work_folder: 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 + /// 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, } @@ -852,15 +910,23 @@ impl RequestValue for Student {} impl ResponseResult for Student {} -/// Represents a whole calendar date, e.g. date of birth. The time of day and time zone are either specified elsewhere or are not significant. The date is relative to the Proleptic Gregorian Calendar. The day may be 0 to represent a year and month where the day is not significant, e.g. credit card expiration date. The year may be 0 to represent a month and day independent of year, e.g. anniversary date. Related types are google.type.TimeOfDay and `google.protobuf.Timestamp`. +/// Represents a whole calendar date, e.g. date of birth. The time of day and +/// time zone are either specified elsewhere or are not significant. The date +/// is relative to the Proleptic Gregorian Calendar. The day may be 0 to +/// represent a year and month where the day is not significant, e.g. credit card +/// expiration date. The year may be 0 to represent a month and day independent +/// of year, e.g. anniversary date. Related types are google.type.TimeOfDay +/// and `google.protobuf.Timestamp`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Date { - /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year. + /// 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. + /// 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, @@ -886,17 +952,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. @@ -910,7 +986,8 @@ impl Part for MultipleChoiceQuestion {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListCoursesResponse { - /// Token identifying the next page of results to return. If empty, no further results are available. + /// Token identifying the next page of results to return. If empty, no further + /// results are available. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// Courses that match the list request. @@ -932,12 +1009,23 @@ impl ResponseResult for ListCoursesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Teacher { - /// Identifier of the course. Read-only. + /// Identifier of the course. + /// + /// Read-only. #[serde(rename="courseId")] pub course_id: Option, - /// Global user information for the teacher. Read-only. + /// 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 + /// 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, } @@ -973,13 +1061,20 @@ impl Part for CourseMaterial {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Name { - /// The user's full name formed by concatenating the first and last name values. Read-only. + /// The user's full name formed by concatenating the first and last name + /// values. + /// + /// Read-only. #[serde(rename="fullName")] pub full_name: Option, - /// The user's first name. Read-only. + /// The user's first name. + /// + /// Read-only. #[serde(rename="givenName")] pub given_name: Option, - /// The user's last name. Read-only. + /// The user's last name. + /// + /// Read-only. #[serde(rename="familyName")] pub family_name: Option, } @@ -998,7 +1093,8 @@ impl Part for Name {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListInvitationsResponse { - /// Token identifying the next page of results to return. If empty, no further results are available. + /// Token identifying the next page of results to return. If empty, no further + /// results are available. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// Invitations that match the list request. @@ -1014,11 +1110,15 @@ impl ResponseResult for ListInvitationsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DriveFolder { - /// Title of the Drive folder. Read-only. + /// Title of the Drive folder. + /// + /// Read-only. pub title: Option, /// Drive API resource ID. pub id: Option, - /// URL that can be used to access the Drive folder. Read-only. + /// URL that can be used to access the Drive folder. + /// + /// Read-only. #[serde(rename="alternateLink")] pub alternate_link: Option, } @@ -1044,12 +1144,22 @@ pub struct Invitation { /// Identifier of the course to invite the user to. #[serde(rename="courseId")] pub course_id: Option, - /// Identifier of the invited user. When specified as a parameter of a request, this identifier can be set to one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + /// 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 + /// 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, - /// Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`. - pub role: Option, - /// Identifier assigned by Classroom. Read-only. + /// Identifier assigned by Classroom. + /// + /// Read-only. pub id: Option, } @@ -1071,7 +1181,8 @@ impl ResponseResult for Invitation {} 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. + /// Token identifying the next page of results to return. If empty, no further + /// results are available. #[serde(rename="nextPageToken")] pub next_page_token: Option, } @@ -1079,26 +1190,17 @@ pub struct ListStudentsResponse { impl ResponseResult for ListStudentsResponse {} -/// Response when listing student submissions. +/// Additional details for multiple-choice questions. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [course work student submissions list courses](struct.CourseCourseWorkStudentSubmissionListCall.html) (response) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListStudentSubmissionsResponse { - /// Token identifying the next page of results to return. If empty, no further results are available. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Student work that matches the request. - #[serde(rename="studentSubmissions")] - pub student_submissions: Option>, +pub struct MultipleChoiceQuestion { + /// Possible choices. + pub choices: Option>, } -impl ResponseResult for ListStudentSubmissionsResponse {} +impl Part for MultipleChoiceQuestion {} /// Response when listing course aliases. @@ -1112,7 +1214,8 @@ impl ResponseResult for ListStudentSubmissionsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListCourseAliasesResponse { - /// Token identifying the next page of results to return. If empty, no further results are available. + /// Token identifying the next page of results to return. If empty, no further + /// results are available. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The course aliases. @@ -1146,52 +1249,93 @@ impl RequestValue for ReclaimStudentSubmissionRequest {} /// /// * [course work create courses](struct.CourseCourseWorkCreateCall.html) (request|response) /// * [course work get courses](struct.CourseCourseWorkGetCall.html) (response) +/// * [course work patch courses](struct.CourseCourseWorkPatchCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CourseWork { - /// Timestamp of the most recent change to this course work. Read-only. + /// Timestamp of the most recent change to this course work. + /// + /// Read-only. #[serde(rename="updateTime")] pub update_time: Option, - /// Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters. + /// Optional description of this course work. + /// If set, the description must be a valid UTF-8 string containing no more + /// than 30,000 characters. pub description: Option, - /// Identifier of the course. Read-only. + /// Identifier of the course. + /// + /// Read-only. #[serde(rename="courseId")] pub course_id: Option, - /// Assignment details. This is populated only when `work_type` is `ASSIGNMENT`. + /// Assignment details. + /// This is populated only when `work_type` is `ASSIGNMENT`. + /// + /// Read-only. pub assignment: Option, - /// Whether this course work item is associated with the Developer Console project making the request. See google.classroom.Work.CreateCourseWork for more details. Read-only. + /// Whether this course work item is associated with the Developer Console + /// project making the request. + /// + /// See google.classroom.Work.CreateCourseWork for more + /// details. + /// + /// Read-only. #[serde(rename="associatedWithDeveloper")] pub associated_with_developer: Option, - /// Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value. + /// Maximum grade for this course work. + /// If zero or unspecified, this assignment is considered ungraded. + /// This must be a non-negative integer value. #[serde(rename="maxPoints")] pub max_points: 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. When creating course work, this must be `ASSIGNMENT`. - #[serde(rename="workType")] - pub work_type: Option, - /// Setting to determine when students are allowed to modify submissions. If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. - #[serde(rename="submissionModificationMode")] - pub submission_modification_mode: Option, - /// Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters. - pub title: 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, - /// Timestamp when this course work was created. Read-only. - #[serde(rename="creationTime")] - pub creation_time: Option, - /// Optional date, in UTC, that submissions for this this course work are due. This must be specified if `due_time` is specified. + /// 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`. + /// Type of this course work. + /// + /// The type is set when the course work is created and cannot be changed. + #[serde(rename="workType")] + pub work_type: Option, + /// Setting to determine when students are allowed to modify submissions. + /// 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, + /// 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, + /// Status of this course work. + /// If unspecified, the default state is `DRAFT`. pub state: Option, - /// Additional materials. CourseWork must have no more than 20 material items. + /// Additional materials. + /// + /// CourseWork must have no more than 20 material items. pub materials: Option>, - /// Optional time of day, in UTC, that submissions for this this course work are due. This must be specified if `due_date` is specified. + /// Optional time of day, in UTC, that submissions for this this course work + /// are due. + /// This must be specified if `due_date` is specified. #[serde(rename="dueTime")] pub due_time: Option, - /// Multiple choice question details. This is populated only when `work_type` is `MULTIPLE_CHOICE_QUESTION`. + /// Multiple choice question details. + /// For read operations, this field is populated only when `work_type` is + /// `MULTIPLE_CHOICE_QUESTION`. + /// For write operations, this field must be specified when creating course + /// work with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be + /// set otherwise. #[serde(rename="multipleChoiceQuestion")] pub multiple_choice_question: Option, } @@ -1200,7 +1344,12 @@ impl RequestValue for CourseWork {} impl ResponseResult for CourseWork {} -/// Student submission for course work. StudentSubmission items are generated when a CourseWork item is created. StudentSubmissions that have never been accessed (i.e. with `state` = NEW) may not have a creation time or update time. +/// Student submission for course work. +/// +/// StudentSubmission items are generated when a CourseWork item is created. +/// +/// StudentSubmissions that have never been accessed (i.e. with `state` = NEW) +/// may not have a creation time or update time. /// /// # Activities /// @@ -1213,46 +1362,81 @@ impl ResponseResult for CourseWork {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct StudentSubmission { - /// Last update time of this submission. This may be unset if the student has not accessed this item. Read-only. + /// Last update time of this submission. + /// This may be unset if the student has not accessed this item. + /// + /// Read-only. #[serde(rename="updateTime")] pub update_time: Option, - /// Identifier of the course. Read-only. + /// Identifier of the course. + /// + /// Read-only. #[serde(rename="courseId")] pub course_id: Option, - /// Identifier for the student that owns this submission. Read-only. + /// Identifier for the student that owns this submission. + /// + /// Read-only. #[serde(rename="userId")] pub user_id: Option, - /// Whether this student submission is associated with the Developer Console project making the request. See google.classroom.Work.CreateCourseWork for more details. Read-only. + /// Whether this student submission is associated with the Developer Console + /// project making the request. + /// + /// See google.classroom.Work.CreateCourseWork for more + /// details. + /// + /// Read-only. #[serde(rename="associatedWithDeveloper")] pub associated_with_developer: Option, - /// Type of course work this submission is for. Read-only. + /// Type of course work this submission is for. + /// + /// Read-only. #[serde(rename="courseWorkType")] pub course_work_type: Option, - /// Optional grade. If unset, no grade was set. This must be a non-negative integer value. This may be modified only by course teachers. + /// Optional grade. If unset, no grade was set. + /// This must be a non-negative integer value. + /// + /// This may be modified only by course teachers. #[serde(rename="assignedGrade")] pub assigned_grade: Option, - /// Classroom-assigned Identifier for the student submission. This is unique among submissions for the relevant course work. Read-only. + /// Classroom-assigned Identifier for the student submission. + /// This is unique among submissions for the relevant course work. + /// + /// Read-only. pub id: Option, - /// Optional pending grade. If unset, no grade was set. This must be a non-negative integer value. This is only visible to and modifiable by course teachers. + /// Optional pending grade. If unset, no grade was set. + /// This must be a non-negative integer value. + /// + /// This is only visible to and modifiable by course teachers. #[serde(rename="draftGrade")] pub draft_grade: Option, - /// Absolute link to the submission in the Classroom web UI. Read-only. + /// Absolute link to the submission in the Classroom web UI. + /// + /// Read-only. #[serde(rename="alternateLink")] pub alternate_link: Option, /// Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. #[serde(rename="multipleChoiceSubmission")] pub multiple_choice_submission: Option, - /// Creation time of this submission. This may be unset if the student has not accessed this item. Read-only. + /// Creation time of this submission. + /// This may be unset if the student has not accessed this item. + /// + /// Read-only. #[serde(rename="creationTime")] pub creation_time: Option, /// Submission content when course_work_type is SHORT_ANSWER_QUESTION. #[serde(rename="shortAnswerSubmission")] pub short_answer_submission: Option, - /// Whether this submission is late. Read-only. + /// Whether this submission is late. + /// + /// Read-only. pub late: Option, - /// State of this submission. Read-only. + /// State of this submission. + /// + /// Read-only. pub state: Option, - /// Identifier for the course work this corresponds to. Read-only. + /// Identifier for the course work this corresponds to. + /// + /// Read-only. #[serde(rename="courseWorkId")] pub course_work_id: Option, /// Submission content when course_work_type is ASSIGNMENT . @@ -1275,7 +1459,8 @@ impl ResponseResult for StudentSubmission {} /// #[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. + /// 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. @@ -1297,76 +1482,143 @@ impl ResponseResult for ListGuardianInvitationsResponse {} /// * [course work student submissions list courses](struct.CourseCourseWorkStudentSubmissionListCall.html) (none) /// * [get courses](struct.CourseGetCall.html) (response) /// * [update courses](struct.CourseUpdateCall.html) (request|response) -/// * [students delete courses](struct.CourseStudentDeleteCall.html) (none) +/// * [students get courses](struct.CourseStudentGetCall.html) (none) /// * [teachers get courses](struct.CourseTeacherGetCall.html) (none) /// * [course work list courses](struct.CourseCourseWorkListCall.html) (none) -/// * [teachers list courses](struct.CourseTeacherListCall.html) (none) +/// * [course work get courses](struct.CourseCourseWorkGetCall.html) (none) /// * [course work student submissions turn in courses](struct.CourseCourseWorkStudentSubmissionTurnInCall.html) (none) /// * [course work student submissions modify attachments courses](struct.CourseCourseWorkStudentSubmissionModifyAttachmentCall.html) (none) +/// * [teachers list courses](struct.CourseTeacherListCall.html) (none) /// * [course work student submissions return courses](struct.CourseCourseWorkStudentSubmissionReturnCall.html) (none) -/// * [course work get courses](struct.CourseCourseWorkGetCall.html) (none) +/// * [aliases list courses](struct.CourseAliaseListCall.html) (none) /// * [course work create courses](struct.CourseCourseWorkCreateCall.html) (none) /// * [list courses](struct.CourseListCall.html) (none) /// * [course work student submissions reclaim courses](struct.CourseCourseWorkStudentSubmissionReclaimCall.html) (none) /// * [aliases create courses](struct.CourseAliaseCreateCall.html) (none) /// * [students create courses](struct.CourseStudentCreateCall.html) (none) /// * [aliases delete courses](struct.CourseAliaseDeleteCall.html) (none) +/// * [course work delete courses](struct.CourseCourseWorkDeleteCall.html) (none) /// * [create courses](struct.CourseCreateCall.html) (request|response) /// * [students list courses](struct.CourseStudentListCall.html) (none) /// * [delete courses](struct.CourseDeleteCall.html) (none) +/// * [course work patch courses](struct.CourseCourseWorkPatchCall.html) (none) /// * [patch courses](struct.CoursePatchCall.html) (request|response) -/// * [aliases list courses](struct.CourseAliaseListCall.html) (none) +/// * [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) -/// * [students get courses](struct.CourseStudentGetCall.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. + /// 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. + /// 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. + /// 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. + /// 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. + /// 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. + /// Sets of materials that appear on the "about" page of this course. + /// + /// Read-only. #[serde(rename="courseMaterialSets")] pub course_material_sets: Option>, - /// State of the course. If unspecified, the default state is `PROVISIONED`. + /// 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. + /// 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, - /// 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, - /// 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. + /// 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, - /// Absolute link to this course in the Classroom web UI. Read-only. + /// 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. + /// 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. + /// 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. + /// 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. + /// 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. Specifying this field in a course update mask results in an `INVALID_ARGUMENT` error. + /// 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. Specifying this field in a course + /// update mask results in an `INVALID_ARGUMENT` error. #[serde(rename="ownerId")] pub owner_id: Option, - /// Optional heading for the description. For example, "Welcome to 10th Grade Biology." If set, this field must be a valid UTF-8 string and no longer than 3600 characters. + /// 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, } @@ -1376,7 +1628,21 @@ impl Resource for Course {} impl ResponseResult for Course {} -/// Alternative identifier for a course. An alias uniquely identifies a course. It must be unique within one of the following scopes: * domain: A domain-scoped alias is visible to all users within the alias creator's domain and can be created only by a domain admin. A domain-scoped alias is often used when a course has an identifier external to Classroom. * project: A project-scoped alias is visible to any request from an application using the Developer Console project ID that created the alias and can be created by any project. A project-scoped alias is often used when an application has alternative identifiers. A random value can also be used to avoid duplicate courses in the event of transmission failures, as retrying a request will return `ALREADY_EXISTS` if a previous one has succeeded. +/// Alternative identifier for a course. +/// +/// An alias uniquely identifies a course. It must be unique within one of the +/// following scopes: +/// +/// * domain: A domain-scoped alias is visible to all users within the alias +/// creator's domain and can be created only by a domain admin. A domain-scoped +/// alias is often used when a course has an identifier external to Classroom. +/// +/// * project: A project-scoped alias is visible to any request from an +/// application using the Developer Console project ID that created the alias +/// and can be created by any project. A project-scoped alias is often used when +/// an application has alternative identifiers. A random value can also be used +/// to avoid duplicate courses in the event of transmission failures, as retrying +/// a request will return `ALREADY_EXISTS` if a previous one has succeeded. /// /// # Activities /// @@ -1387,7 +1653,14 @@ impl ResponseResult for Course {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CourseAlias { - /// Alias string. The format of the string indicates the desired alias scoping. * `d:` indicates a domain-scoped alias. Example: `d:math_101` * `p:` indicates a project-scoped alias. Example: `p:abc123` This field has a maximum length of 256 characters. + /// Alias string. The format of the string indicates the desired alias scoping. + /// + /// * `d:` indicates a domain-scoped alias. + /// Example: `d:math_101` + /// * `p:` indicates a project-scoped alias. + /// Example: `p:abc123` + /// + /// This field has a maximum length of 256 characters. pub alias: Option, } @@ -1401,7 +1674,8 @@ impl ResponseResult for CourseAlias {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Assignment { - /// Drive folder where attachments from student submissions are placed. This is only populated for course teachers. + /// Drive folder where attachments from student submissions are placed. + /// This is only populated for course teachers. #[serde(rename="studentWorkFolder")] pub student_work_folder: Option, } @@ -1433,7 +1707,8 @@ impl Part for GlobalPermission {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListCourseWorkResponse { - /// Token identifying the next page of results to return. If empty, no further results are available. + /// Token identifying the next page of results to return. If empty, no further + /// results are available. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// Course work items that match the request. @@ -1444,7 +1719,8 @@ pub struct ListCourseWorkResponse { impl ResponseResult for ListCourseWorkResponse {} -/// An invitation to become the guardian of a specified user, sent to a specified email address. +/// An invitation to become the guardian of a specified user, sent to a specified +/// email address. /// /// # Activities /// @@ -1457,20 +1733,25 @@ impl ResponseResult for ListCourseWorkResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GuardianInvitation { - /// Unique identifier for this invitation. Read-only. - #[serde(rename="invitationId")] - pub invitation_id: Option, + /// The state that this invitation is in. + pub state: Option, /// ID of the student (in standard format) #[serde(rename="studentId")] pub student_id: Option, - /// The time that this invitation was created. Read-only. + /// The time that this invitation was created. + /// + /// Read-only. #[serde(rename="creationTime")] pub creation_time: Option, - /// Email address that the invitation was sent to. This field is only visible to domain administrators. + /// Email address that the invitation was sent to. + /// This field is only visible to domain administrators. #[serde(rename="invitedEmailAddress")] pub invited_email_address: Option, - /// The state that this invitation is in. - pub state: Option, + /// Unique identifier for this invitation. + /// + /// Read-only. + #[serde(rename="invitationId")] + pub invitation_id: Option, } impl RequestValue for GuardianInvitation {} @@ -1505,7 +1786,7 @@ impl ResponseResult for GuardianInvitation {} /// ::default(), None); /// let mut hub = Classroom::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `aliases_create(...)`, `aliases_delete(...)`, `aliases_list(...)`, `course_work_create(...)`, `course_work_get(...)`, `course_work_list(...)`, `course_work_student_submissions_get(...)`, `course_work_student_submissions_list(...)`, `course_work_student_submissions_modify_attachments(...)`, `course_work_student_submissions_patch(...)`, `course_work_student_submissions_reclaim(...)`, `course_work_student_submissions_return(...)`, `course_work_student_submissions_turn_in(...)`, `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `patch(...)`, `students_create(...)`, `students_delete(...)`, `students_get(...)`, `students_list(...)`, `teachers_create(...)`, `teachers_delete(...)`, `teachers_get(...)`, `teachers_list(...)` and `update(...)` +/// // like `aliases_create(...)`, `aliases_delete(...)`, `aliases_list(...)`, `course_work_create(...)`, `course_work_delete(...)`, `course_work_get(...)`, `course_work_list(...)`, `course_work_patch(...)`, `course_work_student_submissions_get(...)`, `course_work_student_submissions_list(...)`, `course_work_student_submissions_modify_attachments(...)`, `course_work_student_submissions_patch(...)`, `course_work_student_submissions_reclaim(...)`, `course_work_student_submissions_return(...)`, `course_work_student_submissions_turn_in(...)`, `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `patch(...)`, `students_create(...)`, `students_delete(...)`, `students_get(...)`, `students_list(...)`, `teachers_create(...)`, `teachers_delete(...)`, `teachers_get(...)`, `teachers_list(...)` and `update(...)` /// // to build up your call. /// let rb = hub.courses(); /// # } @@ -1522,12 +1803,31 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates one or more fields of a student submission. See google.classroom.v1.StudentSubmission for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + /// Updates one or more fields of a student submission. + /// + /// See google.classroom.v1.StudentSubmission for details + /// of which fields may be updated and who may change them. + /// + /// This request must be made by the Developer Console project of the + /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + /// create the corresponding course work item. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting developer project did not create + /// the corresponding course work, if the user is not permitted to make the + /// requested modification to the student submission, or for + /// access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course, course work, or student submission + /// does not exist. /// /// # Arguments /// /// * `request` - No description provided. - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// * `courseWorkId` - Identifier of the course work. /// * `id` - Identifier of the student submission. pub fn course_work_student_submissions_patch(&self, request: StudentSubmission, course_id: &str, course_work_id: &str, id: &str) -> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> { @@ -1546,12 +1846,29 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. `-` may be specified as the `course_work_id` to include student submissions for multiple course work items. Course students may only view their own work. Course teachers and domain administrators may view all student submissions. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. + /// Returns a list of student submissions that the requester is permitted to + /// view, factoring in the OAuth scopes of the request. + /// `-` may be specified as the `course_work_id` to include student + /// submissions for multiple course work items. + /// + /// Course students may only view their own work. Course teachers + /// and domain administrators may view all student submissions. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or course work, or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course does not exist. /// /// # Arguments /// - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - /// * `courseWorkId` - Identifer of the student work to request. This may be set to the string literal `"-"` to request student work for all course work in the specified course. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `courseWorkId` - Identifer of the student work to request. + /// This may be set to the string literal `"-"` to request student work for + /// all course work in the specified course. pub fn course_work_student_submissions_list(&self, course_id: &str, course_work_id: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { CourseCourseWorkStudentSubmissionListCall { hub: self.hub, @@ -1570,11 +1887,19 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. + /// Returns a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or for access errors. + /// * `NOT_FOUND` if no course exists with the requested ID. /// /// # Arguments /// - /// * `id` - Identifier of the course to return. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `id` - Identifier of the course to return. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. pub fn get(&self, id: &str) -> CourseGetCall<'a, C, A> { CourseGetCall { hub: self.hub, @@ -1587,12 +1912,22 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable + /// Updates a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + /// requested course or for access errors. + /// * `NOT_FOUND` if no course exists with the requested ID. + /// * `FAILED_PRECONDITION` for the following request errors: + /// * CourseNotModifiable /// /// # Arguments /// /// * `request` - No description provided. - /// * `id` - Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `id` - Identifier of the course to update. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. pub fn update(&self, request: Course, id: &str) -> CourseUpdateCall<'a, C, A> { CourseUpdateCall { hub: self.hub, @@ -1606,14 +1941,27 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist. + /// Returns a student of a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to view + /// students of this course or for access errors. + /// * `NOT_FOUND` if no student of this course has the requested ID or if the + /// course does not exist. /// /// # Arguments /// - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - /// * `userId` - Identifier of the student to delete. 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 - pub fn students_delete(&self, course_id: &str, user_id: &str) -> CourseStudentDeleteCall<'a, C, A> { - CourseStudentDeleteCall { + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `userId` - Identifier of the student to return. 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 + pub fn students_get(&self, course_id: &str, user_id: &str) -> CourseStudentGetCall<'a, C, A> { + CourseStudentGetCall { hub: self.hub, _course_id: course_id.to_string(), _user_id: user_id.to_string(), @@ -1625,12 +1973,25 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. + /// Returns a teacher of a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to view + /// teachers of this course or for access errors. + /// * `NOT_FOUND` if no teacher of this course has the requested ID or if the + /// course does not exist. /// /// # Arguments /// - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - /// * `userId` - Identifier of the teacher to return. 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 + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `userId` - Identifier of the teacher to return. 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 pub fn teachers_get(&self, course_id: &str, user_id: &str) -> CourseTeacherGetCall<'a, C, A> { CourseTeacherGetCall { hub: self.hub, @@ -1644,11 +2005,23 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of course work that the requester is permitted to view. Course students may only view `PUBLISHED` course work. Course teachers and domain administrators may view all course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. + /// Returns a list of course work that the requester is permitted to view. + /// + /// Course students may only view `PUBLISHED` course work. Course teachers + /// and domain administrators may view all course work. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access + /// the requested course or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course does not exist. /// /// # Arguments /// - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. pub fn course_work_list(&self, course_id: &str) -> CourseCourseWorkListCall<'a, C, A> { CourseCourseWorkListCall { hub: self.hub, @@ -1665,17 +2038,26 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of teachers of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors. + /// Returns course work. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or course work, or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course or course work does not exist. /// /// # Arguments /// - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - pub fn teachers_list(&self, course_id: &str) -> CourseTeacherListCall<'a, C, A> { - CourseTeacherListCall { + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `id` - Identifier of the course work. + pub fn course_work_get(&self, course_id: &str, id: &str) -> CourseCourseWorkGetCall<'a, C, A> { + CourseCourseWorkGetCall { hub: self.hub, _course_id: course_id.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), + _id: id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1684,12 +2066,33 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Turns in a student submission. Turning in a student submission transfers ownership of attached Drive files to the teacher and may also update the submission state. This may only be called by the student that owns the specified student submission. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, turn in the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + /// Turns in a student submission. + /// + /// Turning in a student submission transfers ownership of attached Drive + /// files to the teacher and may also update the submission state. + /// + /// This may only be called by the student that owns the specified student + /// submission. + /// + /// This request must be made by the Developer Console project of the + /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + /// create the corresponding course work item. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or course work, turn in the requested student submission, + /// or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course, course work, or student submission + /// does not exist. /// /// # Arguments /// /// * `request` - No description provided. - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// * `courseWorkId` - Identifier of the course work. /// * `id` - Identifier of the student submission. pub fn course_work_student_submissions_turn_in(&self, request: TurnInStudentSubmissionRequest, course_id: &str, course_work_id: &str, id: &str) -> CourseCourseWorkStudentSubmissionTurnInCall<'a, C, A> { @@ -1707,12 +2110,31 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Modifies attachments of student submission. Attachments may only be added to student submissions whose type is `ASSIGNMENT`. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, if the user is not permitted to modify attachments on the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + /// Modifies attachments of student submission. + /// + /// Attachments may only be added to student submissions belonging to course + /// work objects with a `workType` of `ASSIGNMENT`. + /// + /// This request must be made by the Developer Console project of the + /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + /// create the corresponding course work item. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or course work, if the user is not permitted to modify + /// attachments on the requested student submission, or for + /// access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course, course work, or student submission + /// does not exist. /// /// # Arguments /// /// * `request` - No description provided. - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// * `courseWorkId` - Identifier of the course work. /// * `id` - Identifier of the student submission. pub fn course_work_student_submissions_modify_attachments(&self, request: ModifyAttachmentsRequest, course_id: &str, course_work_id: &str, id: &str) -> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> { @@ -1730,12 +2152,62 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a student submission. Returning a student submission transfers ownership of attached Drive files to the student and may also update the submission state. Unlike the Classroom application, returning a student submission does not set assignedGrade to the draftGrade value. Only a teacher of the course that contains the requested student submission may call this method. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, return the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + /// Returns a list of teachers of this course that the requester + /// is permitted to view. + /// + /// This method returns the following error codes: + /// + /// * `NOT_FOUND` if the course does not exist. + /// * `PERMISSION_DENIED` for access errors. + /// + /// # Arguments + /// + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + pub fn teachers_list(&self, course_id: &str) -> CourseTeacherListCall<'a, C, A> { + CourseTeacherListCall { + hub: self.hub, + _course_id: course_id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns a student submission. + /// + /// Returning a student submission transfers ownership of attached Drive + /// files to the student and may also update the submission state. + /// Unlike the Classroom application, returning a student submission does not + /// set assignedGrade to the draftGrade value. + /// + /// Only a teacher of the course that contains the requested student submission + /// may call this method. + /// + /// This request must be made by the Developer Console project of the + /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + /// create the corresponding course work item. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or course work, return the requested student submission, + /// or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course, course work, or student submission + /// does not exist. /// /// # Arguments /// /// * `request` - No description provided. - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// * `courseWorkId` - Identifier of the course work. /// * `id` - Identifier of the student submission. pub fn course_work_student_submissions_return(&self, request: ReturnStudentSubmissionRequest, course_id: &str, course_work_id: &str, id: &str) -> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> { @@ -1753,17 +2225,25 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or course work does not exist. + /// Returns a list of aliases for a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// course or for access errors. + /// * `NOT_FOUND` if the course does not exist. /// /// # Arguments /// - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - /// * `id` - Identifier of the course work. - pub fn course_work_get(&self, course_id: &str, id: &str) -> CourseCourseWorkGetCall<'a, C, A> { - CourseCourseWorkGetCall { + /// * `courseId` - The identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + pub fn aliases_list(&self, course_id: &str) -> CourseAliaseListCall<'a, C, A> { + CourseAliaseListCall { hub: self.hub, _course_id: course_id.to_string(), - _id: id.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1772,12 +2252,31 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates course work. The resulting course work (and corresponding student submissions) are associated with the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to make the request. Classroom API requests to modify course work and student submissions must be made with an OAuth client ID from the associated Developer Console project. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create course work in the requested course, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. + /// Creates course work. + /// + /// The resulting course work (and corresponding student submissions) are + /// associated with the Developer Console project of the + /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + /// make the request. Classroom API requests to modify course work and student + /// submissions must be made with an OAuth client ID from the associated + /// Developer Console project. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course, create course work in the requested course, share a + /// Drive attachment, or for access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course does not exist. + /// * `FAILED_PRECONDITION` for the following request error: + /// * AttachmentNotVisible /// /// # Arguments /// /// * `request` - No description provided. - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. pub fn course_work_create(&self, request: CourseWork, course_id: &str) -> CourseCourseWorkCreateCall<'a, C, A> { CourseCourseWorkCreateCall { hub: self.hub, @@ -1791,7 +2290,14 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the query argument is malformed. * `NOT_FOUND` if any users specified in the query arguments do not exist. + /// Returns a list of courses that the requesting user is permitted to view, + /// restricted to those that match the request. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` for access errors. + /// * `INVALID_ARGUMENT` if the query argument is malformed. + /// * `NOT_FOUND` if any users specified in the query arguments do not exist. pub fn list(&self) -> CourseListCall<'a, C, A> { CourseListCall { hub: self.hub, @@ -1808,12 +2314,34 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Reclaims a student submission on behalf of the student that owns it. Reclaiming a student submission transfers ownership of attached Drive files to the student and update the submission state. Only the student that ownes the requested student submission may call this method, and only for a student submission that has been turned in. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, unsubmit the requested student submission, or for access errors. * `FAILED_PRECONDITION` if the student submission has not been turned in. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + /// Reclaims a student submission on behalf of the student that owns it. + /// + /// Reclaiming a student submission transfers ownership of attached Drive + /// files to the student and update the submission state. + /// + /// Only the student that owns the requested student submission may call this + /// method, and only for a student submission that has been turned in. + /// + /// This request must be made by the Developer Console project of the + /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + /// create the corresponding course work item. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course or course work, unsubmit the requested student submission, + /// or for access errors. + /// * `FAILED_PRECONDITION` if the student submission has not been turned in. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course, course work, or student submission + /// does not exist. /// /// # Arguments /// /// * `request` - No description provided. - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// * `courseWorkId` - Identifier of the course work. /// * `id` - Identifier of the student submission. pub fn course_work_student_submissions_reclaim(&self, request: ReclaimStudentSubmissionRequest, course_id: &str, course_work_id: &str, id: &str) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> { @@ -1831,12 +2359,24 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates an alias for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for access errors. * `NOT_FOUND` if the course does not exist. * `ALREADY_EXISTS` if the alias already exists. + /// Creates an alias for a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to create the + /// alias or for access errors. + /// * `NOT_FOUND` if the course does not exist. + /// * `ALREADY_EXISTS` if the alias already exists. + /// * `FAILED_PRECONDITION` if the alias requested does not make sense for the + /// requesting user or course (for example, if a user not in a domain + /// attempts to access a domain-scoped alias). /// /// # Arguments /// /// * `request` - No description provided. - /// * `courseId` - Identifier of the course to alias. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course to alias. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. pub fn aliases_create(&self, request: CourseAlias, course_id: &str) -> CourseAliaseCreateCall<'a, C, A> { CourseAliaseCreateCall { hub: self.hub, @@ -1850,12 +2390,27 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Adds a user as a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create students in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is already a student or teacher in the course. + /// Adds a user as a student of a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to create + /// students in this course or for access errors. + /// * `NOT_FOUND` if the requested course ID does not exist. + /// * `FAILED_PRECONDITION` if the requested user's account is disabled, + /// for the following request errors: + /// * CourseMemberLimitReached + /// * CourseNotModifiable + /// * UserGroupsMembershipLimitReached + /// * `ALREADY_EXISTS` if the user is already a student or teacher in the + /// course. /// /// # Arguments /// /// * `request` - No description provided. - /// * `courseId` - Identifier of the course to create the student in. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course to create the student in. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. pub fn students_create(&self, request: Student, course_id: &str) -> CourseStudentCreateCall<'a, C, A> { CourseStudentCreateCall { hub: self.hub, @@ -1870,12 +2425,24 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes an alias of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to remove the alias or for access errors. * `NOT_FOUND` if the alias does not exist. + /// Deletes an alias of a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to remove the + /// alias or for access errors. + /// * `NOT_FOUND` if the alias does not exist. + /// * `FAILED_PRECONDITION` if the alias requested does not make sense for the + /// requesting user or course (for example, if a user not in a domain + /// attempts to delete a domain-scoped alias). /// /// # Arguments /// - /// * `courseId` - Identifier of the course whose alias should be deleted. This identifier can be either the Classroom-assigned identifier or an alias. - /// * `alias` - Alias to delete. This may not be the Classroom-assigned identifier. + /// * `courseId` - Identifier of the course whose alias should be deleted. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `alias` - Alias to delete. + /// This may not be the Classroom-assigned identifier. pub fn aliases_delete(&self, course_id: &str, alias: &str) -> CourseAliaseDeleteCall<'a, C, A> { CourseAliaseDeleteCall { hub: self.hub, @@ -1889,7 +2456,56 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors. * `NOT_FOUND` if the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was specified in the `id` and already exists. + /// Deletes a course work. + /// + /// This request must be made by the Developer Console project of the + /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + /// create the corresponding course work item. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting developer project did not create + /// the corresponding course work, if the requesting user is not permitted + /// to delete the requested course or for access errors. + /// * `FAILED_PRECONDITION` if the requested course work has already been + /// deleted. + /// * `NOT_FOUND` if no course exists with the requested ID. + /// + /// # Arguments + /// + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `id` - Identifier of the course work to delete. + /// This identifier is a Classroom-assigned identifier. + pub fn course_work_delete(&self, course_id: &str, id: &str) -> CourseCourseWorkDeleteCall<'a, C, A> { + CourseCourseWorkDeleteCall { + hub: self.hub, + _course_id: course_id.to_string(), + _id: id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a course. + /// + /// The user specified in `ownerId` is the owner of the created course + /// and added as a teacher. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to create + /// courses or for access errors. + /// * `NOT_FOUND` if the primary teacher is not a valid user. + /// * `FAILED_PRECONDITION` if the course owner's account is disabled or for + /// the following request errors: + /// * UserGroupsMembershipLimitReached + /// * `ALREADY_EXISTS` if an alias was specified in the `id` and + /// already exists. /// /// # Arguments /// @@ -1906,11 +2522,19 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors. + /// Returns a list of students of this course that the requester + /// is permitted to view. + /// + /// This method returns the following error codes: + /// + /// * `NOT_FOUND` if the course does not exist. + /// * `PERMISSION_DENIED` for access errors. /// /// # Arguments /// - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. pub fn students_list(&self, course_id: &str) -> CourseStudentListCall<'a, C, A> { CourseStudentListCall { hub: self.hub, @@ -1925,11 +2549,19 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. + /// Deletes a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + /// requested course or for access errors. + /// * `NOT_FOUND` if no course exists with the requested ID. /// /// # Arguments /// - /// * `id` - Identifier of the course to delete. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `id` - Identifier of the course to delete. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. pub fn delete(&self, id: &str) -> CourseDeleteCall<'a, C, A> { CourseDeleteCall { hub: self.hub, @@ -1942,12 +2574,67 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates one or more fields in a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable + /// Updates one or more fields of a course work. + /// + /// See google.classroom.v1.CourseWork for details + /// of which fields may be updated and who may change them. + /// + /// This request must be made by the Developer Console project of the + /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to + /// create the corresponding course work item. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting developer project did not create + /// the corresponding course work, if the user is not permitted to make the + /// requested modification to the student submission, or for + /// access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `FAILED_PRECONDITION` if the requested course work has already been + /// deleted. + /// * `NOT_FOUND` if the requested course, course work, or student submission + /// does not exist. /// /// # Arguments /// /// * `request` - No description provided. - /// * `id` - Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `id` - Identifier of the course work. + pub fn course_work_patch(&self, request: CourseWork, course_id: &str, id: &str) -> CourseCourseWorkPatchCall<'a, C, A> { + CourseCourseWorkPatchCall { + hub: self.hub, + _request: request, + _course_id: course_id.to_string(), + _id: id.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates one or more fields in a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to modify the + /// requested course or for access errors. + /// * `NOT_FOUND` if no course exists with the requested ID. + /// * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or + /// if no update mask is supplied. + /// * `FAILED_PRECONDITION` for the following request errors: + /// * CourseNotModifiable + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `id` - Identifier of the course to update. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. pub fn patch(&self, request: Course, id: &str) -> CoursePatchCall<'a, C, A> { CoursePatchCall { hub: self.hub, @@ -1962,17 +2649,30 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of aliases for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the course or for access errors. * `NOT_FOUND` if the course does not exist. + /// Deletes a student of a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to delete + /// students of this course or for access errors. + /// * `NOT_FOUND` if no student of this course has the requested ID or if the + /// course does not exist. /// /// # Arguments /// - /// * `courseId` - The identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - pub fn aliases_list(&self, course_id: &str) -> CourseAliaseListCall<'a, C, A> { - CourseAliaseListCall { + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `userId` - Identifier of the student to delete. 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 + pub fn students_delete(&self, course_id: &str, user_id: &str) -> CourseStudentDeleteCall<'a, C, A> { + CourseStudentDeleteCall { hub: self.hub, _course_id: course_id.to_string(), - _page_token: Default::default(), - _page_size: Default::default(), + _user_id: user_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1981,12 +2681,27 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher of this course. + /// Deletes a teacher of a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to delete + /// teachers of this course or for access errors. + /// * `NOT_FOUND` if no teacher of this course has the requested ID or if the + /// course does not exist. + /// * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher + /// of this course. /// /// # Arguments /// - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - /// * `userId` - Identifier of the teacher to delete. 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 + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// * `userId` - Identifier of the teacher to delete. 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 pub fn teachers_delete(&self, course_id: &str, user_id: &str) -> CourseTeacherDeleteCall<'a, C, A> { CourseTeacherDeleteCall { hub: self.hub, @@ -2000,12 +2715,28 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create teachers in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if the user is already a teacher or student in the course. + /// Creates a teacher of a course. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to create + /// teachers in this course or for access errors. + /// * `NOT_FOUND` if the requested course ID does not exist. + /// * `FAILED_PRECONDITION` if the requested user's account is disabled, + /// for the following request errors: + /// * CourseMemberLimitReached + /// * CourseNotModifiable + /// * CourseTeacherLimitReached + /// * UserGroupsMembershipLimitReached + /// * `ALREADY_EXISTS` if the user is already a teacher or student in the + /// course. /// /// # Arguments /// /// * `request` - No description provided. - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. pub fn teachers_create(&self, request: Teacher, course_id: &str) -> CourseTeacherCreateCall<'a, C, A> { CourseTeacherCreateCall { hub: self.hub, @@ -2019,11 +2750,20 @@ impl<'a, C, A> CourseMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a student submission. * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, course work, or student submission or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. + /// Returns a student submission. + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access the + /// requested course, course work, or student submission or for + /// access errors. + /// * `INVALID_ARGUMENT` if the request is malformed. + /// * `NOT_FOUND` if the requested course, course work, or student submission + /// does not exist. /// /// # Arguments /// - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// * `courseId` - Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// * `courseWorkId` - Identifier of the course work. /// * `id` - Identifier of the student submission. pub fn course_work_student_submissions_get(&self, course_id: &str, course_work_id: &str, id: &str) -> CourseCourseWorkStudentSubmissionGetCall<'a, C, A> { @@ -2037,25 +2777,6 @@ impl<'a, C, A> CourseMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Returns a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist. - /// - /// # Arguments - /// - /// * `courseId` - Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - /// * `userId` - Identifier of the student to return. 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 - pub fn students_get(&self, course_id: &str, user_id: &str) -> CourseStudentGetCall<'a, C, A> { - CourseStudentGetCall { - hub: self.hub, - _course_id: course_id.to_string(), - _user_id: user_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -2100,11 +2821,28 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a specific guardian. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view guardian information 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, nor the literal string `me`). * `NOT_FOUND` if Classroom cannot find any record of the given student or `guardian_id`, or if the guardian has been disabled. + /// Returns a specific guardian. + /// + /// 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 view guardian information 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, nor the literal string `me`). + /// * `NOT_FOUND` if the requesting user is permitted to view guardians for + /// the requested `student_id`, but no `Guardian` record exists for that + /// student that matches the provided `guardian_id`. /// /// # Arguments /// - /// * `studentId` - The student whose guardian is being requested. One of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + /// * `studentId` - The student whose guardian is being requested. 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_get(&self, student_id: &str, guardian_id: &str) -> UserProfileGuardianGetCall<'a, C, A> { UserProfileGuardianGetCall { @@ -2118,7 +2856,36 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a guardian invitation, and sends an email to the guardian asking them to confirm that they are the student's guardian. Once the guardian accepts the invitation, their `state` will change to `COMPLETED` and they will start receiving guardian notifications. A `Guardian` resource will also be created to represent the active guardian. The request object must have the `student_id` and `invited_email_address` fields set. Failing to set these fields, or setting any other fields in the request, will result in an error. This method returns the following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if the guardian in question has already rejected too many requests for that student, if guardians are not enabled for the domain in question, or for other access errors. * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian link limit. * `INVALID_ARGUMENT` if the guardian email address is not valid (for example, if it is too long), or if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API). This error will also be returned if read-only fields are set, or if the `state` field is set to to a value other than `PENDING`. * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student. * `ALREADY_EXISTS` if there is already a pending guardian invitation for the student and `invited_email_address` provided, or if the provided `invited_email_address` matches the Google account of an existing `Guardian` for this user. + /// Creates a guardian invitation, and sends an email to the guardian asking + /// them to confirm that they are the student's guardian. + /// + /// Once the guardian accepts the invitation, their `state` will change to + /// `COMPLETED` and they will start receiving guardian notifications. A + /// `Guardian` resource will also be created to represent the active guardian. + /// + /// The request object must have the `student_id` and + /// `invited_email_address` fields set. Failing to set these fields, or + /// setting any other fields in the request, will result in an error. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the current user does not have permission to + /// manage guardians, if the guardian in question has already rejected + /// too many requests for that student, if guardians are not enabled for the + /// domain in question, or for other access errors. + /// * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian + /// link limit. + /// * `INVALID_ARGUMENT` if the guardian email address is not valid (for + /// example, if it is too long), or if the format of the student ID provided + /// cannot be recognized (it is not an email address, nor a `user_id` from + /// this API). This error will also be returned if read-only fields are set, + /// or if the `state` field is set to to a value other than `PENDING`. + /// * `NOT_FOUND` if the student ID provided is a valid student ID, but + /// Classroom has no record of that student. + /// * `ALREADY_EXISTS` if there is already a pending guardian invitation for + /// the student and `invited_email_address` provided, or if the provided + /// `invited_email_address` matches the Google account of an existing + /// `Guardian` for this user. /// /// # Arguments /// @@ -2136,11 +2903,21 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a user profile. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile or if no profile exists with the requested ID or for access errors. + /// Returns a user profile. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to access + /// this user profile, if no profile exists with the requested ID, or for + /// access errors. /// /// # Arguments /// - /// * `userId` - Identifier of the profile to return. 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 + /// * `userId` - Identifier of the profile to return. 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 pub fn get(&self, user_id: &str) -> UserProfileGetCall<'a, C, A> { UserProfileGetCall { hub: self.hub, @@ -2153,7 +2930,24 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Modifies a guardian invitation. Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other access errors. * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. * `INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`. * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom. + /// Modifies a guardian invitation. + /// + /// Currently, the only valid modification is to change the `state` from + /// `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the current user does not have permission to + /// manage guardians, if guardians are not enabled for the domain in question + /// or for other access errors. + /// * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. + /// * `INVALID_ARGUMENT` if the format of the student ID provided + /// cannot be recognized (it is not an email address, nor a `user_id` from + /// this API), or if the passed `GuardianInvitation` has a `state` other than + /// `COMPLETE`, or if it modifies fields other than `state`. + /// * `NOT_FOUND` if the student ID provided is a valid student ID, but + /// Classroom has no record of that student, or if the `id` field does not + /// refer to a guardian invitation known to Classroom. /// /// # Arguments /// @@ -2174,7 +2968,20 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a specific guardian invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view guardian invitations 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, nor the literal string `me`). * `NOT_FOUND` if Classroom cannot find any record of the given student or `invitation_id`. May also be returned if the student exists, but the requesting user does not have access to see that student. + /// Returns a specific guardian invitation. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to view + /// guardian invitations 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, nor the literal string `me`). + /// * `NOT_FOUND` if Classroom cannot find any record of the given student or + /// `invitation_id`. May also be returned if the student exists, but the + /// requesting user does not have access to see that student. /// /// # Arguments /// @@ -2192,11 +2999,36 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of guardians that the requesting user is permitted to view, restricted to those that match the request. To list guardians for any student that the requesting user may view guardians for, use the literal character `-` for the student ID. This method returns the following error codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian information for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, if the `invited_email_address` filter is set by a user who is not a domain administrator, 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, nor the literal string `me`). May also be returned if an invalid `page_token` is provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student. + /// Returns a list of guardians that the requesting user is permitted to + /// view, restricted to those that match the request. + /// + /// To list guardians for any student that the requesting user may view + /// guardians for, use the literal character `-` for the student ID. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting + /// user is not permitted to view guardian information for that student, if + /// `"-"` is specified as the `student_id` and the user is not a domain + /// administrator, if guardians are not enabled for the domain in question, + /// if the `invited_email_address` filter is set by a user who is not a + /// domain administrator, 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, nor the literal string `me`). May also be returned if an invalid + /// `page_token` is provided. + /// * `NOT_FOUND` if a `student_id` is specified, and its format can be + /// recognized, but Classroom has no record of that student. /// /// # Arguments /// - /// * `studentId` - Filter results by the student who the guardian is linked to. 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 * the string literal `"-"`, indicating that results should be returned for all students that the requesting user has access to view. + /// * `studentId` - Filter results by the student who the guardian is linked to. + /// 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 + /// * the string literal `"-"`, indicating that results should be returned for + /// all students that the requesting user has access to view. pub fn guardians_list(&self, student_id: &str) -> UserProfileGuardianListCall<'a, C, A> { UserProfileGuardianListCall { hub: self.hub, @@ -2211,11 +3043,33 @@ impl<'a, C, A> UserProfileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of guardian invitations that the requesting user is permitted to view, filtered by the parameters provided. This method returns the following error codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian invitations for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, 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, nor the literal string `me`). May also be returned if an invalid `page_token` or `state` is provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student. + /// Returns a list of guardian invitations that the requesting user is + /// permitted to view, filtered by the parameters provided. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting + /// user is not permitted to view guardian invitations for that student, if + /// `"-"` is specified as the `student_id` and the user is not a domain + /// administrator, 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, nor the literal string `me`). May also be returned if an invalid + /// `page_token` or `state` is provided. + /// * `NOT_FOUND` if a `student_id` is specified, and its format can be + /// recognized, but Classroom has no record of that student. /// /// # Arguments /// - /// * `studentId` - The ID of the student whose guardian invitations are to be returned. 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 * the string literal `"-"`, indicating that results should be returned for all students that the requesting user is permitted to view guardian invitations. + /// * `studentId` - The ID of the student whose guardian invitations are to be returned. + /// 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 + /// * the string literal `"-"`, indicating that results should be returned for + /// all students that the requesting user is permitted to view guardian + /// invitations. pub fn guardian_invitations_list(&self, student_id: &str) -> UserProfileGuardianInvitationListCall<'a, C, A> { UserProfileGuardianInvitationListCall { hub: self.hub, @@ -2231,11 +3085,31 @@ 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 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 Classroom cannot find any record of the given `student_id` or `guardian_id`, or if the guardian has already been disabled. + /// 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 + /// * `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 { @@ -2290,7 +3164,13 @@ impl<'a, C, A> InvitationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID. + /// Deletes an invitation. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to delete the + /// requested invitation or for access errors. + /// * `NOT_FOUND` if no invitation exists with the requested ID. /// /// # Arguments /// @@ -2307,23 +3187,18 @@ impl<'a, C, A> InvitationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` or `course_id` must be supplied. Both fields can be supplied. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. - pub fn list(&self) -> InvitationListCall<'a, C, A> { - InvitationListCall { - hub: self.hub, - _user_id: Default::default(), - _page_token: Default::default(), - _page_size: Default::default(), - _course_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create invitations for this course or for access errors. * `NOT_FOUND` if the course or the user does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled or if the user already has this role or a role with greater permissions. * `ALREADY_EXISTS` if an invitation for the specified user and course already exists. + /// Creates an invitation. Only one invitation for a user and course may exist + /// at a time. Delete and re-create an invitation to make changes. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to create + /// invitations for this course or for access errors. + /// * `NOT_FOUND` if the course or the user does not exist. + /// * `FAILED_PRECONDITION` if the requested user's account is disabled or if + /// the user already has this role or a role with greater permissions. + /// * `ALREADY_EXISTS` if an invitation for the specified user and course + /// already exists. /// /// # Arguments /// @@ -2340,7 +3215,37 @@ impl<'a, C, A> InvitationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID. + /// Returns a list of invitations that the requesting user is permitted to + /// view, restricted to those that match the list request. + /// + /// *Note:* At least one of `user_id` or `course_id` must be supplied. Both + /// fields can be supplied. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` for access errors. + pub fn list(&self) -> InvitationListCall<'a, C, A> { + InvitationListCall { + hub: self.hub, + _user_id: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _course_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns an invitation. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to view the + /// requested invitation or for access errors. + /// * `NOT_FOUND` if no invitation exists with the requested ID. /// /// # Arguments /// @@ -2357,7 +3262,20 @@ impl<'a, C, A> InvitationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to accept the requested invitation or for access errors. * `FAILED_PRECONDITION` for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `NOT_FOUND` if no invitation exists with the requested ID. + /// Accepts an invitation, removing it and adding the invited user to the + /// teachers or students (as appropriate) of the specified course. Only the + /// invited user may accept an invitation. + /// + /// This method returns the following error codes: + /// + /// * `PERMISSION_DENIED` if the requesting user is not permitted to accept the + /// requested invitation or for access errors. + /// * `FAILED_PRECONDITION` for the following request errors: + /// * CourseMemberLimitReached + /// * CourseNotModifiable + /// * CourseTeacherLimitReached + /// * UserGroupsMembershipLimitReached + /// * `NOT_FOUND` if no invitation exists with the requested ID. /// /// # Arguments /// @@ -2381,7 +3299,24 @@ impl<'a, C, A> InvitationMethods<'a, C, A> { // CallBuilders ### // ################# -/// Updates one or more fields of a student submission. See google.classroom.v1.StudentSubmission for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. +/// Updates one or more fields of a student submission. +/// +/// See google.classroom.v1.StudentSubmission for details +/// of which fields may be updated and who may change them. +/// +/// This request must be made by the Developer Console project of the +/// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to +/// create the corresponding course work item. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting developer project did not create +/// the corresponding course work, if the user is not permitted to make the +/// requested modification to the student submission, or for +/// access errors. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `NOT_FOUND` if the requested course, course work, or student submission +/// does not exist. /// /// A builder for the *courseWork.studentSubmissions.patch* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -2467,7 +3402,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}"; + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMe.as_ref().to_string(), ()); } @@ -2594,7 +3529,9 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> where C: Bor self._request = new_value; self } - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// @@ -2624,7 +3561,13 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> where C: Bor self._id = new_value.to_string(); self } - /// Mask that identifies which fields on the student submission to update. This field is required to do an update. The update fails if invalid fields are specified. The following fields may be specified by teachers: * `draft_grade` * `assigned_grade` + /// Mask that identifies which fields on the student submission to update. + /// This field is required to do an update. The update fails if invalid + /// fields are specified. + /// + /// The following fields may be specified by teachers: + /// * `draft_grade` + /// * `assigned_grade` /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> { @@ -2651,17 +3594,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'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) -> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> @@ -2689,7 +3632,20 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionPatchCall<'a, C, A> where C: Bor } -/// Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. `-` may be specified as the `course_work_id` to include student submissions for multiple course work items. Course students may only view their own work. Course teachers and domain administrators may view all student submissions. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. +/// Returns a list of student submissions that the requester is permitted to +/// view, factoring in the OAuth scopes of the request. +/// `-` may be specified as the `course_work_id` to include student +/// submissions for multiple course work items. +/// +/// Course students may only view their own work. Course teachers +/// and domain administrators may view all student submissions. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the +/// requested course or course work, or for access errors. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `NOT_FOUND` if the requested course does not exist. /// /// A builder for the *courseWork.studentSubmissions.list* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -2788,7 +3744,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions"; + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMeReadonly.as_ref().to_string(), ()); } @@ -2891,7 +3847,9 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr } - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// @@ -2901,7 +3859,9 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr self._course_id = new_value.to_string(); self } - /// Identifer of the student work to request. This may be set to the string literal `"-"` to request student work for all course work in the specified course. + /// Identifer of the student work to request. + /// This may be set to the string literal `"-"` to request student work for + /// all course work in the specified course. /// /// Sets the *course work id* path property to the given value. /// @@ -2911,14 +3871,21 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr self._course_work_id = new_value.to_string(); self } - /// Optional argument to restrict returned student work to those owned by the student with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + /// Optional argument to restrict returned student work to those owned by the + /// student with the specified identifier. The identifier can be one of the + /// following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user /// /// Sets the *user id* query property to the given value. pub fn user_id(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { self._user_id = Some(new_value.to_string()); self } - /// Requested submission states. If specified, returned student submissions match one of the specified submission states. + /// Requested submission states. If specified, returned student submissions + /// match one of the specified submission states. /// /// Append the given value to the *states* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -2926,21 +3893,32 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr self._states.push(new_value.to_string()); self } - /// nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + /// nextPageToken + /// value returned from a previous + /// list call, + /// indicating that the subsequent page of results should be returned. + /// + /// The list request + /// must be otherwise identical to the one that resulted in this token. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + /// Maximum number of items to return. Zero or unspecified indicates that the + /// server may assign a maximum. + /// + /// The server may return fewer than the specified number of results. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// Requested lateness value. If specified, returned student submissions are restricted by the requested value. If unspecified, submissions are returned regardless of `late` value. + /// Requested lateness value. If specified, returned student submissions are + /// restricted by the requested value. + /// If unspecified, submissions are returned regardless of `late` value. /// /// Sets the *late* query property to the given value. pub fn late(mut self, new_value: &str) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> { @@ -2967,17 +3945,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr /// /// # 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) -> CourseCourseWorkStudentSubmissionListCall<'a, C, A> @@ -3005,7 +3983,13 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionListCall<'a, C, A> where C: Borr } -/// Returns a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. +/// Returns a course. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the +/// requested course or for access errors. +/// * `NOT_FOUND` if no course exists with the requested ID. /// /// A builder for the *get* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -3075,7 +4059,7 @@ impl<'a, C, A> CourseGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{id}"; + let mut url = "https://classroom.googleapis.com/v1/courses/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseReadonly.as_ref().to_string(), ()); } @@ -3178,7 +4162,9 @@ impl<'a, C, A> CourseGetCall<'a, C, A> where C: BorrowMut, A: oau } - /// Identifier of the course to return. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course to return. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *id* path property to the given value. /// @@ -3208,17 +4194,17 @@ impl<'a, C, A> CourseGetCall<'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) -> CourseGetCall<'a, C, A> @@ -3246,7 +4232,15 @@ impl<'a, C, A> CourseGetCall<'a, C, A> where C: BorrowMut, A: oau } -/// Updates a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable +/// Updates a course. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to modify the +/// requested course or for access errors. +/// * `NOT_FOUND` if no course exists with the requested ID. +/// * `FAILED_PRECONDITION` for the following request errors: +/// * CourseNotModifiable /// /// A builder for the *update* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -3323,7 +4317,7 @@ impl<'a, C, A> CourseUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{id}"; + let mut url = "https://classroom.googleapis.com/v1/courses/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Course.as_ref().to_string(), ()); } @@ -3450,7 +4444,9 @@ impl<'a, C, A> CourseUpdateCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course to update. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *id* path property to the given value. /// @@ -3480,17 +4476,17 @@ impl<'a, C, A> CourseUpdateCall<'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) -> CourseUpdateCall<'a, C, A> @@ -3518,9 +4514,16 @@ impl<'a, C, A> CourseUpdateCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist. +/// Returns a student of a course. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to view +/// students of this course or for access errors. +/// * `NOT_FOUND` if no student of this course has the requested ID or if the +/// course does not exist. /// -/// A builder for the *students.delete* method supported by a *course* resource. +/// A builder for the *students.get* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. /// /// # Example @@ -3544,11 +4547,11 @@ impl<'a, C, A> CourseUpdateCall<'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.courses().students_delete("courseId", "userId") +/// let result = hub.courses().students_get("courseId", "userId") /// .doit(); /// # } /// ``` -pub struct CourseStudentDeleteCall<'a, C, A> +pub struct CourseStudentGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Classroom, @@ -3559,13 +4562,13 @@ pub struct CourseStudentDeleteCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for CourseStudentDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for CourseStudentGetCall<'a, C, A> {} -impl<'a, C, A> CourseStudentDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> CourseStudentGetCall<'a, C, 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, Student)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -3573,260 +4576,7 @@ impl<'a, C, A> CourseStudentDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "classroom.courses.students.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("courseId", self._course_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "courseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/students/{userId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Roster.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{courseId}", "courseId"), ("{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", "courseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - /// - /// Sets the *course id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn course_id(mut self, new_value: &str) -> CourseStudentDeleteCall<'a, C, A> { - self._course_id = new_value.to_string(); - self - } - /// Identifier of the student to delete. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - /// - /// Sets the *user id* path property to 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) -> CourseStudentDeleteCall<'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) -> CourseStudentDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> CourseStudentDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Roster`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CourseStudentDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Returns a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. -/// -/// A builder for the *teachers.get* method supported by a *course* resource. -/// It is not used directly, but through a `CourseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate 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::new(), -/// # ::default(), None); -/// # let mut hub = Classroom::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.courses().teachers_get("courseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct CourseTeacherGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Classroom, - _course_id: String, - _user_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CourseTeacherGetCall<'a, C, A> {} - -impl<'a, C, A> CourseTeacherGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Teacher)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "classroom.courses.teachers.get", + dlg.begin(MethodInfo { id: "classroom.courses.students.get", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("courseId", self._course_id.to_string())); @@ -3843,7 +4593,7 @@ impl<'a, C, A> CourseTeacherGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/teachers/{userId}"; + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/students/{userId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -3946,7 +4696,276 @@ impl<'a, C, A> CourseTeacherGetCall<'a, C, A> where C: BorrowMut, } - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn course_id(mut self, new_value: &str) -> CourseStudentGetCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the student to return. The identifier can be one of the + /// following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user + /// + /// Sets the *user id* path property to 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) -> CourseStudentGetCall<'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) -> CourseStudentGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> CourseStudentGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::RosterReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CourseStudentGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns a teacher of a course. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to view +/// teachers of this course or for access errors. +/// * `NOT_FOUND` if no teacher of this course has the requested ID or if the +/// course does not exist. +/// +/// A builder for the *teachers.get* method supported by a *course* resource. +/// It is not used directly, but through a `CourseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate 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::new(), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.courses().teachers_get("courseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct CourseTeacherGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _course_id: String, + _user_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseTeacherGetCall<'a, C, A> {} + +impl<'a, C, A> CourseTeacherGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Teacher)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.teachers.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "courseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/teachers/{userId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{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", "courseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// @@ -3956,7 +4975,12 @@ impl<'a, C, A> CourseTeacherGetCall<'a, C, A> where C: BorrowMut, self._course_id = new_value.to_string(); self } - /// Identifier of the teacher to return. 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 + /// Identifier of the teacher to return. The identifier can be one of the + /// following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user /// /// Sets the *user id* path property to the given value. /// @@ -3986,17 +5010,17 @@ impl<'a, C, A> CourseTeacherGetCall<'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) -> CourseTeacherGetCall<'a, C, A> @@ -4024,7 +5048,17 @@ impl<'a, C, A> CourseTeacherGetCall<'a, C, A> where C: BorrowMut, } -/// Returns a list of course work that the requester is permitted to view. Course students may only view `PUBLISHED` course work. Course teachers and domain administrators may view all course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist. +/// Returns a list of course work that the requester is permitted to view. +/// +/// Course students may only view `PUBLISHED` course work. Course teachers +/// and domain administrators may view all course work. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access +/// the requested course or for access errors. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `NOT_FOUND` if the requested course does not exist. /// /// A builder for the *courseWork.list* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -4116,9 +5150,9 @@ impl<'a, C, A> CourseCourseWorkListCall<'a, C, A> where C: BorrowMut CourseCourseWorkListCall<'a, C, A> where C: BorrowMut CourseCourseWorkListCall<'a, C, A> where C: BorrowMut CourseCourseWorkListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + /// Maximum number of items to return. Zero or unspecified indicates that the + /// server may assign a maximum. + /// + /// The server may return fewer than the specified number of results. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> CourseCourseWorkListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// Optional sort ordering for results. A comma-separated list of fields with an optional sort direction keyword. Supported fields are `updateTime` and `dueDate`. Supported direction keywords are `asc` and `desc`. If not specified, `updateTime desc` is the default behavior. Examples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc` + /// Optional sort ordering for results. A comma-separated list of fields with + /// an optional sort direction keyword. Supported fields are `updateTime` + /// and `dueDate`. Supported direction keywords are `asc` and `desc`. + /// If not specified, `updateTime desc` is the default behavior. + /// Examples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc` /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> CourseCourseWorkListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// Restriction on the work status to return. Only courseWork that matches is returned. If unspecified, items with a work status of `PUBLISHED` is returned. + /// Restriction on the work status to return. Only courseWork that matches + /// is returned. If unspecified, items with a work status of `PUBLISHED` + /// is returned. /// /// Append the given value to the *course work states* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -4278,17 +5329,17 @@ impl<'a, C, A> CourseCourseWorkListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkListCall<'a, C, A> @@ -4300,7 +5351,7 @@ impl<'a, C, A> CourseCourseWorkListCall<'a, C, A> where C: BorrowMut CourseCourseWorkListCall<'a, C, A> where C: BorrowMut CourseCourseWorkListCall<'a, C, A> where C: BorrowMut +pub struct CourseCourseWorkGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Classroom, _course_id: String, - _page_token: Option, - _page_size: Option, + _id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for CourseTeacherListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for CourseCourseWorkGetCall<'a, C, A> {} -impl<'a, C, A> CourseTeacherListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListTeachersResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, CourseWork)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -4374,17 +5429,12 @@ impl<'a, C, A> CourseTeacherListCall<'a, C, A> where C: BorrowMut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "classroom.courses.teachers.list", + dlg.begin(MethodInfo { id: "classroom.courses.courseWork.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((4 + self._additional_params.len())); params.push(("courseId", self._course_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", "courseId", "pageToken", "pageSize"].iter() { + params.push(("id", self._id.to_string())); + for &field in ["alt", "courseId", "id"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4396,12 +5446,12 @@ impl<'a, C, A> CourseTeacherListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/teachers"; + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{id}".to_string(); if self._scopes.len() == 0 { - self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); + self._scopes.insert(Scope::CourseworkMeReadonly.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{courseId}", "courseId")].iter() { + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{id}", "id")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -4412,8 +5462,8 @@ impl<'a, C, A> CourseTeacherListCall<'a, C, A> where C: BorrowMut url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["courseId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["id", "courseId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -4499,28 +5549,26 @@ impl<'a, C, A> CourseTeacherListCall<'a, C, A> where C: BorrowMut } - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn course_id(mut self, new_value: &str) -> CourseTeacherListCall<'a, C, A> { + pub fn course_id(mut self, new_value: &str) -> CourseCourseWorkGetCall<'a, C, A> { self._course_id = new_value.to_string(); self } - /// nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + /// Identifier of the course work. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> CourseTeacherListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results. + /// Sets the *id* path property to the given value. /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> CourseTeacherListCall<'a, C, A> { - self._page_size = Some(new_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) -> CourseCourseWorkGetCall<'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 @@ -4529,7 +5577,7 @@ impl<'a, C, A> CourseTeacherListCall<'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) -> CourseTeacherListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CourseCourseWorkGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4543,20 +5591,20 @@ impl<'a, C, A> CourseTeacherListCall<'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) -> CourseTeacherListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> CourseCourseWorkGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4565,7 +5613,7 @@ impl<'a, C, A> CourseTeacherListCall<'a, C, A> where C: BorrowMut /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::RosterReadonly`. + /// `Scope::CourseworkMeReadonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -4573,7 +5621,7 @@ impl<'a, C, A> CourseTeacherListCall<'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) -> CourseTeacherListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> CourseCourseWorkGetCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -4581,7 +5629,26 @@ impl<'a, C, A> CourseTeacherListCall<'a, C, A> where C: BorrowMut } -/// Turns in a student submission. Turning in a student submission transfers ownership of attached Drive files to the teacher and may also update the submission state. This may only be called by the student that owns the specified student submission. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, turn in the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. +/// Turns in a student submission. +/// +/// Turning in a student submission transfers ownership of attached Drive +/// files to the teacher and may also update the submission state. +/// +/// This may only be called by the student that owns the specified student +/// submission. +/// +/// This request must be made by the Developer Console project of the +/// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to +/// create the corresponding course work item. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the +/// requested course or course work, turn in the requested student submission, +/// or for access errors. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `NOT_FOUND` if the requested course, course work, or student submission +/// does not exist. /// /// A builder for the *courseWork.studentSubmissions.turnIn* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -4662,7 +5729,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionTurnInCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn"; + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMe.as_ref().to_string(), ()); } @@ -4789,7 +5856,9 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionTurnInCall<'a, C, A> where C: Bo self._request = new_value; self } - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// @@ -4839,17 +5908,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionTurnInCall<'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. - /// * *fields* (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> @@ -4877,7 +5946,24 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionTurnInCall<'a, C, A> where C: Bo } -/// Modifies attachments of student submission. Attachments may only be added to student submissions whose type is `ASSIGNMENT`. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, if the user is not permitted to modify attachments on the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. +/// Modifies attachments of student submission. +/// +/// Attachments may only be added to student submissions belonging to course +/// work objects with a `workType` of `ASSIGNMENT`. +/// +/// This request must be made by the Developer Console project of the +/// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to +/// create the corresponding course work item. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the +/// requested course or course work, if the user is not permitted to modify +/// attachments on the requested student submission, or for +/// access errors. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `NOT_FOUND` if the requested course, course work, or student submission +/// does not exist. /// /// A builder for the *courseWork.studentSubmissions.modifyAttachments* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -4958,7 +6044,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> w params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments"; + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMe.as_ref().to_string(), ()); } @@ -5085,7 +6171,9 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> w self._request = new_value; self } - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// @@ -5135,17 +6223,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'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) -> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> @@ -5173,7 +6261,309 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionModifyAttachmentCall<'a, C, A> w } -/// Returns a student submission. Returning a student submission transfers ownership of attached Drive files to the student and may also update the submission state. Unlike the Classroom application, returning a student submission does not set assignedGrade to the draftGrade value. Only a teacher of the course that contains the requested student submission may call this method. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, return the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. +/// Returns a list of teachers of this course that the requester +/// is permitted to view. +/// +/// This method returns the following error codes: +/// +/// * `NOT_FOUND` if the course does not exist. +/// * `PERMISSION_DENIED` for access errors. +/// +/// A builder for the *teachers.list* method supported by a *course* resource. +/// It is not used directly, but through a `CourseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate 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::new(), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.courses().teachers_list("courseId") +/// .page_token("eirmod") +/// .page_size(-58) +/// .doit(); +/// # } +/// ``` +pub struct CourseTeacherListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _course_id: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseTeacherListCall<'a, C, A> {} + +impl<'a, C, A> CourseTeacherListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListTeachersResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.teachers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("courseId", self._course_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", "courseId", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/teachers".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["courseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn course_id(mut self, new_value: &str) -> CourseTeacherListCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// nextPageToken + /// value returned from a previous + /// list call, indicating that + /// the subsequent page of results should be returned. + /// + /// The list request must be + /// otherwise identical to the one that resulted in this token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> CourseTeacherListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of items to return. Zero means no maximum. + /// + /// The server may return fewer than the specified number of results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> CourseTeacherListCall<'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) -> CourseTeacherListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> CourseTeacherListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::RosterReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CourseTeacherListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns a student submission. +/// +/// Returning a student submission transfers ownership of attached Drive +/// files to the student and may also update the submission state. +/// Unlike the Classroom application, returning a student submission does not +/// set assignedGrade to the draftGrade value. +/// +/// Only a teacher of the course that contains the requested student submission +/// may call this method. +/// +/// This request must be made by the Developer Console project of the +/// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to +/// create the corresponding course work item. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the +/// requested course or course work, return the requested student submission, +/// or for access errors. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `NOT_FOUND` if the requested course, course work, or student submission +/// does not exist. /// /// A builder for the *courseWork.studentSubmissions.return* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -5254,7 +6644,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return"; + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkStudent.as_ref().to_string(), ()); } @@ -5381,7 +6771,9 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> where C: Bo self._request = new_value; self } - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// @@ -5431,17 +6823,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReturnCall<'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. - /// * *fields* (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> @@ -5469,9 +6861,15 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> where C: Bo } -/// Returns course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or course work does not exist. +/// Returns a list of aliases for a course. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the +/// course or for access errors. +/// * `NOT_FOUND` if the course does not exist. /// -/// A builder for the *courseWork.get* method supported by a *course* resource. +/// A builder for the *aliases.list* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. /// /// # Example @@ -5495,28 +6893,31 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReturnCall<'a, C, A> where C: Bo /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.courses().course_work_get("courseId", "id") +/// let result = hub.courses().aliases_list("courseId") +/// .page_token("ut") +/// .page_size(-16) /// .doit(); /// # } /// ``` -pub struct CourseCourseWorkGetCall<'a, C, A> +pub struct CourseAliaseListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Classroom, _course_id: String, - _id: String, + _page_token: Option, + _page_size: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for CourseCourseWorkGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for CourseAliaseListCall<'a, C, A> {} -impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> CourseAliaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, CourseWork)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListCourseAliasesResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -5524,12 +6925,17 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "classroom.courses.courseWork.get", + dlg.begin(MethodInfo { id: "classroom.courses.aliases.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((5 + self._additional_params.len())); params.push(("courseId", self._course_id.to_string())); - params.push(("id", self._id.to_string())); - for &field in ["alt", "courseId", "id"].iter() { + if 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", "courseId", "pageToken", "pageSize"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5541,12 +6947,12 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -5557,8 +6963,8 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["id", "courseId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["courseId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -5644,24 +7050,39 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut CourseCourseWorkGetCall<'a, C, A> { + pub fn course_id(mut self, new_value: &str) -> CourseAliaseListCall<'a, C, A> { self._course_id = new_value.to_string(); self } - /// Identifier of the course work. + /// nextPageToken + /// value returned from a previous + /// list call, + /// indicating that the subsequent page of results should be returned. + /// + /// The list request + /// must be otherwise identical to the one that resulted in this token. /// - /// Sets the *id* path property to the given value. + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> CourseAliaseListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of items to return. Zero or unspecified indicates that the + /// server may assign a maximum. + /// + /// The server may return fewer than the specified number of results. /// - /// 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) -> CourseCourseWorkGetCall<'a, C, A> { - self._id = new_value.to_string(); + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> CourseAliaseListCall<'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 @@ -5670,7 +7091,7 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut CourseCourseWorkGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> CourseAliaseListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5684,20 +7105,20 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> CourseAliaseListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5706,7 +7127,7 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> CourseCourseWorkGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> CourseAliaseListCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -5722,7 +7143,24 @@ impl<'a, C, A> CourseCourseWorkGetCall<'a, C, A> where C: BorrowMut CourseCourseWorkCreateCall<'a, C, A> where C: BorrowMut CourseCourseWorkCreateCall<'a, C, A> where C: BorrowMut CourseCourseWorkCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseCourseWorkCreateCall<'a, C, A> @@ -5994,7 +7434,14 @@ impl<'a, C, A> CourseCourseWorkCreateCall<'a, C, A> where C: BorrowMut CourseCourseWorkCreateCall<'a, C, A> where C: BorrowMut CourseListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses"; + let mut url = "https://classroom.googleapis.com/v1/courses".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseReadonly.as_ref().to_string(), ()); } @@ -6171,28 +7618,47 @@ impl<'a, C, A> CourseListCall<'a, C, A> where C: BorrowMut, A: oa } - /// Restricts returned courses to those having a teacher with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + /// Restricts returned courses to those having a teacher with the specified + /// identifier. The identifier can be one of the following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user /// /// Sets the *teacher id* query property to the given value. pub fn teacher_id(mut self, new_value: &str) -> CourseListCall<'a, C, A> { self._teacher_id = Some(new_value.to_string()); self } - /// Restricts returned courses to those having a student with the specified identifier. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user + /// Restricts returned courses to those having a student with the specified + /// identifier. The identifier can be one of the following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user /// /// Sets the *student id* query property to the given value. pub fn student_id(mut self, new_value: &str) -> CourseListCall<'a, C, A> { self._student_id = Some(new_value.to_string()); self } - /// nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + /// nextPageToken + /// value returned from a previous + /// list call, + /// indicating that the subsequent page of results should be returned. + /// + /// The list request must be + /// otherwise identical to the one that resulted in this token. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> CourseListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + /// Maximum number of items to return. Zero or unspecified indicates that the + /// server may assign a maximum. + /// + /// The server may return fewer than the specified number of results. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> CourseListCall<'a, C, A> { @@ -6200,6 +7666,7 @@ impl<'a, C, A> CourseListCall<'a, C, A> where C: BorrowMut, A: oa self } /// Restricts returned courses to those in one of the specified states + /// The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED. /// /// Append the given value to the *course states* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -6227,17 +7694,17 @@ impl<'a, C, A> CourseListCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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> @@ -6265,7 +7732,27 @@ impl<'a, C, A> CourseListCall<'a, C, A> where C: BorrowMut, A: oa } -/// Reclaims a student submission on behalf of the student that owns it. Reclaiming a student submission transfers ownership of attached Drive files to the student and update the submission state. Only the student that ownes the requested student submission may call this method, and only for a student submission that has been turned in. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, unsubmit the requested student submission, or for access errors. * `FAILED_PRECONDITION` if the student submission has not been turned in. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. +/// Reclaims a student submission on behalf of the student that owns it. +/// +/// Reclaiming a student submission transfers ownership of attached Drive +/// files to the student and update the submission state. +/// +/// Only the student that owns the requested student submission may call this +/// method, and only for a student submission that has been turned in. +/// +/// This request must be made by the Developer Console project of the +/// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to +/// create the corresponding course work item. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access the +/// requested course or course work, unsubmit the requested student submission, +/// or for access errors. +/// * `FAILED_PRECONDITION` if the student submission has not been turned in. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `NOT_FOUND` if the requested course, course work, or student submission +/// does not exist. /// /// A builder for the *courseWork.studentSubmissions.reclaim* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -6346,7 +7833,7 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim"; + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMe.as_ref().to_string(), ()); } @@ -6473,7 +7960,9 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B self._request = new_value; self } - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// @@ -6523,17 +8012,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'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) -> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> @@ -6561,7 +8050,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionReclaimCall<'a, C, A> where C: B } -/// Creates an alias for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for access errors. * `NOT_FOUND` if the course does not exist. * `ALREADY_EXISTS` if the alias already exists. +/// Creates an alias for a course. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to create the +/// alias or for access errors. +/// * `NOT_FOUND` if the course does not exist. +/// * `ALREADY_EXISTS` if the alias already exists. +/// * `FAILED_PRECONDITION` if the alias requested does not make sense for the +/// requesting user or course (for example, if a user not in a domain +/// attempts to access a domain-scoped alias). /// /// A builder for the *aliases.create* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -6638,7 +8137,7 @@ impl<'a, C, A> CourseAliaseCreateCall<'a, C, A> where C: BorrowMut CourseAliaseCreateCall<'a, C, A> where C: BorrowMut CourseAliaseCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAliaseCreateCall<'a, C, A> @@ -6833,7 +8334,20 @@ impl<'a, C, A> CourseAliaseCreateCall<'a, C, A> where C: BorrowMut CourseAliaseCreateCall<'a, C, A> where C: BorrowMut CourseStudentCreateCall<'a, C, A> where C: BorrowMut CourseStudentCreateCall<'a, C, A> where C: BorrowMut CourseStudentCreateCall<'a, C, A> where C: BorrowMut CourseStudentCreateCall<'a, C, A> { @@ -7079,17 +8598,17 @@ impl<'a, C, A> CourseStudentCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseStudentCreateCall<'a, C, A> @@ -7117,7 +8636,16 @@ impl<'a, C, A> CourseStudentCreateCall<'a, C, A> where C: BorrowMut CourseAliaseDeleteCall<'a, C, A> where C: BorrowMut CourseAliaseDeleteCall<'a, C, A> where C: BorrowMut CourseAliaseDeleteCall<'a, C, A> where C: BorrowMut CourseAliaseDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseAliaseDeleteCall<'a, C, A> @@ -7370,7 +8901,290 @@ impl<'a, C, A> CourseAliaseDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.courses().course_work_delete("courseId", "id") +/// .doit(); +/// # } +/// ``` +pub struct CourseCourseWorkDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _course_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseCourseWorkDeleteCall<'a, C, A> {} + +impl<'a, C, A> CourseCourseWorkDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.courseWork.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "courseId", "id"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{id}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CourseworkStudent.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{id}", "id")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["id", "courseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn course_id(mut self, new_value: &str) -> CourseCourseWorkDeleteCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the course work to delete. + /// This identifier is a Classroom-assigned identifier. + /// + /// Sets the *id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn id(mut self, new_value: &str) -> CourseCourseWorkDeleteCall<'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) -> CourseCourseWorkDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> CourseCourseWorkDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CourseworkStudent`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CourseCourseWorkDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates a course. +/// +/// The user specified in `ownerId` is the owner of the created course +/// and added as a teacher. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to create +/// courses or for access errors. +/// * `NOT_FOUND` if the primary teacher is not a valid user. +/// * `FAILED_PRECONDITION` if the course owner's account is disabled or for +/// the following request errors: +/// * UserGroupsMembershipLimitReached +/// * `ALREADY_EXISTS` if an alias was specified in the `id` and +/// already exists. /// /// A builder for the *create* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -7445,7 +9259,7 @@ impl<'a, C, A> CourseCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses"; + let mut url = "https://classroom.googleapis.com/v1/courses".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Course.as_ref().to_string(), ()); } @@ -7571,17 +9385,17 @@ impl<'a, C, A> CourseCreateCall<'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) -> CourseCreateCall<'a, C, A> @@ -7609,7 +9423,13 @@ impl<'a, C, A> CourseCreateCall<'a, C, A> where C: BorrowMut, A: } -/// Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access errors. +/// Returns a list of students of this course that the requester +/// is permitted to view. +/// +/// This method returns the following error codes: +/// +/// * `NOT_FOUND` if the course does not exist. +/// * `PERMISSION_DENIED` for access errors. /// /// A builder for the *students.list* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -7637,7 +9457,7 @@ impl<'a, C, A> CourseCreateCall<'a, C, A> where C: BorrowMut, A: /// // Values shown here are possibly random and not representative ! /// let result = hub.courses().students_list("courseId") /// .page_token("vero") -/// .page_size(-28) +/// .page_size(-95) /// .doit(); /// # } /// ``` @@ -7689,7 +9509,7 @@ impl<'a, C, A> CourseStudentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/students"; + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/students".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -7792,7 +9612,9 @@ impl<'a, C, A> CourseStudentListCall<'a, C, A> where C: BorrowMut } - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// @@ -7802,14 +9624,22 @@ impl<'a, C, A> CourseStudentListCall<'a, C, A> where C: BorrowMut self._course_id = new_value.to_string(); self } - /// nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + /// nextPageToken + /// value returned from a previous + /// list call, indicating that + /// the subsequent page of results should be returned. + /// + /// The list request must be + /// otherwise identical to the one that resulted in this token. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> CourseStudentListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results. + /// Maximum number of items to return. Zero means no maximum. + /// + /// The server may return fewer than the specified number of results. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> CourseStudentListCall<'a, C, A> { @@ -7836,17 +9666,17 @@ impl<'a, C, A> CourseStudentListCall<'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) -> CourseStudentListCall<'a, C, A> @@ -7874,7 +9704,13 @@ impl<'a, C, A> CourseStudentListCall<'a, C, A> where C: BorrowMut } -/// Deletes a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. +/// Deletes a course. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to delete the +/// requested course or for access errors. +/// * `NOT_FOUND` if no course exists with the requested ID. /// /// A builder for the *delete* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -7944,7 +9780,7 @@ impl<'a, C, A> CourseDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{id}"; + let mut url = "https://classroom.googleapis.com/v1/courses/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Course.as_ref().to_string(), ()); } @@ -8047,7 +9883,9 @@ impl<'a, C, A> CourseDeleteCall<'a, C, A> where C: BorrowMut, A: } - /// Identifier of the course to delete. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course to delete. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *id* path property to the given value. /// @@ -8077,17 +9915,17 @@ impl<'a, C, A> CourseDeleteCall<'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) -> CourseDeleteCall<'a, C, A> @@ -8115,7 +9953,349 @@ impl<'a, C, A> CourseDeleteCall<'a, C, A> where C: BorrowMut, A: } -/// Updates one or more fields in a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable +/// Updates one or more fields of a course work. +/// +/// See google.classroom.v1.CourseWork for details +/// of which fields may be updated and who may change them. +/// +/// This request must be made by the Developer Console project of the +/// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to +/// create the corresponding course work item. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting developer project did not create +/// the corresponding course work, if the user is not permitted to make the +/// requested modification to the student submission, or for +/// access errors. +/// * `INVALID_ARGUMENT` if the request is malformed. +/// * `FAILED_PRECONDITION` if the requested course work has already been +/// deleted. +/// * `NOT_FOUND` if the requested course, course work, or student submission +/// does not exist. +/// +/// A builder for the *courseWork.patch* method supported by a *course* resource. +/// It is not used directly, but through a `CourseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_classroom1 as classroom1; +/// use classroom1::CourseWork; +/// # #[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::new(), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CourseWork::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.courses().course_work_patch(req, "courseId", "id") +/// .update_mask("duo") +/// .doit(); +/// # } +/// ``` +pub struct CourseCourseWorkPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _request: CourseWork, + _course_id: String, + _id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseCourseWorkPatchCall<'a, C, A> {} + +impl<'a, C, A> CourseCourseWorkPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CourseWork)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.courseWork.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("id", self._id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "courseId", "id", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{id}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CourseworkStudent.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{id}", "id")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["id", "courseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::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: CourseWork) -> CourseCourseWorkPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. + /// + /// Sets the *course id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn course_id(mut self, new_value: &str) -> CourseCourseWorkPatchCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the course work. + /// + /// 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) -> CourseCourseWorkPatchCall<'a, C, A> { + self._id = new_value.to_string(); + self + } + /// Mask that identifies which fields on the course work to update. + /// This field is required to do an update. The update fails if invalid + /// fields are specified. If a field supports empty values, it can be cleared + /// by specifying it in the update mask and not in the CourseWork object. If a + /// field that does not support empty values is included in the update mask and + /// not set in the CourseWork object, an `INVALID_ARGUMENT` error will be + /// returned. + /// + /// The following fields may be specified by teachers: + /// * `title` + /// * `description` + /// * `state` + /// * `due_date` + /// * `due_time` + /// * `max_points` + /// * `submission_modification_mode` + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> CourseCourseWorkPatchCall<'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) -> CourseCourseWorkPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> CourseCourseWorkPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CourseworkStudent`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CourseCourseWorkPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates one or more fields in a course. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to modify the +/// requested course or for access errors. +/// * `NOT_FOUND` if no course exists with the requested ID. +/// * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or +/// if no update mask is supplied. +/// * `FAILED_PRECONDITION` for the following request errors: +/// * CourseNotModifiable /// /// A builder for the *patch* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. @@ -8148,7 +10328,7 @@ impl<'a, C, A> CourseDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.courses().patch(req, "id") -/// .update_mask("sadipscing") +/// .update_mask("Lorem") /// .doit(); /// # } /// ``` @@ -8197,7 +10377,7 @@ impl<'a, C, A> CoursePatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{id}"; + let mut url = "https://classroom.googleapis.com/v1/courses/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Course.as_ref().to_string(), ()); } @@ -8324,7 +10504,9 @@ impl<'a, C, A> CoursePatchCall<'a, C, A> where C: BorrowMut, A: o self._request = new_value; self } - /// Identifier of the course to update. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course to update. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *id* path property to the given value. /// @@ -8334,7 +10516,20 @@ impl<'a, C, A> CoursePatchCall<'a, C, A> where C: BorrowMut, A: o self._id = new_value.to_string(); self } - /// Mask that identifies which fields on the course to update. This field is required to do an update. The update will fail if invalid fields are specified. The following fields are valid: * `name` * `section` * `descriptionHeading` * `description` * `room` * `courseState` When set in a query parameter, this field should be specified as `updateMask=,,...` + /// Mask that identifies which fields on the course to update. + /// This field is required to do an update. The update will fail if invalid + /// fields are specified. The following fields are valid: + /// + /// * `name` + /// * `section` + /// * `descriptionHeading` + /// * `description` + /// * `room` + /// * `courseState` + /// + /// 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) -> CoursePatchCall<'a, C, A> { @@ -8361,17 +10556,17 @@ impl<'a, C, A> CoursePatchCall<'a, C, A> where C: BorrowMut, A: o /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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> @@ -8399,9 +10594,16 @@ impl<'a, C, A> CoursePatchCall<'a, C, A> where C: BorrowMut, A: o } -/// Returns a list of aliases for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the course or for access errors. * `NOT_FOUND` if the course does not exist. +/// Deletes a student of a course. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to delete +/// students of this course or for access errors. +/// * `NOT_FOUND` if no student of this course has the requested ID or if the +/// course does not exist. /// -/// A builder for the *aliases.list* method supported by a *course* resource. +/// A builder for the *students.delete* method supported by a *course* resource. /// It is not used directly, but through a `CourseMethods` instance. /// /// # Example @@ -8425,276 +10627,11 @@ impl<'a, C, A> CoursePatchCall<'a, C, A> where C: BorrowMut, A: o /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.courses().aliases_list("courseId") -/// .page_token("sadipscing") -/// .page_size(-88) +/// let result = hub.courses().students_delete("courseId", "userId") /// .doit(); /// # } /// ``` -pub struct CourseAliaseListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Classroom, - _course_id: String, - _page_token: Option, - _page_size: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CourseAliaseListCall<'a, C, A> {} - -impl<'a, C, A> CourseAliaseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListCourseAliasesResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "classroom.courses.aliases.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("courseId", self._course_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", "courseId", "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/courses/{courseId}/aliases"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CourseReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{courseId}", "courseId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["courseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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 identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - /// - /// Sets the *course id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn course_id(mut self, new_value: &str) -> CourseAliaseListCall<'a, C, A> { - self._course_id = new_value.to_string(); - self - } - /// nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> CourseAliaseListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> CourseAliaseListCall<'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) -> CourseAliaseListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> CourseAliaseListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CourseReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CourseAliaseListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Deletes a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete teachers of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher of this course. -/// -/// A builder for the *teachers.delete* method supported by a *course* resource. -/// It is not used directly, but through a `CourseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate 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::new(), -/// # ::default(), None); -/// # let mut hub = Classroom::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.courses().teachers_delete("courseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct CourseTeacherDeleteCall<'a, C, A> +pub struct CourseStudentDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Classroom, @@ -8705,9 +10642,9 @@ pub struct CourseTeacherDeleteCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for CourseTeacherDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for CourseStudentDeleteCall<'a, C, A> {} -impl<'a, C, A> CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> CourseStudentDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -8719,7 +10656,7 @@ impl<'a, C, A> CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "classroom.courses.teachers.delete", + dlg.begin(MethodInfo { id: "classroom.courses.students.delete", http_method: hyper::method::Method::Delete }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("courseId", self._course_id.to_string())); @@ -8736,7 +10673,7 @@ impl<'a, C, A> CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut CourseStudentDeleteCall<'a, C, A> { + self._course_id = new_value.to_string(); + self + } + /// Identifier of the student to delete. The identifier can be one of the + /// following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user + /// + /// Sets the *user id* path property to 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) -> CourseStudentDeleteCall<'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) -> CourseStudentDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> CourseStudentDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Roster`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> CourseStudentDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes a teacher of a course. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to delete +/// teachers of this course or for access errors. +/// * `NOT_FOUND` if no teacher of this course has the requested ID or if the +/// course does not exist. +/// * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher +/// of this course. +/// +/// A builder for the *teachers.delete* method supported by a *course* resource. +/// It is not used directly, but through a `CourseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate 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::new(), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.courses().teachers_delete("courseId", "userId") +/// .doit(); +/// # } +/// ``` +pub struct CourseTeacherDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _course_id: String, + _user_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for CourseTeacherDeleteCall<'a, C, A> {} + +impl<'a, C, A> CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "classroom.courses.teachers.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("courseId", self._course_id.to_string())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "courseId", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/teachers/{userId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Roster.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{courseId}", "courseId"), ("{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", "courseId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// @@ -8849,7 +11057,12 @@ impl<'a, C, A> CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseTeacherDeleteCall<'a, C, A> @@ -8917,7 +11130,21 @@ impl<'a, C, A> CourseTeacherDeleteCall<'a, C, A> where C: BorrowMut CourseTeacherCreateCall<'a, C, A> where C: BorrowMut CourseTeacherCreateCall<'a, C, A> where C: BorrowMut CourseTeacherCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> CourseTeacherCreateCall<'a, C, A> @@ -9189,7 +11418,14 @@ impl<'a, C, A> CourseTeacherCreateCall<'a, C, A> where C: BorrowMut CourseCourseWorkStudentSubmissionGetCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}"; + let mut url = "https://classroom.googleapis.com/v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CourseworkMeReadonly.as_ref().to_string(), ()); } @@ -9366,7 +11602,9 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionGetCall<'a, C, A> where C: Borro } - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. + /// Identifier of the course. + /// This identifier can be either the Classroom-assigned identifier or an + /// alias. /// /// Sets the *course id* path property to the given value. /// @@ -9416,17 +11654,17 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionGetCall<'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) -> CourseCourseWorkStudentSubmissionGetCall<'a, C, A> @@ -9454,260 +11692,21 @@ impl<'a, C, A> CourseCourseWorkStudentSubmissionGetCall<'a, C, A> where C: Borro } -/// Returns a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view students of this course or for access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist. -/// -/// A builder for the *students.get* method supported by a *course* resource. -/// It is not used directly, but through a `CourseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate 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; +/// Returns a specific guardian. /// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Classroom::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.courses().students_get("courseId", "userId") -/// .doit(); -/// # } -/// ``` -pub struct CourseStudentGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Classroom, - _course_id: String, - _user_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for CourseStudentGetCall<'a, C, A> {} - -impl<'a, C, A> CourseStudentGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Student)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "classroom.courses.students.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("courseId", self._course_id.to_string())); - params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "courseId", "userId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/courses/{courseId}/students/{userId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{courseId}", "courseId"), ("{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", "courseId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. - /// - /// Sets the *course id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn course_id(mut self, new_value: &str) -> CourseStudentGetCall<'a, C, A> { - self._course_id = new_value.to_string(); - self - } - /// Identifier of the student to return. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - /// - /// Sets the *user id* path property to 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) -> CourseStudentGetCall<'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) -> CourseStudentGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> CourseStudentGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::RosterReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> CourseStudentGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Returns a specific guardian. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view guardian information 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, nor the literal string `me`). * `NOT_FOUND` if Classroom cannot find any record of the given student or `guardian_id`, or if the guardian has been disabled. +/// 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 view guardian information 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, nor the literal string `me`). +/// * `NOT_FOUND` if the requesting user is permitted to view guardians for +/// the requested `student_id`, but no `Guardian` record exists for that +/// student that matches the provided `guardian_id`. /// /// A builder for the *guardians.get* method supported by a *userProfile* resource. /// It is not used directly, but through a `UserProfileMethods` instance. @@ -9778,7 +11777,7 @@ impl<'a, C, A> UserProfileGuardianGetCall<'a, C, A> where C: BorrowMut UserProfileGuardianGetCall<'a, C, A> where C: BorrowMut UserProfileGuardianGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserProfileGuardianGetCall<'a, C, A> @@ -9938,7 +11941,36 @@ impl<'a, C, A> UserProfileGuardianGetCall<'a, C, A> where C: BorrowMut UserProfileGuardianInvitationCreateCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations"; + let mut url = "https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -10166,17 +12198,17 @@ impl<'a, C, A> UserProfileGuardianInvitationCreateCall<'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) -> UserProfileGuardianInvitationCreateCall<'a, C, A> @@ -10188,7 +12220,13 @@ impl<'a, C, A> UserProfileGuardianInvitationCreateCall<'a, C, A> where C: Borrow } -/// Returns a user profile. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile or if no profile exists with the requested ID or for access errors. +/// Returns a user profile. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to access +/// this user profile, if no profile exists with the requested ID, or for +/// access errors. /// /// A builder for the *get* method supported by a *userProfile* resource. /// It is not used directly, but through a `UserProfileMethods` instance. @@ -10258,7 +12296,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/userProfiles/{userId}"; + let mut url = "https://classroom.googleapis.com/v1/userProfiles/{userId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -10361,7 +12399,12 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A } - /// Identifier of the profile to return. 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 + /// Identifier of the profile to return. The identifier can be one of the + /// following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user /// /// Sets the *user id* path property to the given value. /// @@ -10391,17 +12434,17 @@ impl<'a, C, A> UserProfileGetCall<'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) -> UserProfileGetCall<'a, C, A> @@ -10429,7 +12472,24 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A } -/// Modifies a guardian invitation. Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other access errors. * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. * `INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`. * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom. +/// Modifies a guardian invitation. +/// +/// Currently, the only valid modification is to change the `state` from +/// `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the current user does not have permission to +/// manage guardians, if guardians are not enabled for the domain in question +/// or for other access errors. +/// * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. +/// * `INVALID_ARGUMENT` if the format of the student ID provided +/// cannot be recognized (it is not an email address, nor a `user_id` from +/// this API), or if the passed `GuardianInvitation` has a `state` other than +/// `COMPLETE`, or if it modifies fields other than `state`. +/// * `NOT_FOUND` if the student ID provided is a valid student ID, but +/// Classroom has no record of that student, or if the `id` field does not +/// refer to a guardian invitation known to Classroom. /// /// A builder for the *guardianInvitations.patch* method supported by a *userProfile* resource. /// It is not used directly, but through a `UserProfileMethods` instance. @@ -10462,7 +12522,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("labore") +/// .update_mask("dolore") /// .doit(); /// # } /// ``` @@ -10512,7 +12572,7 @@ impl<'a, C, A> UserProfileGuardianInvitationPatchCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}"; + let mut url = "https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -10654,7 +12714,15 @@ impl<'a, C, A> UserProfileGuardianInvitationPatchCall<'a, C, A> where C: BorrowM self._invitation_id = new_value.to_string(); self } - /// Mask that identifies which fields on the course to update. This field is required to do an update. The update will fail if invalid fields are specified. The following fields are valid: * `state` When set in a query parameter, this field should be specified as `updateMask=,,...` + /// Mask that identifies which fields on the course to update. + /// This field is required to do an update. The update will fail if invalid + /// fields are specified. The following fields are valid: + /// + /// * `state` + /// + /// 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) -> UserProfileGuardianInvitationPatchCall<'a, C, A> { @@ -10681,17 +12749,17 @@ impl<'a, C, A> UserProfileGuardianInvitationPatchCall<'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) -> UserProfileGuardianInvitationPatchCall<'a, C, A> @@ -10703,7 +12771,20 @@ impl<'a, C, A> UserProfileGuardianInvitationPatchCall<'a, C, A> where C: BorrowM } -/// Returns a specific guardian invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view guardian invitations 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, nor the literal string `me`). * `NOT_FOUND` if Classroom cannot find any record of the given student or `invitation_id`. May also be returned if the student exists, but the requesting user does not have access to see that student. +/// Returns a specific guardian invitation. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to view +/// guardian invitations 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, nor the literal string `me`). +/// * `NOT_FOUND` if Classroom cannot find any record of the given student or +/// `invitation_id`. May also be returned if the student exists, but the +/// requesting user does not have access to see that student. /// /// A builder for the *guardianInvitations.get* method supported by a *userProfile* resource. /// It is not used directly, but through a `UserProfileMethods` instance. @@ -10774,7 +12855,7 @@ impl<'a, C, A> UserProfileGuardianInvitationGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}"; + let mut url = "https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations/{invitationId}".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -10912,17 +12993,17 @@ impl<'a, C, A> UserProfileGuardianInvitationGetCall<'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) -> UserProfileGuardianInvitationGetCall<'a, C, A> @@ -10934,7 +13015,26 @@ impl<'a, C, A> UserProfileGuardianInvitationGetCall<'a, C, A> where C: BorrowMut } -/// Returns a list of guardians that the requesting user is permitted to view, restricted to those that match the request. To list guardians for any student that the requesting user may view guardians for, use the literal character `-` for the student ID. This method returns the following error codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian information for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, if the `invited_email_address` filter is set by a user who is not a domain administrator, 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, nor the literal string `me`). May also be returned if an invalid `page_token` is provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student. +/// Returns a list of guardians that the requesting user is permitted to +/// view, restricted to those that match the request. +/// +/// To list guardians for any student that the requesting user may view +/// guardians for, use the literal character `-` for the student ID. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting +/// user is not permitted to view guardian information for that student, if +/// `"-"` is specified as the `student_id` and the user is not a domain +/// administrator, if guardians are not enabled for the domain in question, +/// if the `invited_email_address` filter is set by a user who is not a +/// domain administrator, 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, nor the literal string `me`). May also be returned if an invalid +/// `page_token` is provided. +/// * `NOT_FOUND` if a `student_id` is specified, and its format can be +/// recognized, but Classroom has no record of that student. /// /// A builder for the *guardians.list* method supported by a *userProfile* resource. /// It is not used directly, but through a `UserProfileMethods` instance. @@ -10961,9 +13061,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("rebum.") -/// .page_size(-33) -/// .invited_email_address("nonumy") +/// .page_token("sit") +/// .page_size(-40) +/// .invited_email_address("consetetur") /// .doit(); /// # } /// ``` @@ -11018,7 +13118,7 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut UserProfileGuardianListCall<'a, C, A> where C: BorrowMut UserProfileGuardianListCall<'a, C, A> where C: BorrowMut UserProfileGuardianListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + /// Maximum number of items to return. Zero or unspecified indicates that the + /// server may assign a maximum. + /// + /// The server may return fewer than the specified number of results. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> UserProfileGuardianListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// Filter results by the email address that the original invitation was sent to, resulting in this guardian link. This filter can only be used by domain administrators. + /// Filter results by the email address that the original invitation was sent + /// to, resulting in this guardian link. + /// This filter can only be used by domain administrators. /// /// Sets the *invited email address* query property to the given value. pub fn invited_email_address(mut self, new_value: &str) -> UserProfileGuardianListCall<'a, C, A> { @@ -11167,17 +13285,17 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserProfileGuardianListCall<'a, C, A> @@ -11189,7 +13307,22 @@ impl<'a, C, A> UserProfileGuardianListCall<'a, C, A> where C: BorrowMut UserProfileGuardianListCall<'a, C, A> where C: BorrowMut UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/userProfiles/{studentId}/guardianInvitations"; + let mut url = "https://classroom.googleapis.com/v1/userProfiles/{studentId}/guardianInvitations".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -11378,7 +13511,15 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu } - /// The ID of the student whose guardian invitations are to be returned. 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 * the string literal `"-"`, indicating that results should be returned for all students that the requesting user is permitted to view guardian invitations. + /// The ID of the student whose guardian invitations are to be returned. + /// 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 + /// * the string literal `"-"`, indicating that results should be returned for + /// all students that the requesting user is permitted to view guardian + /// invitations. /// /// Sets the *student id* path property to the given value. /// @@ -11388,7 +13529,8 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu self._student_id = new_value.to_string(); self } - /// If specified, only results with the specified `state` values will be returned. Otherwise, results with a `state` of `PENDING` will be returned. + /// If specified, only results with the specified `state` values will be + /// returned. Otherwise, results with a `state` of `PENDING` will be returned. /// /// Append the given value to the *states* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -11396,21 +13538,31 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'a, C, A> where C: BorrowMu self._states.push(new_value.to_string()); self } - /// nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + /// nextPageToken + /// value returned from a previous + /// list call, + /// indicating that the subsequent page of results should be returned. + /// + /// The list request + /// must be otherwise identical to the one that resulted in this token. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> UserProfileGuardianInvitationListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. + /// Maximum number of items to return. Zero or unspecified indicates that the + /// server may assign a maximum. + /// + /// The server may return fewer than the specified number of results. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> UserProfileGuardianInvitationListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// If specified, only results with the specified `invited_email_address` will be returned. + /// If specified, only results with the specified `invited_email_address` + /// will be returned. /// /// Sets the *invited email address* query property to the given value. pub fn invited_email_address(mut self, new_value: &str) -> UserProfileGuardianInvitationListCall<'a, C, A> { @@ -11437,17 +13589,17 @@ impl<'a, C, A> UserProfileGuardianInvitationListCall<'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) -> UserProfileGuardianInvitationListCall<'a, C, A> @@ -11459,7 +13611,24 @@ 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 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 Classroom cannot find any record of the given `student_id` or `guardian_id`, or if the guardian has already been disabled. +/// 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. @@ -11530,7 +13699,7 @@ impl<'a, C, A> UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserProfileGuardianDeleteCall<'a, C, A> @@ -11690,7 +13863,13 @@ impl<'a, C, A> UserProfileGuardianDeleteCall<'a, C, A> where C: BorrowMut InvitationDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/invitations/{id}"; + let mut url = "https://classroom.googleapis.com/v1/invitations/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Roster.as_ref().to_string(), ()); } @@ -11893,17 +14072,17 @@ impl<'a, C, A> InvitationDeleteCall<'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) -> InvitationDeleteCall<'a, C, A> @@ -11931,263 +14110,18 @@ impl<'a, C, A> InvitationDeleteCall<'a, C, A> where C: BorrowMut, } -/// Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` or `course_id` must be supplied. Both fields can be supplied. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. -/// -/// A builder for the *list* method supported by a *invitation* resource. -/// It is not used directly, but through a `InvitationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # 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; +/// Creates an invitation. Only one invitation for a user and course may exist +/// at a time. Delete and re-create an invitation to make changes. /// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Classroom::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.invitations().list() -/// .user_id("gubergren") -/// .page_token("aliquyam") -/// .page_size(-24) -/// .course_id("tempor") -/// .doit(); -/// # } -/// ``` -pub struct InvitationListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Classroom, - _user_id: Option, - _page_token: Option, - _page_size: Option, - _course_id: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for InvitationListCall<'a, C, A> {} - -impl<'a, C, A> InvitationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListInvitationsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.invitations.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._user_id { - params.push(("userId", 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._course_id { - params.push(("courseId", value.to_string())); - } - for &field in ["alt", "userId", "pageToken", "pageSize", "courseId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/invitations"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::RosterReadonly.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) - } - } - } - } - - - /// Restricts returned invitations to those for a specific user. The identifier can be one of the following: * the numeric identifier for the user * the email address of the user * the string literal `"me"`, indicating the requesting user - /// - /// Sets the *user id* query property to the given value. - pub fn user_id(mut self, new_value: &str) -> InvitationListCall<'a, C, A> { - self._user_id = Some(new_value.to_string()); - self - } - /// nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> InvitationListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> InvitationListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Restricts returned invitations to those for a course with the specified identifier. - /// - /// Sets the *course id* query property to the given value. - pub fn course_id(mut self, new_value: &str) -> InvitationListCall<'a, C, A> { - self._course_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) -> InvitationListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> InvitationListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::RosterReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> InvitationListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create invitations for this course or for access errors. * `NOT_FOUND` if the course or the user does not exist. * `FAILED_PRECONDITION` if the requested user's account is disabled or if the user already has this role or a role with greater permissions. * `ALREADY_EXISTS` if an invitation for the specified user and course already exists. +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to create +/// invitations for this course or for access errors. +/// * `NOT_FOUND` if the course or the user does not exist. +/// * `FAILED_PRECONDITION` if the requested user's account is disabled or if +/// the user already has this role or a role with greater permissions. +/// * `ALREADY_EXISTS` if an invitation for the specified user and course +/// already exists. /// /// A builder for the *create* method supported by a *invitation* resource. /// It is not used directly, but through a `InvitationMethods` instance. @@ -12262,7 +14196,7 @@ impl<'a, C, A> InvitationCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/invitations"; + let mut url = "https://classroom.googleapis.com/v1/invitations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Roster.as_ref().to_string(), ()); } @@ -12388,17 +14322,17 @@ impl<'a, C, A> InvitationCreateCall<'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) -> InvitationCreateCall<'a, C, A> @@ -12426,7 +14360,291 @@ impl<'a, C, A> InvitationCreateCall<'a, C, A> where C: BorrowMut, } -/// Returns an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view the requested invitation or for access errors. * `NOT_FOUND` if no invitation exists with the requested ID. +/// Returns a list of invitations that the requesting user is permitted to +/// view, restricted to those that match the list request. +/// +/// *Note:* At least one of `user_id` or `course_id` must be supplied. Both +/// fields can be supplied. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` for access errors. +/// +/// A builder for the *list* method supported by a *invitation* resource. +/// It is not used directly, but through a `InvitationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # 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::new(), +/// # ::default(), None); +/// # let mut hub = Classroom::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.invitations().list() +/// .user_id("labore") +/// .page_token("ipsum") +/// .page_size(-31) +/// .course_id("dolores") +/// .doit(); +/// # } +/// ``` +pub struct InvitationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Classroom, + _user_id: Option, + _page_token: Option, + _page_size: Option, + _course_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for InvitationListCall<'a, C, A> {} + +impl<'a, C, A> InvitationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListInvitationsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.invitations.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._user_id { + params.push(("userId", 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._course_id { + params.push(("courseId", value.to_string())); + } + for &field in ["alt", "userId", "pageToken", "pageSize", "courseId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://classroom.googleapis.com/v1/invitations".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::RosterReadonly.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) + } + } + } + } + + + /// Restricts returned invitations to those for a specific user. The identifier + /// can be one of the following: + /// + /// * the numeric identifier for the user + /// * the email address of the user + /// * the string literal `"me"`, indicating the requesting user + /// + /// Sets the *user id* query property to the given value. + pub fn user_id(mut self, new_value: &str) -> InvitationListCall<'a, C, A> { + self._user_id = Some(new_value.to_string()); + self + } + /// nextPageToken + /// value returned from a previous + /// list call, indicating + /// that the subsequent page of results should be returned. + /// + /// The list request must be + /// otherwise identical to the one that resulted in this token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> InvitationListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of items to return. Zero means no maximum. + /// + /// The server may return fewer than the specified number of results. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> InvitationListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Restricts returned invitations to those for a course with the specified + /// identifier. + /// + /// Sets the *course id* query property to the given value. + pub fn course_id(mut self, new_value: &str) -> InvitationListCall<'a, C, A> { + self._course_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) -> InvitationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> InvitationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::RosterReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> InvitationListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns an invitation. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to view the +/// requested invitation or for access errors. +/// * `NOT_FOUND` if no invitation exists with the requested ID. /// /// A builder for the *get* method supported by a *invitation* resource. /// It is not used directly, but through a `InvitationMethods` instance. @@ -12496,7 +14714,7 @@ impl<'a, C, A> InvitationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/invitations/{id}"; + let mut url = "https://classroom.googleapis.com/v1/invitations/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::RosterReadonly.as_ref().to_string(), ()); } @@ -12629,17 +14847,17 @@ impl<'a, C, A> InvitationGetCall<'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) -> InvitationGetCall<'a, C, A> @@ -12667,7 +14885,20 @@ impl<'a, C, A> InvitationGetCall<'a, C, A> where C: BorrowMut, A: } -/// Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to accept the requested invitation or for access errors. * `FAILED_PRECONDITION` for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `NOT_FOUND` if no invitation exists with the requested ID. +/// Accepts an invitation, removing it and adding the invited user to the +/// teachers or students (as appropriate) of the specified course. Only the +/// invited user may accept an invitation. +/// +/// This method returns the following error codes: +/// +/// * `PERMISSION_DENIED` if the requesting user is not permitted to accept the +/// requested invitation or for access errors. +/// * `FAILED_PRECONDITION` for the following request errors: +/// * CourseMemberLimitReached +/// * CourseNotModifiable +/// * CourseTeacherLimitReached +/// * UserGroupsMembershipLimitReached +/// * `NOT_FOUND` if no invitation exists with the requested ID. /// /// A builder for the *accept* method supported by a *invitation* resource. /// It is not used directly, but through a `InvitationMethods` instance. @@ -12737,7 +14968,7 @@ impl<'a, C, A> InvitationAcceptCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/invitations/{id}:accept"; + let mut url = "https://classroom.googleapis.com/v1/invitations/{id}:accept".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Roster.as_ref().to_string(), ()); } @@ -12870,17 +15101,17 @@ impl<'a, C, A> InvitationAcceptCall<'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) -> InvitationAcceptCall<'a, C, A> @@ -12908,3 +15139,4 @@ impl<'a, C, A> InvitationAcceptCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/cloudbilling1-cli/Cargo.toml b/gen/cloudbilling1-cli/Cargo.toml index d7ef0da658..3cd8b78ef2 100644 --- a/gen/cloudbilling1-cli/Cargo.toml +++ b/gen/cloudbilling1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-cloudbilling1-cli" -version = "1.0.4+20151222" +version = "1.0.4+20170504" authors = ["Sebastian Thiel "] description = "A complete library to interact with cloudbilling (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudbilling1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-cloudbilling1] path = "../cloudbilling1" -version = "1.0.4+20151222" +version = "1.0.4+20170504" diff --git a/gen/cloudbilling1-cli/README.md b/gen/cloudbilling1-cli/README.md index 001064ea72..b05c9a8849 100644 --- a/gen/cloudbilling1-cli/README.md +++ b/gen/cloudbilling1-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 *cloudbilling* API at revision *20151222*. The CLI is at version *1.0.4*. +This documentation was generated from the *cloudbilling* API at revision *20170504*. The CLI is at version *1.0.4*. ```bash cloudbilling1 [options] diff --git a/gen/cloudbilling1-cli/mkdocs.yml b/gen/cloudbilling1-cli/mkdocs.yml index d4d6366c22..5cbbe2cf48 100644 --- a/gen/cloudbilling1-cli/mkdocs.yml +++ b/gen/cloudbilling1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: cloudbilling v1.0.4+20151222 +site_name: cloudbilling v1.0.4+20170504 site_url: http://byron.github.io/google-apis-rs/google-cloudbilling1-cli site_description: A complete library to interact with cloudbilling (protocol v1) diff --git a/gen/cloudbilling1-cli/src/main.rs b/gen/cloudbilling1-cli/src/main.rs index fc65cec550..b209c36c1d 100644 --- a/gen/cloudbilling1-cli/src/main.rs +++ b/gen/cloudbilling1-cli/src/main.rs @@ -480,12 +480,15 @@ fn main() { let arg_data = [ ("billing-accounts", "methods: 'get', 'list' and 'projects-list'", vec![ ("get", - Some(r##"Gets information about a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947)."##), + Some(r##"Gets information about a billing account. The current authenticated user + must be an [owner of the billing + account](https://support.google.com/cloud/answer/4430947)."##), "Details at http://byron.github.io/google-apis-rs/google_cloudbilling1_cli/billing-accounts_get", vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`."##), + Some(r##"The resource name of the billing account to retrieve. For example, + `billingAccounts/012345-567890-ABCDEF`."##), Some(true), Some(false)), @@ -502,7 +505,8 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the billing accounts that the current authenticated user [owns](https://support.google.com/cloud/answer/4430947)."##), + Some(r##"Lists the billing accounts that the current authenticated user + [owns](https://support.google.com/cloud/answer/4430947)."##), "Details at http://byron.github.io/google-apis-rs/google_cloudbilling1_cli/billing-accounts_list", vec![ (Some(r##"v"##), @@ -518,12 +522,15 @@ fn main() { Some(false)), ]), ("projects-list", - Some(r##"Lists the projects associated with a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947)."##), + Some(r##"Lists the projects associated with a billing account. The current + authenticated user must be an [owner of the billing + account](https://support.google.com/cloud/answer/4430947)."##), "Details at http://byron.github.io/google-apis-rs/google_cloudbilling1_cli/billing-accounts_projects-list", vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`."##), + Some(r##"The resource name of the billing account associated with the projects that + you want to list. For example, `billingAccounts/012345-567890-ABCDEF`."##), Some(true), Some(false)), @@ -543,12 +550,16 @@ fn main() { ("projects", "methods: 'get-billing-info' and 'update-billing-info'", vec![ ("get-billing-info", - Some(r##"Gets the billing information for a project. The current authenticated user must have [permission to view the project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo )."##), + Some(r##"Gets the billing information for a project. The current authenticated user + must have [permission to view the + project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + )."##), "Details at http://byron.github.io/google-apis-rs/google_cloudbilling1_cli/projects_get-billing-info", vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`."##), + Some(r##"The resource name of the project for which billing information is + retrieved. For example, `projects/tokyo-rain-123`."##), Some(true), Some(false)), @@ -565,12 +576,43 @@ fn main() { Some(false)), ]), ("update-billing-info", - Some(r##"Sets or updates the billing account associated with a project. You specify the new billing account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the resource name of a billing account. Associating a project with an open billing account enables billing on the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges. *Note:* Incurred charges that have not yet been reported in the transaction history of the Google Developers Console may be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project. The current authenticated user must have ownership privileges for both the [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ) and the [billing account](https://support.google.com/cloud/answer/4430947). You can disable billing on the project by setting the `billing_account_name` field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project. Note that associating a project with a *closed* billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an *open* billing account."##), + Some(r##"Sets or updates the billing account associated with a project. You specify + the new billing account by setting the `billing_account_name` in the + `ProjectBillingInfo` resource to the resource name of a billing account. + Associating a project with an open billing account enables billing on the + project and allows charges for resource usage. If the project already had a + billing account, this method changes the billing account used for resource + usage charges. + + *Note:* Incurred charges that have not yet been reported in the transaction + history of the Google Cloud Console may be billed to the new billing + account, even if the charge occurred before the new billing account was + assigned to the project. + + The current authenticated user must have ownership privileges for both the + [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + ) and the [billing + account](https://support.google.com/cloud/answer/4430947). + + You can disable billing on the project by setting the + `billing_account_name` field to empty. This action disassociates the + current billing account from the project. Any billable activity of your + in-use services will stop, and your application could stop functioning as + expected. Any unbilled charges to date will be billed to the previously + associated account. The current authenticated user must be either an owner + of the project or an owner of the billing account for the project. + + Note that associating a project with a *closed* billing account will have + much the same effect as disabling billing on the project: any paid + resources used by the project will be shut down. Thus, unless you wish to + disable billing, you should always call this method with the name of an + *open* billing account."##), "Details at http://byron.github.io/google-apis-rs/google_cloudbilling1_cli/projects_update-billing-info", vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`."##), + Some(r##"The resource name of the project associated with the billing information + that you want to update. For example, `projects/tokyo-rain-123`."##), Some(true), Some(false)), @@ -598,8 +640,9 @@ fn main() { let mut app = App::new("cloudbilling1") .author("Sebastian Thiel ") - .version("1.0.4+20151222") - .about("Retrieves Google Developers Console billing accounts and associates them with projects.") + .version("1.0.4+20170504") + .about("Allows developers to manage billing for their Google Cloud Platform projects + programmatically.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudbilling1_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/cloudbilling1/Cargo.toml b/gen/cloudbilling1/Cargo.toml index db9ceb77a3..72da7e7593 100644 --- a/gen/cloudbilling1/Cargo.toml +++ b/gen/cloudbilling1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudbilling1" -version = "1.0.4+20151222" +version = "1.0.4+20170504" authors = ["Sebastian Thiel "] description = "A complete library to interact with cloudbilling (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudbilling1" homepage = "https://cloud.google.com/billing/" -documentation = "https://docs.rs/google-cloudbilling1/1.0.4+20151222" +documentation = "https://docs.rs/google-cloudbilling1/1.0.4+20170504" license = "MIT" keywords = ["cloudbilling", "google", "protocol", "web", "api"] diff --git a/gen/cloudbilling1/README.md b/gen/cloudbilling1/README.md index f68a47f613..4ad3171a75 100644 --- a/gen/cloudbilling1/README.md +++ b/gen/cloudbilling1/README.md @@ -5,18 +5,18 @@ DO NOT EDIT ! --> The `google-cloudbilling1` library allows access to all features of the *Google cloudbilling* service. -This documentation was generated from *cloudbilling* crate version *1.0.4+20151222*, where *20151222* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *cloudbilling* crate version *1.0.4+20170504*, where *20170504* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *cloudbilling* *v1* API can be found at the [official documentation site](https://cloud.google.com/billing/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/struct.Cloudbilling.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/struct.Cloudbilling.html) ... -* [billing accounts](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/struct.BillingAccount.html) - * [*get*](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/struct.BillingAccountGetCall.html), [*list*](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/struct.BillingAccountListCall.html) and [*projects list*](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/struct.BillingAccountProjectListCall.html) +* [billing accounts](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/struct.BillingAccount.html) + * [*get*](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/struct.BillingAccountGetCall.html), [*list*](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/struct.BillingAccountListCall.html) and [*projects list*](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/struct.BillingAccountProjectListCall.html) * projects - * [*get billing info*](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/struct.ProjectGetBillingInfoCall.html) and [*update billing info*](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/struct.ProjectUpdateBillingInfoCall.html) + * [*get billing info*](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/struct.ProjectGetBillingInfoCall.html) and [*update billing info*](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/struct.ProjectUpdateBillingInfoCall.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-cloudbilling1/1.0.4+20151222/google_cloudbilling1/struct.Cloudbilling.html)** +* **[Hub](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/struct.Cloudbilling.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -121,17 +121,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.ResponseResult.html), it will return that by default. You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making this call: `.param("alt", "media")`. @@ -141,29 +141,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-cloudbilling1/1.0.4+20151222/google_cloudbilling1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudbilling1/1.0.4+20170504/google_cloudbilling1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/cloudbilling1/src/lib.rs b/gen/cloudbilling1/src/lib.rs index d0580d484b..cac0dee8cc 100644 --- a/gen/cloudbilling1/src/lib.rs +++ b/gen/cloudbilling1/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 *cloudbilling* crate version *1.0.4+20151222*, where *20151222* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *cloudbilling* crate version *1.0.4+20170504*, where *20170504* is the exact revision of the *cloudbilling:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *cloudbilling* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/billing/). @@ -176,7 +176,7 @@ // 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 +// 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)] @@ -303,8 +303,6 @@ pub struct Cloudbilling { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Cloudbilling {} @@ -317,8 +315,6 @@ impl<'a, C, A> Cloudbilling client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://cloudbilling.googleapis.com/".to_string(), - _root_url: "https://cloudbilling.googleapis.com/".to_string(), } } @@ -338,33 +334,15 @@ impl<'a, C, A> Cloudbilling self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://cloudbilling.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://cloudbilling.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// Encapsulation of billing information for a Developers Console project. A project has at most one associated billing account at a time (but a billing account can be assigned to multiple projects). +/// Encapsulation of billing information for a Cloud Console project. A project +/// has at most one associated billing account at a time (but a billing account +/// can be assigned to multiple projects). /// /// # Activities /// @@ -376,15 +354,24 @@ impl<'a, C, A> Cloudbilling /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ProjectBillingInfo { - /// The ID of the project that this `ProjectBillingInfo` represents, such as `tokyo-rain-123`. This is a convenience field so that you don't need to parse the `name` field to obtain a project ID. This field is read-only. + /// The ID of the project that this `ProjectBillingInfo` represents, such as + /// `tokyo-rain-123`. This is a convenience field so that you don't need to + /// parse the `name` field to obtain a project ID. This field is read-only. #[serde(rename="projectId")] pub project_id: Option, - /// The resource name for the `ProjectBillingInfo`; has the form `projects/{project_id}/billingInfo`. For example, the resource name for the billing information for project `tokyo-rain-123` would be `projects/tokyo-rain-123/billingInfo`. This field is read-only. + /// The resource name for the `ProjectBillingInfo`; has the form + /// `projects/{project_id}/billingInfo`. For example, the resource name for the + /// billing information for project `tokyo-rain-123` would be + /// `projects/tokyo-rain-123/billingInfo`. This field is read-only. pub name: Option, - /// True if the project is associated with an open billing account, to which usage on the project is charged. False if the project is associated with a closed billing account, or no billing account at all, and therefore cannot use paid services. This field is read-only. + /// True if the project is associated with an open billing account, to which + /// usage on the project is charged. False if the project is associated with a + /// closed billing account, or no billing account at all, and therefore cannot + /// use paid services. This field is read-only. #[serde(rename="billingEnabled")] pub billing_enabled: Option, - /// The resource name of the billing account associated with the project, if any. For example, `billingAccounts/012345-567890-ABCDEF`. + /// The resource name of the billing account associated with the project, if + /// any. For example, `billingAccounts/012345-567890-ABCDEF`. #[serde(rename="billingAccountName")] pub billing_account_name: Option, } @@ -404,10 +391,13 @@ impl ResponseResult for ProjectBillingInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListProjectBillingInfoResponse { - /// A token to retrieve the next page of results. To retrieve the next page, call `ListProjectBillingInfo` again with the `page_token` field set to this value. This field is empty if there are no more results to retrieve. + /// A token to retrieve the next page of results. To retrieve the next page, + /// call `ListProjectBillingInfo` again with the `page_token` field set to this + /// value. This field is empty if there are no more results to retrieve. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// A list of `ProjectBillingInfo` resources representing the projects associated with the billing account. + /// A list of `ProjectBillingInfo` resources representing the projects + /// associated with the billing account. #[serde(rename="projectBillingInfo")] pub project_billing_info: Option>, } @@ -415,7 +405,9 @@ pub struct ListProjectBillingInfoResponse { impl ResponseResult for ListProjectBillingInfoResponse {} -/// A billing account in [Google Developers Console](https://console.developers.google.com/). You can assign a billing account to one or more projects. +/// A billing account in [Google Cloud +/// Console](https://console.cloud.google.com/). You can assign a billing account +/// to one or more projects. /// /// # Activities /// @@ -428,12 +420,18 @@ impl ResponseResult for ListProjectBillingInfoResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct BillingAccount { - /// True if the billing account is open, and will therefore be charged for any usage on associated projects. False if the billing account is closed, and therefore projects associated with it will be unable to use paid services. - pub open: Option, - /// The display name given to the billing account, such as `My Billing Account`. This name is displayed in the Google Developers Console. + /// The display name given to the billing account, such as `My Billing + /// Account`. This name is displayed in the Google Cloud Console. #[serde(rename="displayName")] pub display_name: Option, - /// The resource name of the billing account. The resource name has the form `billingAccounts/{billing_account_id}`. For example, `billingAccounts/012345-567890-ABCDEF` would be the resource name for billing account `012345-567890-ABCDEF`. + /// True if the billing account is open, and will therefore be charged for any + /// usage on associated projects. False if the billing account is closed, and + /// therefore projects associated with it will be unable to use paid services. + pub open: Option, + /// The resource name of the billing account. The resource name has the form + /// `billingAccounts/{billing_account_id}`. For example, + /// `billingAccounts/012345-567890-ABCDEF` would be the resource name for + /// billing account `012345-567890-ABCDEF`. pub name: Option, } @@ -452,7 +450,9 @@ impl ResponseResult for BillingAccount {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListBillingAccountsResponse { - /// A token to retrieve the next page of results. To retrieve the next page, call `ListBillingAccounts` again with the `page_token` field set to this value. This field is empty if there are no more results to retrieve. + /// A token to retrieve the next page of results. To retrieve the next page, + /// call `ListBillingAccounts` again with the `page_token` field set to this + /// value. This field is empty if there are no more results to retrieve. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// A list of billing accounts. @@ -508,11 +508,14 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets information about a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947). + /// Gets information about a billing account. The current authenticated user + /// must be an [owner of the billing + /// account](https://support.google.com/cloud/answer/4430947). /// /// # Arguments /// - /// * `name` - The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`. + /// * `name` - The resource name of the billing account to retrieve. For example, + /// `billingAccounts/012345-567890-ABCDEF`. pub fn get(&self, name: &str) -> BillingAccountGetCall<'a, C, A> { BillingAccountGetCall { hub: self.hub, @@ -525,7 +528,8 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the billing accounts that the current authenticated user [owns](https://support.google.com/cloud/answer/4430947). + /// Lists the billing accounts that the current authenticated user + /// [owns](https://support.google.com/cloud/answer/4430947). pub fn list(&self) -> BillingAccountListCall<'a, C, A> { BillingAccountListCall { hub: self.hub, @@ -539,11 +543,14 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the projects associated with a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947). + /// Lists the projects associated with a billing account. The current + /// authenticated user must be an [owner of the billing + /// account](https://support.google.com/cloud/answer/4430947). /// /// # Arguments /// - /// * `name` - The resource name of the billing account associated with the projects that you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. + /// * `name` - The resource name of the billing account associated with the projects that + /// you want to list. For example, `billingAccounts/012345-567890-ABCDEF`. pub fn projects_list(&self, name: &str) -> BillingAccountProjectListCall<'a, C, A> { BillingAccountProjectListCall { hub: self.hub, @@ -599,11 +606,15 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the billing information for a project. The current authenticated user must have [permission to view the project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ). + /// Gets the billing information for a project. The current authenticated user + /// must have [permission to view the + /// project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + /// ). /// /// # Arguments /// - /// * `name` - The resource name of the project for which billing information is retrieved. For example, `projects/tokyo-rain-123`. + /// * `name` - The resource name of the project for which billing information is + /// retrieved. For example, `projects/tokyo-rain-123`. pub fn get_billing_info(&self, name: &str) -> ProjectGetBillingInfoCall<'a, C, A> { ProjectGetBillingInfoCall { hub: self.hub, @@ -616,12 +627,43 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets or updates the billing account associated with a project. You specify the new billing account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the resource name of a billing account. Associating a project with an open billing account enables billing on the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges. *Note:* Incurred charges that have not yet been reported in the transaction history of the Google Developers Console may be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project. The current authenticated user must have ownership privileges for both the [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo ) and the [billing account](https://support.google.com/cloud/answer/4430947). You can disable billing on the project by setting the `billing_account_name` field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project. Note that associating a project with a *closed* billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an *open* billing account. + /// Sets or updates the billing account associated with a project. You specify + /// the new billing account by setting the `billing_account_name` in the + /// `ProjectBillingInfo` resource to the resource name of a billing account. + /// Associating a project with an open billing account enables billing on the + /// project and allows charges for resource usage. If the project already had a + /// billing account, this method changes the billing account used for resource + /// usage charges. + /// + /// *Note:* Incurred charges that have not yet been reported in the transaction + /// history of the Google Cloud Console may be billed to the new billing + /// account, even if the charge occurred before the new billing account was + /// assigned to the project. + /// + /// The current authenticated user must have ownership privileges for both the + /// [project](https://cloud.google.com/docs/permissions-overview#h.bgs0oxofvnoo + /// ) and the [billing + /// account](https://support.google.com/cloud/answer/4430947). + /// + /// You can disable billing on the project by setting the + /// `billing_account_name` field to empty. This action disassociates the + /// current billing account from the project. Any billable activity of your + /// in-use services will stop, and your application could stop functioning as + /// expected. Any unbilled charges to date will be billed to the previously + /// associated account. The current authenticated user must be either an owner + /// of the project or an owner of the billing account for the project. + /// + /// Note that associating a project with a *closed* billing account will have + /// much the same effect as disabling billing on the project: any paid + /// resources used by the project will be shut down. Thus, unless you wish to + /// disable billing, you should always call this method with the name of an + /// *open* billing account. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the project associated with the billing information that you want to update. For example, `projects/tokyo-rain-123`. + /// * `name` - The resource name of the project associated with the billing information + /// that you want to update. For example, `projects/tokyo-rain-123`. pub fn update_billing_info(&self, request: ProjectBillingInfo, name: &str) -> ProjectUpdateBillingInfoCall<'a, C, A> { ProjectUpdateBillingInfoCall { hub: self.hub, @@ -642,7 +684,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Gets information about a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947). +/// Gets information about a billing account. The current authenticated user +/// must be an [owner of the billing +/// account](https://support.google.com/cloud/answer/4430947). /// /// A builder for the *get* method supported by a *billingAccount* resource. /// It is not used directly, but through a `BillingAccountMethods` instance. @@ -713,7 +757,7 @@ impl<'a, C, A> BillingAccountGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+name}"; + let mut url = "https://cloudbilling.googleapis.com/v1/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -819,7 +863,8 @@ impl<'a, C, A> BillingAccountGetCall<'a, C, A> where C: BorrowMut } - /// The resource name of the billing account to retrieve. For example, `billingAccounts/012345-567890-ABCDEF`. + /// The resource name of the billing account to retrieve. For example, + /// `billingAccounts/012345-567890-ABCDEF`. /// /// Sets the *name* path property to the given value. /// @@ -887,7 +932,8 @@ impl<'a, C, A> BillingAccountGetCall<'a, C, A> where C: BorrowMut } -/// Lists the billing accounts that the current authenticated user [owns](https://support.google.com/cloud/answer/4430947). +/// Lists the billing accounts that the current authenticated user +/// [owns](https://support.google.com/cloud/answer/4430947). /// /// A builder for the *list* method supported by a *billingAccount* resource. /// It is not used directly, but through a `BillingAccountMethods` instance. @@ -965,7 +1011,7 @@ impl<'a, C, A> BillingAccountListCall<'a, C, A> where C: BorrowMut BillingAccountListCall<'a, C, A> where C: BorrowMut BillingAccountListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Requested page size. The maximum page size is 100; this is also the default. + /// Requested page size. The maximum page size is 100; this is also the + /// default. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> BillingAccountListCall<'a, C, A> { @@ -1119,7 +1168,9 @@ impl<'a, C, A> BillingAccountListCall<'a, C, A> where C: BorrowMut BillingAccountProjectListCall<'a, C, A> where C: BorrowMut BillingAccountProjectListCall<'a, C, A> where C: BorrowMut BillingAccountProjectListCall<'a, C, A> where C: BorrowMut BillingAccountProjectListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Requested page size. The maximum page size is 100; this is also the default. + /// Requested page size. The maximum page size is 100; this is also the + /// default. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> BillingAccountProjectListCall<'a, C, A> { @@ -1388,7 +1443,10 @@ impl<'a, C, A> BillingAccountProjectListCall<'a, C, A> where C: BorrowMut ProjectGetBillingInfoCall<'a, C, A> where C: BorrowMut ProjectGetBillingInfoCall<'a, C, A> where C: BorrowMut ProjectGetBillingInfoCall<'a, C, A> where C: BorrowMut ProjectUpdateBillingInfoCall<'a, C, A> where C: BorrowMut ProjectUpdateBillingInfoCall<'a, C, A> where C: BorrowMut ProjectUpdateBillingInfoCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Debugger (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/clouddebugger2-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-clouddebugger2] path = "../clouddebugger2" -version = "1.0.4+20160810" +version = "1.0.4+20170413" diff --git a/gen/clouddebugger2-cli/README.md b/gen/clouddebugger2-cli/README.md index feb4526f06..1f26127f50 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 *20160810*. The CLI is at version *1.0.4*. +This documentation was generated from the *Cloud Debugger* API at revision *20170413*. The CLI is at version *1.0.4*. ```bash clouddebugger2 [options] diff --git a/gen/clouddebugger2-cli/mkdocs.yml b/gen/clouddebugger2-cli/mkdocs.yml index 66dc019125..43a62cb76d 100644 --- a/gen/clouddebugger2-cli/mkdocs.yml +++ b/gen/clouddebugger2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Debugger v1.0.4+20160810 +site_name: Cloud Debugger v1.0.4+20170413 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 0d2d6b99f1..3e71d77d00 100644 --- a/gen/clouddebugger2-cli/src/main.rs +++ b/gen/clouddebugger2-cli/src/main.rs @@ -785,7 +785,19 @@ fn main() { let arg_data = [ ("controller", "methods: 'debuggees-breakpoints-list', 'debuggees-breakpoints-update' and 'debuggees-register'", vec![ ("debuggees-breakpoints-list", - Some(r##"Returns the list of all active breakpoints for the debuggee. The breakpoint specification (location, condition, and expression fields) is semantically immutable, although the field values may change. For example, an agent may update the location line number to reflect the actual line where the breakpoint was set, but this doesn't change the breakpoint semantics. This means that an agent does not need to check if a breakpoint has changed when it encounters the same breakpoint on a successive call. Moreover, an agent should remember the breakpoints that are completed until the controller removes them from the active list to avoid setting those breakpoints again."##), + Some(r##"Returns the list of all active breakpoints for the debuggee. + + The breakpoint specification (location, condition, and expression + fields) is semantically immutable, although the field values may + change. For example, an agent may update the location line number + to reflect the actual line where the breakpoint was set, but this + doesn't change the breakpoint semantics. + + This means that an agent does not need to check if a breakpoint has changed + when it encounters the same breakpoint on a successive call. + Moreover, an agent should remember the breakpoints that are completed + until the controller removes them from the active list to avoid + setting those breakpoints again."##), "Details at http://byron.github.io/google-apis-rs/google_clouddebugger2_cli/controller_debuggees-breakpoints-list", vec![ (Some(r##"debuggee-id"##), @@ -807,7 +819,15 @@ fn main() { Some(false)), ]), ("debuggees-breakpoints-update", - Some(r##"Updates the breakpoint state or mutable fields. The entire Breakpoint message must be sent back to the controller service. Updates to active breakpoint fields are only allowed if the new value does not change the breakpoint specification. Updates to the `location`, `condition` and `expression` fields should not alter the breakpoint semantics. These may only make changes such as canonicalizing a value or snapping the location to the correct line of code."##), + Some(r##"Updates the breakpoint state or mutable fields. + The entire Breakpoint message must be sent back to the controller + service. + + Updates to active breakpoint fields are only allowed if the new value + does not change the breakpoint specification. Updates to the `location`, + `condition` and `expression` fields should not alter the breakpoint + semantics. These may only make changes such as canonicalizing a value + or snapping the location to the correct line of code."##), "Details at http://byron.github.io/google-apis-rs/google_clouddebugger2_cli/controller_debuggees-breakpoints-update", vec![ (Some(r##"debuggee-id"##), @@ -841,7 +861,16 @@ fn main() { Some(false)), ]), ("debuggees-register", - Some(r##"Registers the debuggee with the controller service. All agents attached to the same application should call this method with the same request content to get back the same stable `debuggee_id`. Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` is returned from any controller method. This allows the controller service to disable the agent or recover from any data loss. If the debuggee is disabled by the server, the response will have `is_disabled` set to `true`."##), + Some(r##"Registers the debuggee with the controller service. + + All agents attached to the same application should call this method with + the same request content to get back the same stable `debuggee_id`. Agents + should call this method again whenever `google.rpc.Code.NOT_FOUND` is + returned from any controller method. + + This allows the controller service to disable the agent or recover from any + data loss. If the debuggee is disabled by the server, the response will + have `is_disabled` set to `true`."##), "Details at http://byron.github.io/google-apis-rs/google_clouddebugger2_cli/controller_debuggees-register", vec![ (Some(r##"kv"##), @@ -993,8 +1022,9 @@ fn main() { let mut app = App::new("clouddebugger2") .author("Sebastian Thiel ") - .version("1.0.4+20160810") - .about("Examines the call stack and variables of a running application without stopping or slowing it down.") + .version("1.0.4+20170413") + .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") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/clouddebugger2/Cargo.toml b/gen/clouddebugger2/Cargo.toml index 9a138e9177..fc11f13f47 100644 --- a/gen/clouddebugger2/Cargo.toml +++ b/gen/clouddebugger2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-clouddebugger2" -version = "1.0.4+20160810" +version = "1.0.4+20170413" 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.4+20160810" +documentation = "https://docs.rs/google-clouddebugger2/1.0.4+20170413" license = "MIT" keywords = ["clouddebugger", "google", "protocol", "web", "api"] diff --git a/gen/clouddebugger2/README.md b/gen/clouddebugger2/README.md index 7dfab8a522..70c721a867 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.4+20160810*, where *20160810* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Cloud Debugger* crate version *1.0.4+20170413*, where *20170413* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20160810/google_clouddebugger2/struct.CloudDebugger.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/struct.CloudDebugger.html) ... * controller - * [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/struct.ControllerDebuggeeBreakpointListCall.html), [*debuggees breakpoints update*](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/struct.ControllerDebuggeeBreakpointUpdateCall.html) and [*debuggees register*](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/struct.ControllerDebuggeeRegisterCall.html) + * [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/struct.ControllerDebuggeeBreakpointListCall.html), [*debuggees breakpoints update*](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/struct.ControllerDebuggeeBreakpointUpdateCall.html) and [*debuggees register*](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/struct.ControllerDebuggeeRegisterCall.html) * debugger - * [*debuggees breakpoints delete*](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointDeleteCall.html), [*debuggees breakpoints get*](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointGetCall.html), [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointListCall.html), [*debuggees breakpoints set*](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointSetCall.html) and [*debuggees list*](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/struct.DebuggerDebuggeeListCall.html) + * [*debuggees breakpoints delete*](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointDeleteCall.html), [*debuggees breakpoints get*](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointGetCall.html), [*debuggees breakpoints list*](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointListCall.html), [*debuggees breakpoints set*](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/struct.DebuggerDebuggeeBreakpointSetCall.html) and [*debuggees list*](https://docs.rs/google-clouddebugger2/1.0.4+20170413/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.4+20160810/google_clouddebugger2/struct.CloudDebugger.html)** +* **[Hub](https://docs.rs/google-clouddebugger2/1.0.4+20170413/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.4+20160810/google_clouddebugger2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-clouddebugger2/1.0.4+20170413/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.4+20160810/google_clouddebugger2/trait.Part.html)** + * **[Parts](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-clouddebugger2/1.0.4+20160810/google_clouddebugger2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-clouddebugger2/1.0.4+20170413/google_clouddebugger2/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-clouddebugger2/1.0.4+20160810/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.4+20170413/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.4+20160810/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.4+20170413/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.4+20160810/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.4+20170413/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.4+20160810/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.4+20170413/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")`. @@ -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-clouddebugger2/1.0.4+20160810/google_clouddebugger2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-clouddebugger2/1.0.4+20160810/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.4+20170413/google_clouddebugger2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-clouddebugger2/1.0.4+20170413/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.4+20160810/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.4+20170413/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.4+20160810/google_clouddebugger2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-clouddebugger2/1.0.4+20160810/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.4+20170413/google_clouddebugger2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-clouddebugger2/1.0.4+20170413/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.4+20160810/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.4+20170413/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.4+20160810/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.4+20170413/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.4+20160810/google_clouddebugger2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-clouddebugger2/1.0.4+20170413/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 fafca8f86e..ad0f598586 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.4+20160810*, where *20160810* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Cloud Debugger* crate version *1.0.4+20170413*, where *20170413* is the exact revision of the *clouddebugger:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Cloud Debugger* *v2* API can be found at the //! [official documentation site](http://cloud.google.com/debugger). @@ -179,7 +179,7 @@ // 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 +// 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)] @@ -315,8 +315,6 @@ pub struct CloudDebugger { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for CloudDebugger {} @@ -329,8 +327,6 @@ impl<'a, C, A> CloudDebugger client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://clouddebugger.googleapis.com/".to_string(), - _root_url: "https://clouddebugger.googleapis.com/".to_string(), } } @@ -350,33 +346,14 @@ impl<'a, C, A> CloudDebugger self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://clouddebugger.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://clouddebugger.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// An ExtendedSourceContext is a SourceContext combined with additional details describing the context. +/// An ExtendedSourceContext is a SourceContext combined with additional +/// details describing the context. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -402,10 +379,14 @@ impl Part for ExtendedSourceContext {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListBreakpointsResponse { - /// A wait token that can be used in the next call to `list` (REST) or `ListBreakpoints` (RPC) to block until the list of breakpoints has changes. + /// A wait token that can be used in the next call to `list` (REST) or + /// `ListBreakpoints` (RPC) to block until the list of breakpoints has changes. #[serde(rename="nextWaitToken")] pub next_wait_token: Option, - /// List of all breakpoints with complete state. The fields `id` and `location` are guaranteed to be set on each breakpoint. + /// List of breakpoints matching the request. + /// The fields `id` and `location` are guaranteed to be set on each breakpoint. + /// The fields: `stack_frames`, `evaluated_expressions` and `variable_table` + /// are cleared on each breakpoint regardless of it's status. pub breakpoints: Option>, } @@ -418,7 +399,8 @@ impl ResponseResult for ListBreakpointsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CloudWorkspaceSourceContext { - /// The ID of the snapshot. An empty snapshot_id refers to the most recent snapshot. + /// The ID of the snapshot. + /// An empty snapshot_id refers to the most recent snapshot. #[serde(rename="snapshotId")] pub snapshot_id: Option, /// The ID of the workspace. @@ -437,12 +419,14 @@ impl Part for CloudWorkspaceSourceContext {} pub struct StackFrame { /// Demangled function name at the call site. pub function: Option, + /// Set of arguments passed to this function. + /// Note that this might not be populated for all stack frames. + pub arguments: Option>, + /// Set of local variables at the stack frame location. + /// Note that this might not be populated for all stack frames. + pub locals: Option>, /// Source location of the call site. pub location: Option, - /// Set of local variables at the stack frame location. Note that this might not be populated for all stack frames. - pub locals: Option>, - /// Set of arguments passed to this function. Note that this might not be populated for all stack frames. - pub arguments: Option>, } impl Part for StackFrame {} @@ -459,7 +443,11 @@ impl Part for StackFrame {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListDebuggeesResponse { - /// List of debuggees accessible to the calling user. Note that the `description` field is the only human readable field that should be displayed to the user. The fields `debuggee.id` and `description` fields are guaranteed to be set on each debuggee. + /// List of debuggees accessible to the calling user. + /// Note that the `description` field is the only human readable field + /// that should be displayed to the user. + /// The fields `debuggee.id` and `description` fields are guaranteed to be + /// set on each debuggee. pub debuggees: Option>, } @@ -477,14 +465,17 @@ impl ResponseResult for ListDebuggeesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RegisterDebuggeeRequest { - /// Debuggee information to register. The fields `project`, `uniquifier`, `description` and `agent_version` of the debuggee must be set. + /// Debuggee information to register. + /// The fields `project`, `uniquifier`, `description` and `agent_version` + /// of the debuggee must be set. pub debuggee: Option, } impl RequestValue for RegisterDebuggeeRequest {} -/// Response for updating an active breakpoint. The message is defined to allow future extensions. +/// Response for updating an active breakpoint. +/// The message is defined to allow future extensions. /// /// # Activities /// @@ -499,7 +490,8 @@ pub struct UpdateActiveBreakpointResponse { _never_set: Option } impl ResponseResult for UpdateActiveBreakpointResponse {} -/// Selects a repo using a Google Cloud Platform project ID (e.g. winged-cargo-31) and a repo name within that project. +/// Selects a repo using a Google Cloud Platform project ID +/// (e.g. winged-cargo-31) and a repo name within that project. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -542,20 +534,24 @@ impl Part for AliasContext {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListActiveBreakpointsResponse { - /// The `wait_expired` field is set to true by the server when the request times out and the field `success_on_timeout` is set to true. + /// The `wait_expired` field is set to true by the server when the + /// request times out and the field `success_on_timeout` is set to true. #[serde(rename="waitExpired")] pub wait_expired: Option, - /// A wait token that can be used in the next method call to block until the list of breakpoints changes. + /// A wait token that can be used in the next method call to block until + /// the list of breakpoints changes. #[serde(rename="nextWaitToken")] pub next_wait_token: Option, - /// List of all active breakpoints. The fields `id` and `location` are guaranteed to be set on each breakpoint. + /// List of all active breakpoints. + /// The fields `id` and `location` are guaranteed to be set on each breakpoint. pub breakpoints: Option>, } impl ResponseResult for ListActiveBreakpointsResponse {} -/// A CloudRepoSourceContext denotes a particular revision in a cloud repo (a repo hosted by the Google Cloud Platform). +/// A CloudRepoSourceContext denotes a particular revision in a cloud +/// repo (a repo hosted by the Google Cloud Platform). /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -594,7 +590,15 @@ pub struct RepoId { impl Part for RepoId {} -/// 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 `{}`. +/// 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 /// @@ -621,15 +625,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 {} @@ -646,14 +652,16 @@ impl Part for GerritSourceContext {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RegisterDebuggeeResponse { - /// Debuggee resource. The field `id` is guranteed to be set (in addition to the echoed fields). + /// Debuggee resource. + /// The field `id` is guranteed to be set (in addition to the echoed fields). pub debuggee: Option, } impl ResponseResult for RegisterDebuggeeResponse {} -/// A SourceContext is a reference to a tree of files. A SourceContext together with a path point to a unique revision of a single file or directory. +/// A SourceContext is a reference to a tree of files. A SourceContext together +/// with a path point to a unique revision of a single file or directory. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -685,7 +693,8 @@ impl Part for SourceContext {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateActiveBreakpointRequest { - /// Updated breakpoint information. The field 'id' must be set. + /// Updated breakpoint information. + /// The field 'id' must be set. pub breakpoint: Option, } @@ -707,35 +716,61 @@ pub struct SourceLocation { impl Part for SourceLocation {} -/// Represents the application to debug. The application may include one or more replicated processes executing the same code. Each of these processes is attached with a debugger agent, carrying out the debugging commands. The agents attached to the same debuggee are identified by using exactly the same field values when registering. +/// Represents the application to debug. The application may include one or more +/// replicated processes executing the same code. Each of these processes is +/// attached with a debugger agent, carrying out the debugging commands. +/// The agents attached to the same debuggee are identified by using exactly the +/// same field values when registering. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Debuggee { - /// Human readable message to be displayed to the user about this debuggee. Absence of this field indicates no status. The message can be either informational or an error status. + /// Human readable message to be displayed to the user about this debuggee. + /// Absence of this field indicates no status. The message can be either + /// informational or an error status. pub status: Option, - /// Human readable description of the debuggee. Including a human-readable project name, environment name and version information is recommended. + /// Human readable description of the debuggee. + /// Including a human-readable project name, environment name and version + /// information is recommended. pub description: Option, - /// If set to `true`, indicates that the agent should disable itself and detach from the debuggee. + /// If set to `true`, indicates that the agent should disable itself and + /// detach from the debuggee. #[serde(rename="isDisabled")] pub is_disabled: Option, - /// A set of custom debuggee properties, populated by the agent, to be displayed to the user. + /// A set of custom debuggee properties, populated by the agent, to be + /// displayed to the user. pub labels: Option>, - /// Debuggee uniquifier within the project. Any string that identifies the application within the project can be used. Including environment and version or build IDs is recommended. + /// Debuggee uniquifier within the project. + /// Any string that identifies the application within the project can be used. + /// Including environment and version or build IDs is recommended. pub uniquifier: Option, - /// Project the debuggee is associated with. Use the project number when registering a Google Cloud Platform project. + /// Project the debuggee is associated with. + /// Use the project number when registering a Google Cloud Platform project. pub project: Option, - /// References to the locations and revisions of the source code used in the deployed application. NOTE: This field is deprecated. Consumers should use `ext_source_contexts` if it is not empty. Debug agents should populate both this field and `ext_source_contexts`. + /// References to the locations and revisions of the source code used in the + /// deployed application. + /// + /// NOTE: This field is deprecated. Consumers should use + /// `ext_source_contexts` if it is not empty. Debug agents should populate + /// both this field and `ext_source_contexts`. #[serde(rename="sourceContexts")] pub source_contexts: Option>, - /// References to the locations and revisions of the source code used in the deployed application. Contexts describing a remote repo related to the source code have a `category` label of `remote_repo`. Source snapshot source contexts have a `category` of `snapshot`. + /// References to the locations and revisions of the source code used in the + /// deployed application. + /// + /// Contexts describing a remote repo related to the source code + /// have a `category` label of `remote_repo`. Source snapshot source + /// contexts have a `category` of `snapshot`. #[serde(rename="extSourceContexts")] pub ext_source_contexts: Option>, - /// Version ID of the agent release. The version ID is structured as following: `domain/type/vmajor.minor` (for example `google.com/gcp-java/v1.1`). + /// Version ID of the agent release. The version ID is structured as + /// following: `domain/type/vmajor.minor` (for example + /// `google.com/gcp-java/v1.1`). #[serde(rename="agentVersion")] pub agent_version: Option, - /// If set to `true`, indicates that the debuggee is considered as inactive by the Controller service. + /// If set to `true`, indicates that the debuggee is considered as inactive by + /// the Controller service. #[serde(rename="isInactive")] pub is_inactive: Option, /// Unique identifier for the debuggee generated by the controller service. @@ -753,14 +788,23 @@ impl Part for Debuggee {} pub struct FormatMessage { /// Optional parameters to be embedded into the message. pub parameters: Option>, - /// Format template for the message. The `format` uses placeholders `$0`, `$1`, etc. to reference parameters. `$$` can be used to denote the `$` character. Examples: * `Failed to load '$0' which helps debug $1 the first time it is loaded. Again, $0 is very important.` * `Please pay $$10 to use $0 instead of $1.` + /// Format template for the message. The `format` uses placeholders `$0`, + /// `$1`, etc. to reference parameters. `$$` can be used to denote the `$` + /// character. + /// + /// Examples: + /// + /// * `Failed to load '$0' which helps debug $1 the first time it + /// is loaded. Again, $0 is very important.` + /// * `Please pay $$10 to use $0 instead of $1.` pub format: Option, } impl Part for FormatMessage {} -/// A GitSourceContext denotes a particular revision in a third party Git repository (e.g. GitHub). +/// A GitSourceContext denotes a particular revision in a third party Git +/// repository (e.g. GitHub). /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -768,7 +812,8 @@ impl Part for FormatMessage {} pub struct GitSourceContext { /// Git repository URL. pub url: Option, - /// Git commit hash. required. + /// Git commit hash. + /// required. #[serde(rename="revisionId")] pub revision_id: Option, } @@ -776,7 +821,9 @@ pub struct GitSourceContext { impl Part for GitSourceContext {} -/// A CloudWorkspaceId is a unique identifier for a cloud workspace. A cloud workspace is a place associated with a repo where modified files can be stored before they are committed. +/// A CloudWorkspaceId is a unique identifier for a cloud workspace. +/// A cloud workspace is a place associated with a repo where modified files +/// can be stored before they are committed. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -785,7 +832,8 @@ pub struct CloudWorkspaceId { /// The ID of the repo containing the workspace. #[serde(rename="repoId")] pub repo_id: Option, - /// The unique name of the workspace within the repo. This is the name chosen by the client in the Source API's CreateWorkspace method. + /// The unique name of the workspace within the repo. This is the name + /// chosen by the client in the Source API's CreateWorkspace method. pub name: Option, } @@ -803,9 +851,34 @@ impl Part for CloudWorkspaceId {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Breakpoint { - /// Breakpoint status. The status includes an error flag and a human readable message. This field is usually unset. The message can be either informational or an error message. Regardless, clients should always display the text message back to the user. Error status indicates complete failure of the breakpoint. Example (non-final state): `Still loading symbols...` Examples (final state): * `Invalid line number` referring to location * `Field f not found in class C` referring to condition + /// Breakpoint status. + /// + /// The status includes an error flag and a human readable message. + /// This field is usually unset. The message can be either + /// informational or an error message. Regardless, clients should always + /// display the text message back to the user. + /// + /// Error status indicates complete failure of the breakpoint. + /// + /// Example (non-final state): `Still loading symbols...` + /// + /// Examples (final state): + /// + /// * `Invalid line number` referring to location + /// * `Field f not found in class C` referring to condition pub status: Option, - /// The `variable_table` exists to aid with computation, memory and network traffic optimization. It enables storing a variable once and reference it from multiple variables, including variables stored in the `variable_table` itself. For example, the same `this` object, which may appear at many levels of the stack, can have all of its data stored once in this table. The stack frame variables then would hold only a reference to it. The variable `var_table_index` field is an index into this repeated field. The stored objects are nameless and get their name from the referencing variable. The effective variable is a merge of the referencing variable and the referenced variable. + /// The `variable_table` exists to aid with computation, memory and network + /// traffic optimization. It enables storing a variable once and reference + /// it from multiple variables, including variables stored in the + /// `variable_table` itself. + /// For example, the same `this` object, which may appear at many levels of + /// the stack, can have all of its data stored once in this table. The + /// stack frame variables then would hold only a reference to it. + /// + /// The variable `var_table_index` field is an index into this repeated field. + /// The stored objects are nameless and get their name from the referencing + /// variable. The effective variable is a merge of the referencing variable + /// and the referenced variable. #[serde(rename="variableTable")] pub variable_table: Option>, /// E-mail address of the user that created this breakpoint @@ -814,24 +887,44 @@ pub struct Breakpoint { /// 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. + /// 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. + /// Time this breakpoint was finalized as seen by the server in seconds + /// resolution. #[serde(rename="finalTime")] pub final_time: Option, /// The stack at breakpoint time. #[serde(rename="stackFrames")] pub stack_frames: Option>, - /// List of read-only expressions to evaluate at the breakpoint location. The expressions are composed using expressions in the programming language at the source location. If the breakpoint action is `LOG`, the evaluated expressions are included in log statements. + /// List of read-only expressions to evaluate at the breakpoint location. + /// The expressions are composed using expressions in the programming language + /// at the source location. If the breakpoint action is `LOG`, the evaluated + /// expressions are included in log statements. pub expressions: Option>, - /// Values of evaluated expressions at breakpoint time. The evaluated expressions appear in exactly the same order they are listed in the `expressions` field. The `name` field holds the original expression text, the `value` or `members` field holds the result of the evaluated expression. If the expression cannot be evaluated, the `status` inside the `Variable` will indicate an error and contain the error text. + /// Values of evaluated expressions at breakpoint time. + /// The evaluated expressions appear in exactly the same order they + /// are listed in the `expressions` field. + /// The `name` field holds the original expression text, the `value` or + /// `members` field holds the result of the evaluated expression. + /// If the expression cannot be evaluated, the `status` inside the `Variable` + /// 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, - /// Condition that triggers the breakpoint. The condition is a compound boolean expression composed using expressions in a programming language at the source location. + /// Condition that triggers the breakpoint. + /// The condition is a compound boolean expression composed using expressions + /// in a programming language at the source location. pub condition: Option, - /// Only relevant when action is `LOG`. Defines the message to log when the breakpoint hits. The message may include parameter placeholders `$0`, `$1`, etc. These placeholders are replaced with the evaluated value of the appropriate expression. Expressions not referenced in `log_message_format` are not logged. Example: `Message received, id = $0, count = $1` with `expressions` = `[ message.id, message.count ]`. + /// Only relevant when action is `LOG`. Defines the message to log when + /// the breakpoint hits. The message may include parameter placeholders `$0`, + /// `$1`, etc. These placeholders are replaced with the evaluated value + /// of the appropriate expression. Expressions not referenced in + /// `log_message_format` are not logged. + /// + /// Example: `Message received, id = $0, count = $1` with + /// `expressions` = `[ message.id, message.count ]`. #[serde(rename="logMessageFormat")] pub log_message_format: Option, /// Time this breakpoint was created by the server in seconds resolution. @@ -839,9 +932,11 @@ pub struct Breakpoint { pub create_time: Option, /// Breakpoint source location. pub location: Option, - /// Action that the agent should perform when the code at the breakpoint location is hit. + /// Action that the agent should perform when the code at the + /// breakpoint location is hit. pub action: Option, - /// When true, indicates that this is a final result and the breakpoint state will not change from here on. + /// When true, indicates that this is a final result and the + /// breakpoint state will not change from here on. #[serde(rename="isFinalState")] pub is_final_state: Option, } @@ -849,21 +944,151 @@ pub struct Breakpoint { impl RequestValue for Breakpoint {} -/// Represents a variable or an argument possibly of a compound object type. Note how the following variables are represented: 1) A simple variable: int x = 5 { name: "x", value: "5", type: "int" } // Captured variable 2) A compound object: struct T { int m1; int m2; }; T x = { 3, 7 }; { // Captured variable name: "x", type: "T", members { name: "m1", value: "3", type: "int" }, members { name: "m2", value: "7", type: "int" } } 3) A pointer where the pointee was captured: T x = { 3, 7 }; T* p = &x; { // Captured variable name: "p", type: "T*", value: "0x00500500", members { name: "m1", value: "3", type: "int" }, members { name: "m2", value: "7", type: "int" } } 4) A pointer where the pointee was not captured: T* p = new T; { // Captured variable name: "p", type: "T*", value: "0x00400400" status { is_error: true, description { format: "unavailable" } } } The status should describe the reason for the missing value, such as ``, ``, ` -/// `. Note that a null pointer should not have members. 5) An unnamed value: int* p = new int(7); { // Captured variable name: "p", value: "0x00500500", type: "int*", members { value: "7", type: "int" } } 6) An unnamed pointer where the pointee was not captured: int* p = new int(7); int** pp = &p; { // Captured variable name: "pp", value: "0x00500500", type: "int**", members { value: "0x00400400", type: "int*" status { is_error: true, description: { format: "unavailable" } } } } } To optimize computation, memory and network traffic, variables that repeat in the output multiple times can be stored once in a shared variable table and be referenced using the `var_table_index` field. The variables stored in the shared table are nameless and are essentially a partition of the complete variable. To reconstruct the complete variable, merge the referencing variable with the referenced variable. When using the shared variable table, the following variables: T x = { 3, 7 }; T* p = &x; T& r = x; { name: "x", var_table_index: 3, type: "T" } // Captured variables { name: "p", value "0x00500500", type="T*", var_table_index: 3 } { name: "r", type="T&", var_table_index: 3 } { // Shared variable table entry #3: members { name: "m1", value: "3", type: "int" }, members { name: "m2", value: "7", type: "int" } } Note that the pointer address is stored with the referencing variable and not with the referenced variable. This allows the referenced variable to be shared between pointers and references. The type field is optional. The debugger agent may or may not support it. +/// Represents a variable or an argument possibly of a compound object type. +/// Note how the following variables are represented: +/// +/// 1) A simple variable: +/// +/// int x = 5 +/// +/// { name: "x", value: "5", type: "int" } // Captured variable +/// +/// 2) A compound object: +/// +/// struct T { +/// int m1; +/// int m2; +/// }; +/// T x = { 3, 7 }; +/// +/// { // Captured variable +/// name: "x", +/// type: "T", +/// members { name: "m1", value: "3", type: "int" }, +/// members { name: "m2", value: "7", type: "int" } +/// } +/// +/// 3) A pointer where the pointee was captured: +/// +/// T x = { 3, 7 }; +/// T* p = &x; +/// +/// { // Captured variable +/// name: "p", +/// type: "T*", +/// value: "0x00500500", +/// members { name: "m1", value: "3", type: "int" }, +/// members { name: "m2", value: "7", type: "int" } +/// } +/// +/// 4) A pointer where the pointee was not captured: +/// +/// T* p = new T; +/// +/// { // Captured variable +/// name: "p", +/// type: "T*", +/// value: "0x00400400" +/// status { is_error: true, description { format: "unavailable" } } +/// } +/// +/// The status should describe the reason for the missing value, +/// such as ``, ``, ``. +/// +/// Note that a null pointer should not have members. +/// +/// 5) An unnamed value: +/// +/// int* p = new int(7); +/// +/// { // Captured variable +/// name: "p", +/// value: "0x00500500", +/// type: "int*", +/// members { value: "7", type: "int" } } +/// +/// 6) An unnamed pointer where the pointee was not captured: +/// +/// int* p = new int(7); +/// int** pp = &p; +/// +/// { // Captured variable +/// name: "pp", +/// value: "0x00500500", +/// type: "int**", +/// members { +/// value: "0x00400400", +/// type: "int*" +/// status { +/// is_error: true, +/// description: { format: "unavailable" } } +/// } +/// } +/// } +/// +/// To optimize computation, memory and network traffic, variables that +/// repeat in the output multiple times can be stored once in a shared +/// variable table and be referenced using the `var_table_index` field. The +/// variables stored in the shared table are nameless and are essentially +/// a partition of the complete variable. To reconstruct the complete +/// variable, merge the referencing variable with the referenced variable. +/// +/// When using the shared variable table, the following variables: +/// +/// T x = { 3, 7 }; +/// T* p = &x; +/// T& r = x; +/// +/// { name: "x", var_table_index: 3, type: "T" } // Captured variables +/// { name: "p", value "0x00500500", type="T*", var_table_index: 3 } +/// { name: "r", type="T&", var_table_index: 3 } +/// +/// { // Shared variable table entry #3: +/// members { name: "m1", value: "3", type: "int" }, +/// members { name: "m2", value: "7", type: "int" } +/// } +/// +/// Note that the pointer address is stored with the referencing variable +/// and not with the referenced variable. This allows the referenced variable +/// to be shared between pointers and references. +/// +/// The type field is optional. The debugger agent may or may not support it. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Variable { - /// Status associated with the variable. This field will usually stay unset. A status of a single variable only applies to that variable or expression. The rest of breakpoint data still remains valid. Variables might be reported in error state even when breakpoint is not in final state. The message may refer to variable name with `refers_to` set to `VARIABLE_NAME`. Alternatively `refers_to` will be set to `VARIABLE_VALUE`. In either case variable value and members will be unset. Example of error message applied to name: `Invalid expression syntax`. Example of information message applied to value: `Not captured`. Examples of error message applied to value: * `Malformed string`, * `Field f not found in class C` * `Null pointer dereference` + /// Status associated with the variable. This field will usually stay + /// unset. A status of a single variable only applies to that variable or + /// expression. The rest of breakpoint data still remains valid. Variables + /// might be reported in error state even when breakpoint is not in final + /// state. + /// + /// The message may refer to variable name with `refers_to` set to + /// `VARIABLE_NAME`. Alternatively `refers_to` will be set to `VARIABLE_VALUE`. + /// In either case variable value and members will be unset. + /// + /// Example of error message applied to name: `Invalid expression syntax`. + /// + /// Example of information message applied to value: `Not captured`. + /// + /// Examples of error message applied to value: + /// + /// * `Malformed string`, + /// * `Field f not found in class C` + /// * `Null pointer dereference` pub status: Option, /// Name of the variable, if any. pub name: Option, - /// Reference to a variable in the shared variable table. More than one variable can reference the same variable in the table. The `var_table_index` field is an index into `variable_table` in Breakpoint. + /// Reference to a variable in the shared variable table. More than + /// one variable can reference the same variable in the table. The + /// `var_table_index` field is an index into `variable_table` in Breakpoint. #[serde(rename="varTableIndex")] pub var_table_index: Option, - /// Variable type (e.g. `MyClass`). If the variable is split with `var_table_index`, `type` goes next to `value`. The interpretation of a type is agent specific. It is recommended to include the dynamic type rather than a static type of an object. + /// Variable type (e.g. `MyClass`). If the variable is split with + /// `var_table_index`, `type` goes next to `value`. The interpretation of + /// a type is agent specific. It is recommended to include the dynamic type + /// rather than a static type of an object. #[serde(rename="type")] pub type_: Option, /// Members contained or pointed to by the variable. @@ -886,14 +1111,19 @@ impl Part for Variable {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SetBreakpointResponse { - /// Breakpoint resource. The field `id` is guaranteed to be set (in addition to the echoed fileds). + /// Breakpoint resource. + /// The field `id` is guaranteed to be set (in addition to the echoed fileds). pub breakpoint: Option, } impl ResponseResult for SetBreakpointResponse {} -/// Represents a contextual status message. The message can indicate an error or informational status, and refer to specific parts of the containing object. For example, the `Breakpoint.status` field can indicate an error referring to the `BREAKPOINT_SOURCE_LOCATION` with the message `Location not found`. +/// Represents a contextual status message. +/// The message can indicate an error or informational status, and refer to +/// specific parts of the containing object. +/// For example, the `Breakpoint.status` field can indicate an error referring +/// to the `BREAKPOINT_SOURCE_LOCATION` with the message `Location not found`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -923,7 +1153,8 @@ impl Part for StatusMessage {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GetBreakpointResponse { - /// Complete breakpoint state. The fields `id` and `location` are guaranteed to be set. + /// Complete breakpoint state. + /// The fields `id` and `location` are guaranteed to be set. pub breakpoint: Option, } @@ -975,7 +1206,15 @@ impl<'a, C, A> ControllerMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the breakpoint state or mutable fields. The entire Breakpoint message must be sent back to the controller service. Updates to active breakpoint fields are only allowed if the new value does not change the breakpoint specification. Updates to the `location`, `condition` and `expression` fields should not alter the breakpoint semantics. These may only make changes such as canonicalizing a value or snapping the location to the correct line of code. + /// Updates the breakpoint state or mutable fields. + /// The entire Breakpoint message must be sent back to the controller + /// service. + /// + /// Updates to active breakpoint fields are only allowed if the new value + /// does not change the breakpoint specification. Updates to the `location`, + /// `condition` and `expression` fields should not alter the breakpoint + /// semantics. These may only make changes such as canonicalizing a value + /// or snapping the location to the correct line of code. /// /// # Arguments /// @@ -996,7 +1235,16 @@ impl<'a, C, A> ControllerMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Registers the debuggee with the controller service. All agents attached to the same application should call this method with the same request content to get back the same stable `debuggee_id`. Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` is returned from any controller method. This allows the controller service to disable the agent or recover from any data loss. If the debuggee is disabled by the server, the response will have `is_disabled` set to `true`. + /// Registers the debuggee with the controller service. + /// + /// All agents attached to the same application should call this method with + /// the same request content to get back the same stable `debuggee_id`. Agents + /// should call this method again whenever `google.rpc.Code.NOT_FOUND` is + /// returned from any controller method. + /// + /// This allows the controller service to disable the agent or recover from any + /// data loss. If the debuggee is disabled by the server, the response will + /// have `is_disabled` set to `true`. /// /// # Arguments /// @@ -1013,7 +1261,19 @@ impl<'a, C, A> ControllerMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the list of all active breakpoints for the debuggee. The breakpoint specification (location, condition, and expression fields) is semantically immutable, although the field values may change. For example, an agent may update the location line number to reflect the actual line where the breakpoint was set, but this doesn't change the breakpoint semantics. This means that an agent does not need to check if a breakpoint has changed when it encounters the same breakpoint on a successive call. Moreover, an agent should remember the breakpoints that are completed until the controller removes them from the active list to avoid setting those breakpoints again. + /// Returns the list of all active breakpoints for the debuggee. + /// + /// The breakpoint specification (location, condition, and expression + /// fields) is semantically immutable, although the field values may + /// change. For example, an agent may update the location line number + /// to reflect the actual line where the breakpoint was set, but this + /// doesn't change the breakpoint semantics. + /// + /// This means that an agent does not need to check if a breakpoint has changed + /// when it encounters the same breakpoint on a successive call. + /// Moreover, an agent should remember the breakpoints that are completed + /// until the controller removes them from the active list to avoid + /// setting those breakpoints again. /// /// # Arguments /// @@ -1178,7 +1438,15 @@ impl<'a, C, A> DebuggerMethods<'a, C, A> { // CallBuilders ### // ################# -/// Updates the breakpoint state or mutable fields. The entire Breakpoint message must be sent back to the controller service. Updates to active breakpoint fields are only allowed if the new value does not change the breakpoint specification. Updates to the `location`, `condition` and `expression` fields should not alter the breakpoint semantics. These may only make changes such as canonicalizing a value or snapping the location to the correct line of code. +/// Updates the breakpoint state or mutable fields. +/// The entire Breakpoint message must be sent back to the controller +/// service. +/// +/// Updates to active breakpoint fields are only allowed if the new value +/// does not change the breakpoint specification. Updates to the `location`, +/// `condition` and `expression` fields should not alter the breakpoint +/// semantics. These may only make changes such as canonicalizing a value +/// or snapping the location to the correct line of code. /// /// A builder for the *debuggees.breakpoints.update* method supported by a *controller* resource. /// It is not used directly, but through a `ControllerMethods` instance. @@ -1257,7 +1525,7 @@ impl<'a, C, A> ControllerDebuggeeBreakpointUpdateCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/controller/debuggees/{debuggeeId}/breakpoints/{id}"; + let mut url = "https://clouddebugger.googleapis.com/v2/controller/debuggees/{debuggeeId}/breakpoints/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1429,12 +1697,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> @@ -1462,7 +1730,16 @@ impl<'a, C, A> ControllerDebuggeeBreakpointUpdateCall<'a, C, A> where C: BorrowM } -/// Registers the debuggee with the controller service. All agents attached to the same application should call this method with the same request content to get back the same stable `debuggee_id`. Agents should call this method again whenever `google.rpc.Code.NOT_FOUND` is returned from any controller method. This allows the controller service to disable the agent or recover from any data loss. If the debuggee is disabled by the server, the response will have `is_disabled` set to `true`. +/// Registers the debuggee with the controller service. +/// +/// All agents attached to the same application should call this method with +/// the same request content to get back the same stable `debuggee_id`. Agents +/// should call this method again whenever `google.rpc.Code.NOT_FOUND` is +/// returned from any controller method. +/// +/// This allows the controller service to disable the agent or recover from any +/// data loss. If the debuggee is disabled by the server, the response will +/// have `is_disabled` set to `true`. /// /// A builder for the *debuggees.register* method supported by a *controller* resource. /// It is not used directly, but through a `ControllerMethods` instance. @@ -1537,7 +1814,7 @@ impl<'a, C, A> ControllerDebuggeeRegisterCall<'a, C, A> where C: BorrowMut ControllerDebuggeeRegisterCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ControllerDebuggeeRegisterCall<'a, C, A> @@ -1701,7 +1978,19 @@ impl<'a, C, A> ControllerDebuggeeRegisterCall<'a, C, A> where C: BorrowMut ControllerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/controller/debuggees/{debuggeeId}/breakpoints"; + let mut url = "https://clouddebugger.googleapis.com/v2/controller/debuggees/{debuggeeId}/breakpoints".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1894,14 +2183,21 @@ impl<'a, C, A> ControllerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut self._debuggee_id = new_value.to_string(); self } - /// A wait token that, if specified, blocks the method call until the list of active breakpoints has changed, or a server selected timeout has expired. The value should be set from the last returned response. + /// A wait token that, if specified, blocks the method call until the list + /// of active breakpoints has changed, or a server selected timeout has + /// expired. The value should be set from the last returned response. /// /// Sets the *wait token* query property to the given value. pub fn wait_token(mut self, new_value: &str) -> ControllerDebuggeeBreakpointListCall<'a, C, A> { self._wait_token = Some(new_value.to_string()); self } - /// If set to `true`, returns `google.rpc.Code.OK` status and sets the `wait_expired` response field to `true` when the server-selected timeout has expired (recommended). If set to `false`, returns `google.rpc.Code.ABORTED` status when the server-selected timeout has expired (deprecated). + /// If set to `true`, returns `google.rpc.Code.OK` status and sets the + /// `wait_expired` response field to `true` when the server-selected timeout + /// has expired (recommended). + /// + /// If set to `false`, returns `google.rpc.Code.ABORTED` status when the + /// server-selected timeout has expired (deprecated). /// /// Sets the *success on timeout* query property to the given value. pub fn success_on_timeout(mut self, new_value: bool) -> ControllerDebuggeeBreakpointListCall<'a, C, A> { @@ -1933,12 +2229,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> @@ -2043,7 +2339,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointGetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointGetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointGetCall<'a, C, A> { @@ -2198,12 +2495,12 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DebuggerDebuggeeBreakpointGetCall<'a, C, A> @@ -2308,7 +2605,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}"; + let mut url = "https://clouddebugger.googleapis.com/v2/debugger/debuggees/{debuggeeId}/breakpoints/{breakpointId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2431,7 +2728,8 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> where C: BorrowMut self._breakpoint_id = new_value.to_string(); self } - /// The client version making the call. Following: `domain/type/version` (e.g., `google.com/intellij/v1`). + /// The client version making the call. + /// Following: `domain/type/version` (e.g., `google.com/intellij/v1`). /// /// Sets the *client version* query property to the given value. pub fn client_version(mut self, new_value: &str) -> DebuggerDebuggeeBreakpointDeleteCall<'a, C, A> { @@ -2463,12 +2761,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> @@ -2579,7 +2877,7 @@ impl<'a, C, A> DebuggerDebuggeeListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeListCall<'a, C, A> { self._include_inactive = Some(new_value); self } - /// The client version making the call. Following: `domain/type/version` (e.g., `google.com/intellij/v1`). + /// The client version making the call. + /// Following: `domain/type/version` (e.g., `google.com/intellij/v1`). /// /// Sets the *client version* query property to the given value. pub fn client_version(mut self, new_value: &str) -> DebuggerDebuggeeListCall<'a, C, A> { @@ -2707,12 +3007,12 @@ impl<'a, C, A> DebuggerDebuggeeListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DebuggerDebuggeeListCall<'a, C, A> @@ -2822,7 +3122,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointSetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointSetCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointSetCall<'a, C, A> { @@ -2991,12 +3292,12 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointSetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DebuggerDebuggeeBreakpointSetCall<'a, C, A> @@ -3124,7 +3425,7 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut DebuggerDebuggeeBreakpointListCall<'a, C, A> { self._wait_token = Some(new_value.to_string()); self } - /// When set to `true`, the response breakpoints are stripped of the results fields: `stack_frames`, `evaluated_expressions` and `variable_table`. + /// This field is deprecated. The following fields are always stripped out of + /// the result: `stack_frames`, `evaluated_expressions` and `variable_table`. /// /// Sets the *strip results* query property to the given value. pub fn strip_results(mut self, new_value: bool) -> DebuggerDebuggeeBreakpointListCall<'a, C, A> { self._strip_results = Some(new_value); self } - /// When set to `true`, the response includes active and inactive breakpoints. Otherwise, it includes only active breakpoints. + /// When set to `true`, the response includes active and inactive + /// breakpoints. Otherwise, it includes only active breakpoints. /// /// Sets the *include inactive* query property to the given value. pub fn include_inactive(mut self, new_value: bool) -> DebuggerDebuggeeBreakpointListCall<'a, C, A> { self._include_inactive = Some(new_value); self } - /// When set to `true`, the response includes the list of breakpoints set by any user. Otherwise, it includes only breakpoints set by the caller. + /// When set to `true`, the response includes the list of breakpoints set by + /// any user. Otherwise, it includes only breakpoints set by the caller. /// /// Sets the *include all users* query property to the given value. pub fn include_all_users(mut self, new_value: bool) -> DebuggerDebuggeeBreakpointListCall<'a, C, A> { self._include_all_users = Some(new_value); self } - /// The client version making the call. Following: `domain/type/version` (e.g., `google.com/intellij/v1`). + /// The client version making the call. + /// Following: `domain/type/version` (e.g., `google.com/intellij/v1`). /// /// Sets the *client version* query property to the given value. pub fn client_version(mut self, new_value: &str) -> DebuggerDebuggeeBreakpointListCall<'a, C, A> { @@ -3304,12 +3613,12 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DebuggerDebuggeeBreakpointListCall<'a, C, A> @@ -3337,3 +3646,4 @@ impl<'a, C, A> DebuggerDebuggeeBreakpointListCall<'a, C, A> where C: BorrowMut"] +description = "A complete library to interact with Cloud KMS (protocol v1beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1_beta1-cli" +homepage = "https://cloud.google.com/kms/" +documentation = "http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli" +license = "MIT" +keywords = ["cloudkms", "google", "cli"] + +[[bin]] +name = "cloudkms1-beta1" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 0.9" +serde_json = "^ 0.9" +serde_derive = "^ 0.9" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-cloudkms1_beta1] +path = "../cloudkms1_beta1" +version = "1.0.4+20170515" diff --git a/gen/cloudkms1_beta1-cli/LICENSE.md b/gen/cloudkms1_beta1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/cloudkms1_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/cloudkms1_beta1-cli/README.md b/gen/cloudkms1_beta1-cli/README.md new file mode 100644 index 0000000000..a3c8260637 --- /dev/null +++ b/gen/cloudkms1_beta1-cli/README.md @@ -0,0 +1,137 @@ + +The `cloudkms1-beta1` command-line interface *(CLI)* allows to use most features of the *Google Cloud KMS* service from the comfort of your terminal. + +By default all output is printed to standard out, but flags can be set to direct it into a file independent of your shell's +capabilities. Errors will be printed to standard error, and cause the program's exit code to be non-zero. + +If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. + +Everything else about the *Cloud KMS* API can be found at the +[official documentation site](https://cloud.google.com/kms/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-cloudkms1_beta1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1_beta1-cli). + +# Usage + +This documentation was generated from the *Cloud KMS* API at revision *20170515*. The CLI is at version *1.0.4*. + +```bash +cloudkms1-beta1 [options] + projects + locations-get [-p ]... [-o ] + locations-key-rings-create (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-create (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-create (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-destroy (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-get [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-list [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-patch (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-crypto-key-versions-restore (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-decrypt (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-encrypt (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-get [-p ]... [-o ] + locations-key-rings-crypto-keys-get-iam-policy [-p ]... [-o ] + locations-key-rings-crypto-keys-list [-p ]... [-o ] + locations-key-rings-crypto-keys-patch (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-set-iam-policy (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-test-iam-permissions (-r )... [-p ]... [-o ] + locations-key-rings-crypto-keys-update-primary-version (-r )... [-p ]... [-o ] + locations-key-rings-get [-p ]... [-o ] + locations-key-rings-get-iam-policy [-p ]... [-o ] + locations-key-rings-list [-p ]... [-o ] + locations-key-rings-set-iam-policy (-r )... [-p ]... [-o ] + locations-key-rings-test-iam-permissions (-r )... [-p ]... [-o ] + locations-list [-p ]... [-o ] + cloudkms1-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 `cloudkms1-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/cloudkms1-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/cloudkms1-beta1-secret.json`, assuming that the required *cloudkms* API +was enabled for it. Such a secret file can be downloaded in the *Google Developer Console* at +*APIs & auth -> Credentials -> Download JSON* and used as is. + +Learn more about how to setup Google projects and enable APIs using the [official documentation][google-project-new]. + + +# Debugging + +Even though the CLI does its best to provide usable error messages, sometimes it might be desirable to know +what exactly led to a particular issue. This is done by allowing all client-server communication to be +output to standard error *as-is*. + +The `--debug` flag will print all client-server communication to standard error, whereas the `--debug-auth` flag +will cause all communication related to authentication to standard error. +If the `--debug` flag is set, error-results will be debug-printed, possibly yielding more information about the +issue at hand. + +You may consider redirecting standard error into a file for ease of use, e.g. `cloudkms1-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/cloudkms1_beta1-cli/mkdocs.yml b/gen/cloudkms1_beta1-cli/mkdocs.yml new file mode 100644 index 0000000000..304914217a --- /dev/null +++ b/gen/cloudkms1_beta1-cli/mkdocs.yml @@ -0,0 +1,40 @@ +site_name: Cloud KMS v1.0.4+20170515 +site_url: http://byron.github.io/google-apis-rs/google-cloudkms1_beta1-cli +site_description: A complete library to interact with Cloud KMS (protocol v1beta1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1_beta1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['projects_locations-get.md', 'Projects', 'Locations Get'] +- ['projects_locations-key-rings-create.md', 'Projects', 'Locations Key Rings Create'] +- ['projects_locations-key-rings-crypto-keys-create.md', 'Projects', 'Locations Key Rings Crypto Keys Create'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-create.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions Create'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-destroy.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions Destroy'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-get.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions Get'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-list.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions List'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-patch.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions Patch'] +- ['projects_locations-key-rings-crypto-keys-crypto-key-versions-restore.md', 'Projects', 'Locations Key Rings Crypto Keys Crypto Key Versions Restore'] +- ['projects_locations-key-rings-crypto-keys-decrypt.md', 'Projects', 'Locations Key Rings Crypto Keys Decrypt'] +- ['projects_locations-key-rings-crypto-keys-encrypt.md', 'Projects', 'Locations Key Rings Crypto Keys Encrypt'] +- ['projects_locations-key-rings-crypto-keys-get.md', 'Projects', 'Locations Key Rings Crypto Keys Get'] +- ['projects_locations-key-rings-crypto-keys-get-iam-policy.md', 'Projects', 'Locations Key Rings Crypto Keys Get Iam Policy'] +- ['projects_locations-key-rings-crypto-keys-list.md', 'Projects', 'Locations Key Rings Crypto Keys List'] +- ['projects_locations-key-rings-crypto-keys-patch.md', 'Projects', 'Locations Key Rings Crypto Keys Patch'] +- ['projects_locations-key-rings-crypto-keys-set-iam-policy.md', 'Projects', 'Locations Key Rings Crypto Keys Set Iam Policy'] +- ['projects_locations-key-rings-crypto-keys-test-iam-permissions.md', 'Projects', 'Locations Key Rings Crypto Keys Test Iam Permissions'] +- ['projects_locations-key-rings-crypto-keys-update-primary-version.md', 'Projects', 'Locations Key Rings Crypto Keys Update Primary Version'] +- ['projects_locations-key-rings-get.md', 'Projects', 'Locations Key Rings Get'] +- ['projects_locations-key-rings-get-iam-policy.md', 'Projects', 'Locations Key Rings Get Iam Policy'] +- ['projects_locations-key-rings-list.md', 'Projects', 'Locations Key Rings List'] +- ['projects_locations-key-rings-set-iam-policy.md', 'Projects', 'Locations Key Rings Set Iam Policy'] +- ['projects_locations-key-rings-test-iam-permissions.md', 'Projects', 'Locations Key Rings Test Iam Permissions'] +- ['projects_locations-list.md', 'Projects', 'Locations List'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/cloudkms1_beta1-cli/src/cmn.rs b/gen/cloudkms1_beta1-cli/src/cmn.rs new file mode 100644 index 0000000000..6cc030e9c4 --- /dev/null +++ b/gen/cloudkms1_beta1-cli/src/cmn.rs @@ -0,0 +1,747 @@ +// COPY OF 'src/rust/cli/cmn.rs' +// DO NOT EDIT +use oauth2::{ApplicationSecret, ConsoleApplicationSecret, TokenStorage, Token}; +use serde_json as json; +use serde_json::value::Value; +use mime::Mime; +use clap::{App, SubCommand}; +use strsim; + +use std::fs; +use std::env; +use std::io; +use std::error::Error as StdError; +use std::fmt; +use std::path::{Path, PathBuf}; +use std::str::FromStr; +use std::string::ToString; +use std::io::{Write, Read, stdout}; + +use std::default::Default; + +const FIELD_SEP: char = '.'; + + +pub enum ComplexType { + Pod, + Vec, + Map, +} + + // Null, + // Bool(bool), + // I64(i64), + // U64(u64), + // F64(f64), + // String(String), + +pub enum JsonType { + Boolean, + Int, + Uint, + Float, + String, +} + +pub struct JsonTypeInfo { + pub jtype: JsonType, + pub ctype: ComplexType, +} + +// Based on @erickt user comment. Thanks for the idea ! +// Remove all keys whose values are null from given value (changed in place) +pub fn remove_json_null_values(value: &mut Value) { + match *value { + Value::Object(ref mut map) => { + let mut for_removal = Vec::new(); + + for (key, mut value) in map.iter_mut() { + if value.is_null() { + for_removal.push(key.clone()); + } else { + remove_json_null_values(&mut value); + } + } + + for key in &for_removal { + map.remove(key); + } + } + _ => {} + } +} + +fn did_you_mean<'a>(v: &str, possible_values: &[&'a str]) -> Option<&'a str> { + + let mut candidate: Option<(f64, &str)> = None; + for pv in possible_values { + let confidence = strsim::jaro_winkler(v, pv); + if confidence > 0.8 && (candidate.is_none() || (candidate.as_ref().unwrap().0 < confidence)) { + candidate = Some((confidence, pv)); + } + } + match candidate { + None => None, + Some((_, candidate)) => Some(candidate), + } +} + +pub enum CallType { + Upload(UploadProtocol), + Standard, +} + +arg_enum!{ + pub enum UploadProtocol { + Simple, + Resumable + } +} + +impl AsRef for UploadProtocol { + fn as_ref(&self) -> &str { + match *self { + UploadProtocol::Simple => "simple", + UploadProtocol::Resumable => "resumable" + } + } +} + +impl AsRef for CallType { + fn as_ref(&self) -> &str { + match *self { + CallType::Upload(ref proto) => proto.as_ref(), + CallType::Standard => "standard-request" + } + } +} + +#[derive(Clone, Default)] +pub struct FieldCursor(Vec); + +impl ToString for FieldCursor { + fn to_string(&self) -> String { + self.0.join(".") + } +} + +impl From<&'static str> for FieldCursor { + fn from(value: &'static str) -> FieldCursor { + let mut res = FieldCursor::default(); + res.set(value).unwrap(); + res + } +} + +fn assure_entry<'a, 'b>(m: &'a mut json::Map, k: &'b String) -> &'a mut Value { + if m.contains_key(k) { + return m.get_mut(k).expect("value to exist") + } + m.insert(k.to_owned(), Value::Object(Default::default())); + m.get_mut(k).expect("value to exist") +} + +impl FieldCursor { + pub fn set(&mut self, value: &str) -> Result<(), CLIError> { + if value.len() == 0 { + return Err(CLIError::Field(FieldError::Empty)) + } + + let mut first_is_field_sep = false; + let mut char_count: usize = 0; + let mut last_c = FIELD_SEP; + let mut num_conscutive_field_seps = 0; + + let mut field = String::new(); + let mut fields = self.0.clone(); + + let push_field = |fs: &mut Vec, f: &mut String| { + if f.len() > 0 { + fs.push(f.clone()); + f.truncate(0); + } + }; + + for (cid, c) in value.chars().enumerate() { + char_count += 1; + + if c == FIELD_SEP { + if cid == 0 { + first_is_field_sep = true; + } + num_conscutive_field_seps += 1; + if cid > 0 && last_c == FIELD_SEP { + if fields.pop().is_none() { + return Err(CLIError::Field(FieldError::PopOnEmpty(value.to_string()))) + } + } else { + push_field(&mut fields, &mut field); + } + } else { + num_conscutive_field_seps = 0; + if cid == 1 { + if first_is_field_sep { + fields.truncate(0); + } + } + field.push(c); + } + + last_c = c; + } + + push_field(&mut fields, &mut field); + + if char_count == 1 && first_is_field_sep { + fields.truncate(0); + } + if char_count > 1 && num_conscutive_field_seps == 1 { + return Err(CLIError::Field(FieldError::TrailingFieldSep(value.to_string()))) + } + + self.0 = fields; + Ok(()) + } + + pub fn did_you_mean(value: &str, possible_values: &[&str]) -> Option { + if value.len() == 0 { + return None + } + + let mut last_c = FIELD_SEP; + + let mut field = String::new(); + let mut output = String::new(); + + let push_field = |fs: &mut String, f: &mut String| { + if f.len() > 0 { + fs.push_str( + match did_you_mean(&f, possible_values) { + Some(candidate) => candidate, + None => &f, + }); + f.truncate(0); + } + }; + + for (cid, c) in value.chars().enumerate() { + if c == FIELD_SEP { + if last_c != FIELD_SEP { + push_field(&mut output, &mut field); + } + output.push(c); + } else { + field.push(c); + } + + last_c = c; + } + + push_field(&mut output, &mut field); + + if &output == value { + None + } else { + Some(output) + } + } + + pub fn set_json_value(&self, mut object: &mut Value, + value: &str, type_info: JsonTypeInfo, + err: &mut InvalidOptionsError, + orig_cursor: &FieldCursor) { + assert!(self.0.len() > 0); + + for field in &self.0[..self.0.len()-1] { + let tmp = object; + object = + match *tmp { + Value::Object(ref mut mapping) => { + assure_entry(mapping, &field) + }, + _ => panic!("We don't expect non-object Values here ...") + }; + } + + match *object { + Value::Object(ref mut mapping) => { + let field = &self.0[self.0.len()-1]; + let to_jval = + |value: &str, jtype: JsonType, err: &mut InvalidOptionsError| + -> Value { + match jtype { + JsonType::Boolean => + Value::Bool(arg_from_str(value, err, &field, "boolean")), + JsonType::Int => + Value::Number(json::Number::from_f64(arg_from_str(value, err, &field, "int")).expect("valid f64")), + JsonType::Uint => + Value::Number(json::Number::from_f64(arg_from_str(value, err, &field, "uint")).expect("valid f64")), + JsonType::Float => + Value::Number(json::Number::from_f64(arg_from_str(value, err, &field, "float")).expect("valid f64")), + JsonType::String => + Value::String(value.to_owned()), + } + }; + + match type_info.ctype { + ComplexType::Pod => { + if mapping.insert(field.to_owned(), to_jval(value, type_info.jtype, err)).is_some() { + err.issues.push(CLIError::Field(FieldError::Duplicate(orig_cursor.to_string()))); + } + }, + ComplexType::Vec => { + match *assure_entry(mapping, field) { + Value::Array(ref mut values) => values.push(to_jval(value, type_info.jtype, err)), + _ => unreachable!() + } + }, + ComplexType::Map => { + let (key, value) = parse_kv_arg(value, err, true); + let jval = to_jval(value.unwrap_or(""), type_info.jtype, err); + + match *assure_entry(mapping, &field) { + + Value::Object(ref mut value_map) => { + if value_map.insert(key.to_owned(), jval).is_some() { + err.issues.push(CLIError::Field(FieldError::Duplicate(orig_cursor.to_string()))); + } + } + _ => unreachable!() + } + } + } + }, + _ => unreachable!() + } + } + + pub fn num_fields(&self) -> usize { + self.0.len() + } +} + +pub fn parse_kv_arg<'a>(kv: &'a str, err: &mut InvalidOptionsError, for_hashmap: bool) + -> (&'a str, Option<&'a str>) { + let mut add_err = || err.issues.push(CLIError::InvalidKeyValueSyntax(kv.to_string(),for_hashmap)); + match kv.find('=') { + None => { + add_err(); + return (kv, None) + }, + Some(pos) => { + let key = &kv[..pos]; + if kv.len() <= pos + 1 { + add_err(); + return (key, Some("")) + } + (key, Some(&kv[pos+1..])) + } + } +} + +pub fn calltype_from_str(name: &str, valid_protocols: Vec, err: &mut InvalidOptionsError) -> CallType { + CallType::Upload( + match UploadProtocol::from_str(name) { + Ok(up) => up, + Err(msg) => { + err.issues.push(CLIError::InvalidUploadProtocol(name.to_string(), valid_protocols)); + UploadProtocol::Simple + } + }) +} + +pub fn input_file_from_opts(file_path: &str, err: &mut InvalidOptionsError) -> Option { + match fs::File::open(file_path) { + Ok(f) => Some(f), + Err(io_err) => { + err.issues.push(CLIError::Input(InputError::Io((file_path.to_string(), io_err)))); + None + } + } +} + +pub fn input_mime_from_opts(mime: &str, err: &mut InvalidOptionsError) -> Option { + match mime.parse() { + Ok(m) => Some(m), + Err(_) => { + err.issues.push(CLIError::Input(InputError::Mime(mime.to_string()))); + None + } + } +} + +pub fn writer_from_opts(arg: Option<&str>) -> Result, io::Error> { + let f = arg.unwrap_or("-"); + match f { + "-" => Ok(Box::new(stdout())), + _ => match fs::OpenOptions::new().create(true).write(true).open(f) { + Ok(f) => Ok(Box::new(f)), + Err(io_err) => Err(io_err), + } + } +} + + +pub fn arg_from_str<'a, T>(arg: &str, err: &mut InvalidOptionsError, + arg_name: &'a str, + arg_type: &'a str) -> T + where T: FromStr + Default, + ::Err: fmt::Display { + match FromStr::from_str(arg) { + Err(perr) => { + err.issues.push( + CLIError::ParseError(arg_name.to_owned(), arg_type.to_owned(), arg.to_string(), format!("{}", perr)) + ); + Default::default() + }, + Ok(v) => v, + } +} + +pub struct JsonTokenStorage { + pub program_name: &'static str, + pub db_dir: String, +} + +impl JsonTokenStorage { + fn path(&self, scope_hash: u64) -> PathBuf { + Path::new(&self.db_dir).join(&format!("{}-token-{}.json", self.program_name, scope_hash)) + } +} + + +#[derive(Debug)] +pub enum TokenStorageError { + Json(json::Error), + Io(io::Error), +} + +impl fmt::Display for TokenStorageError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + TokenStorageError::Json(ref err) + => writeln!(f, "Could not serialize secrets: {}", err), + TokenStorageError::Io(ref err) + => writeln!(f, "Failed to write secret token: {}", err), + } + } +} + +impl StdError for TokenStorageError { + fn description(&self) -> &str { + "Failure when getting or setting the token storage" + } +} + + +impl TokenStorage for JsonTokenStorage { + type Error = TokenStorageError; + + // NOTE: logging might be interesting, currently we swallow all errors + fn set(&mut self, scope_hash: u64, _: &Vec<&str>, token: Option) -> Result<(), TokenStorageError> { + match token { + None => { + match fs::remove_file(self.path(scope_hash)) { + Err(err) => + match err.kind() { + io::ErrorKind::NotFound => Ok(()), + _ => Err(TokenStorageError::Io(err)) + }, + Ok(_) => Ok(()), + } + } + Some(token) => { + match fs::OpenOptions::new().create(true).write(true).open(&self.path(scope_hash)) { + Ok(mut f) => { + match json::to_writer_pretty(&mut f, &token) { + Ok(_) => Ok(()), + Err(serde_err) => Err(TokenStorageError::Json(serde_err)), + } + }, + Err(io_err) => Err(TokenStorageError::Io(io_err)) + } + } + } + } + + fn get(&self, scope_hash: u64, _: &Vec<&str>) -> Result, TokenStorageError> { + match fs::File::open(&self.path(scope_hash)) { + Ok(f) => { + match json::de::from_reader(f) { + Ok(token) => Ok(Some(token)), + Err(err) => Err(TokenStorageError::Json(err)), + } + }, + Err(io_err) => { + match io_err.kind() { + io::ErrorKind::NotFound => Ok(None), + _ => Err(TokenStorageError::Io(io_err)) + } + } + } + } +} + + +#[derive(Debug)] +pub enum ApplicationSecretError { + DecoderError((String, json::Error)), + FormatError(String), +} + +impl fmt::Display for ApplicationSecretError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + ApplicationSecretError::DecoderError((ref path, ref err)) + => writeln!(f, "Could not decode file at '{}' with error: {}.", + path, err), + ApplicationSecretError::FormatError(ref path) + => writeln!(f, "'installed' field is unset in secret file at '{}'.", + path), + } + } +} + +#[derive(Debug)] +pub enum ConfigurationError { + DirectoryCreationFailed((String, io::Error)), + DirectoryUnset, + HomeExpansionFailed(String), + Secret(ApplicationSecretError), + Io((String, io::Error)), +} + +impl fmt::Display for ConfigurationError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + ConfigurationError::DirectoryCreationFailed((ref dir, ref err)) + => writeln!(f, "Directory '{}' could not be created with error: {}.", dir, err), + ConfigurationError::DirectoryUnset + => writeln!(f, "--config-dir was unset or empty."), + ConfigurationError::HomeExpansionFailed(ref dir) + => writeln!(f, "Couldn't find HOME directory of current user, failed to expand '{}'.", dir), + ConfigurationError::Secret(ref err) + => writeln!(f, "Secret -> {}", err), + ConfigurationError::Io((ref path, ref err)) + => writeln!(f, "IO operation failed on path '{}' with error: {}.", path, err), + } + } +} + +#[derive(Debug)] +pub enum InputError { + Io((String, io::Error)), + Mime(String), +} + +impl fmt::Display for InputError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + InputError::Io((ref file_path, ref io_err)) + => writeln!(f, "Failed to open '{}' for reading with error: {}.", file_path, io_err), + InputError::Mime(ref mime) + => writeln!(f, "'{}' is not a known mime-type.", mime), + } + } +} + +#[derive(Debug)] +pub enum FieldError { + PopOnEmpty(String), + TrailingFieldSep(String), + Unknown(String, Option, Option), + Duplicate(String), + Empty, +} + + +impl fmt::Display for FieldError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + FieldError::PopOnEmpty(ref field) + => writeln!(f, "'{}': Cannot move up on empty field cursor.", field), + FieldError::TrailingFieldSep(ref field) + => writeln!(f, "'{}': Single field separator may not be last character.", field), + FieldError::Unknown(ref field, ref suggestion, ref value) => { + let suffix = + match *suggestion { + Some(ref s) => { + let kv = + match *value { + Some(ref v) => format!("{}={}", s, v), + None => s.clone(), + }; + format!(" Did you mean '{}' ?", kv) + }, + None => String::new(), + }; + writeln!(f, "Field '{}' does not exist.{}", field, suffix) + }, + FieldError::Duplicate(ref cursor) + => writeln!(f, "Value at '{}' was already set", cursor), + FieldError::Empty + => writeln!(f, "Field names must not be empty."), + } + } +} + + +#[derive(Debug)] +pub enum CLIError { + Configuration(ConfigurationError), + ParseError(String, String, String, String), + UnknownParameter(String, Vec<&'static str>), + InvalidUploadProtocol(String, Vec), + InvalidKeyValueSyntax(String, bool), + Input(InputError), + Field(FieldError), + MissingCommandError, + MissingMethodError(String), +} + +impl fmt::Display for CLIError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + match *self { + CLIError::Configuration(ref err) => write!(f, "Configuration -> {}", err), + CLIError::Input(ref err) => write!(f, "Input -> {}", err), + CLIError::Field(ref err) => write!(f, "Field -> {}", err), + CLIError::InvalidUploadProtocol(ref proto_name, ref valid_names) + => writeln!(f, "'{}' is not a valid upload protocol. Choose from one of {}.", proto_name, valid_names.join(", ")), + CLIError::ParseError(ref arg_name, ref type_name, ref value, ref err_desc) + => writeln!(f, "Failed to parse argument '{}' with value '{}' as {} with error: {}.", + arg_name, value, type_name, err_desc), + CLIError::UnknownParameter(ref param_name, ref possible_values) => { + let suffix = + match did_you_mean(param_name, &possible_values) { + Some(v) => format!(" Did you mean '{}' ?", v), + None => String::new(), + }; + write!(f, "Parameter '{}' is unknown.{}\n", param_name, suffix) + }, + CLIError::InvalidKeyValueSyntax(ref kv, is_hashmap) => { + let hashmap_info = if is_hashmap { "hashmap " } else { "" }; + writeln!(f, "'{}' does not match {}pattern =.", kv, hashmap_info) + }, + CLIError::MissingCommandError => writeln!(f, "Please specify the main sub-command."), + CLIError::MissingMethodError(ref cmd) => writeln!(f, "Please specify the method to call on the '{}' command.", cmd), + } + } +} + +#[derive(Debug)] +pub struct InvalidOptionsError { + pub issues: Vec, + pub exit_code: i32, +} + +impl fmt::Display for InvalidOptionsError { + fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { + for issue in &self.issues { + try!(issue.fmt(f)); + } + Ok(()) + } +} + +impl InvalidOptionsError { + pub fn single(err: CLIError, exit_code: i32) -> InvalidOptionsError { + InvalidOptionsError { + issues: vec![err], + exit_code: exit_code, + } + } + + pub fn new() -> InvalidOptionsError { + InvalidOptionsError { + issues: Vec::new(), + exit_code: 1, + } + } +} + +pub fn assure_config_dir_exists(dir: &str) -> Result { + let trdir = dir.trim(); + if trdir.len() == 0 { + return Err(CLIError::Configuration(ConfigurationError::DirectoryUnset)) + } + + let expanded_config_dir = + if trdir.as_bytes()[0] == b'~' { + match env::var("HOME").ok().or(env::var("UserProfile").ok()) { + None => return Err(CLIError::Configuration(ConfigurationError::HomeExpansionFailed(trdir.to_string()))), + Some(mut user) => { + user.push_str(&trdir[1..]); + user + } + } + } else { + trdir.to_string() + }; + + if let Err(err) = fs::create_dir(&expanded_config_dir) { + if err.kind() != io::ErrorKind::AlreadyExists { + return Err(CLIError::Configuration( + ConfigurationError::DirectoryCreationFailed((expanded_config_dir, err)))) + } + } + + Ok(expanded_config_dir) +} + +pub fn application_secret_from_directory(dir: &str, + secret_basename: &str, + json_console_secret: &str) + -> Result { + let secret_path = Path::new(dir).join(secret_basename); + let secret_str = || secret_path.as_path().to_str().unwrap().to_string(); + let secret_io_error = |io_err: io::Error| { + Err(CLIError::Configuration(ConfigurationError::Io( + (secret_str(), io_err) + ))) + }; + + for _ in 0..2 { + match fs::File::open(&secret_path) { + Err(mut err) => { + if err.kind() == io::ErrorKind::NotFound { + // Write our built-in one - user may adjust the written file at will + + err = match fs::OpenOptions::new().create(true).write(true).open(&secret_path) { + Err(cfe) => cfe, + Ok(mut f) => { + // Assure we convert 'ugly' json string into pretty one + let console_secret: ConsoleApplicationSecret + = json::from_str(json_console_secret).unwrap(); + match json::to_writer_pretty(&mut f, &console_secret) { + Err(serde_err) => panic!("Unexpected serde error: {:#?}", serde_err), + Ok(_) => continue, + } + } + }; + // fall through to IO error handling + } + return secret_io_error(err) + }, + Ok(f) => { + match json::de::from_reader::<_, ConsoleApplicationSecret>(f) { + Err(json_err) => + return Err(CLIError::Configuration( + ConfigurationError::Secret( + ApplicationSecretError::DecoderError( + (secret_str(), json_err) + )))), + Ok(console_secret) => + match console_secret.installed { + Some(secret) => return Ok(secret), + None => return Err( + CLIError::Configuration( + ConfigurationError::Secret( + ApplicationSecretError::FormatError(secret_str()) + ))) + }, + } + } + } + } + unreachable!(); +} diff --git a/gen/cloudkms1_beta1-cli/src/main.rs b/gen/cloudkms1_beta1-cli/src/main.rs new file mode 100644 index 0000000000..9b967a873e --- /dev/null +++ b/gen/cloudkms1_beta1-cli/src/main.rs @@ -0,0 +1,2789 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/cli/main.rs.mako' +// DO NOT EDIT ! +#![allow(unused_variables, unused_imports, dead_code, unused_mut)] + +#[macro_use] +extern crate clap; +extern crate yup_oauth2 as oauth2; +extern crate yup_hyper_mock as mock; +extern crate hyper_rustls; +extern crate serde; +extern crate serde_json; +extern crate hyper; +extern crate mime; +extern crate strsim; +extern crate google_cloudkms1_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::CloudKMS>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _projects_locations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "name"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::KeyRing = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "key-ring-id" => { + call = call.key_ring_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["key-ring-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rotation-period" => Some(("rotationPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.name" => Some(("primary.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.state" => Some(("primary.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.destroy-time" => Some(("primary.destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.destroy-event-time" => Some(("primary.destroyEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.create-time" => Some(("primary.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "purpose" => Some(("purpose", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "next-rotation-time" => Some(("nextRotationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destroy-event-time", "destroy-time", "name", "next-rotation-time", "primary", "purpose", "rotation-period", "state"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CryptoKey = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "crypto-key-id" => { + call = call.crypto_key_id(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["crypto-key-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destroy-time" => Some(("destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destroy-event-time" => Some(("destroyEventTime", 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", "destroy-event-time", "destroy-time", "name", "state"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CryptoKeyVersion = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_create(request, opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_destroy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::DestroyCryptoKeyVersionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_destroy(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destroy-time" => Some(("destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "destroy-event-time" => Some(("destroyEventTime", 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", "destroy-event-time", "destroy-time", "name", "state"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CryptoKeyVersion = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_crypto_key_versions_restore(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec![]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::RestoreCryptoKeyVersionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_restore(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_decrypt(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "ciphertext" => Some(("ciphertext", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "additional-authenticated-data" => Some(("additionalAuthenticatedData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-authenticated-data", "ciphertext"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::DecryptRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_decrypt(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_encrypt(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "plaintext" => Some(("plaintext", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "additional-authenticated-data" => Some(("additionalAuthenticatedData", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-authenticated-data", "plaintext"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::EncryptRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_encrypt(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_crypto_keys_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_crypto_keys_get_iam_policy(opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_crypto_keys_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_patch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "rotation-period" => Some(("rotationPeriod", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.name" => Some(("primary.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.state" => Some(("primary.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.destroy-time" => Some(("primary.destroyTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.destroy-event-time" => Some(("primary.destroyEventTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary.create-time" => Some(("primary.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "purpose" => Some(("purpose", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "next-rotation-time" => Some(("nextRotationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "destroy-event-time", "destroy-time", "name", "next-rotation-time", "primary", "purpose", "rotation-period", "state"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CryptoKey = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_patch(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["update-mask"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.iam-owned" => Some(("policy.iamOwned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "iam-owned", "policy", "update-mask", "version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TestIamPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_crypto_keys_update_primary_version(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "crypto-key-version-id" => Some(("cryptoKeyVersionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["crypto-key-version-id"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UpdateCryptoKeyPrimaryVersionRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_crypto_keys_update_primary_version(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_get(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_get_iam_policy(opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_key_rings_list(opt.value_of("parent").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.iam-owned" => Some(("policy.iamOwned", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "iam-owned", "policy", "update-mask", "version"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SetIamPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_set_iam_policy(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_key_rings_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "permissions" => Some(("permissions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["permissions"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TestIamPermissionsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().locations_key_rings_test_iam_permissions(request, opt.value_of("resource").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_locations_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().locations_list(opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["filter", "page-token", "page-size"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _doit(&self, dry_run: bool) -> Result, Option> { + let mut err = InvalidOptionsError::new(); + let mut call_result: Result<(), DoitError> = Ok(()); + let mut err_opt: Option = None; + match self.opt.subcommand() { + ("projects", Some(opt)) => { + match opt.subcommand() { + ("locations-get", Some(opt)) => { + call_result = self._projects_locations_get(opt, dry_run, &mut err); + }, + ("locations-key-rings-create", Some(opt)) => { + call_result = self._projects_locations_key_rings_create(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-create", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_create(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-create", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_create(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-destroy", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_destroy(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-get", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_get(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-list", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_list(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-patch", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_patch(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-crypto-key-versions-restore", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_crypto_key_versions_restore(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-decrypt", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_decrypt(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-encrypt", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_encrypt(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-get", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_get(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-get-iam-policy", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_get_iam_policy(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-list", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_list(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-patch", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_patch(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-set-iam-policy", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_set_iam_policy(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-test-iam-permissions", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_test_iam_permissions(opt, dry_run, &mut err); + }, + ("locations-key-rings-crypto-keys-update-primary-version", Some(opt)) => { + call_result = self._projects_locations_key_rings_crypto_keys_update_primary_version(opt, dry_run, &mut err); + }, + ("locations-key-rings-get", Some(opt)) => { + call_result = self._projects_locations_key_rings_get(opt, dry_run, &mut err); + }, + ("locations-key-rings-get-iam-policy", Some(opt)) => { + call_result = self._projects_locations_key_rings_get_iam_policy(opt, dry_run, &mut err); + }, + ("locations-key-rings-list", Some(opt)) => { + call_result = self._projects_locations_key_rings_list(opt, dry_run, &mut err); + }, + ("locations-key-rings-set-iam-policy", Some(opt)) => { + call_result = self._projects_locations_key_rings_set_iam_policy(opt, dry_run, &mut err); + }, + ("locations-key-rings-test-iam-permissions", Some(opt)) => { + call_result = self._projects_locations_key_rings_test_iam_permissions(opt, dry_run, &mut err); + }, + ("locations-list", Some(opt)) => { + call_result = self._projects_locations_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("projects".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + _ => { + err.issues.push(CLIError::MissingCommandError); + writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); + } + } + + if dry_run { + if err.issues.len() > 0 { + err_opt = Some(err); + } + Err(err_opt) + } else { + Ok(call_result) + } + } + + // Please note that this call will fail if any part of the opt can't be handled + fn new(opt: ArgMatches<'n>) -> Result, InvalidOptionsError> { + let (config_dir, secret) = { + let config_dir = match cmn::assure_config_dir_exists(opt.value_of("folder").unwrap_or("~/.google-service-cli")) { + Err(e) => return Err(InvalidOptionsError::single(e, 3)), + Ok(p) => p, + }; + + match cmn::application_secret_from_directory(&config_dir, "cloudkms1-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: "cloudkms1-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::CloudKMS::new(client, auth), + gp: vec!["$-xgafv", "access-token", "alt", "bearer-token", "callback", "fields", "key", "oauth-token", "pp", "pretty-print", "quota-user", "upload-type", "upload-protocol"], + gpm: vec![ + ("$-xgafv", "$.xgafv"), + ("access-token", "access_token"), + ("bearer-token", "bearer_token"), + ("oauth-token", "oauth_token"), + ("pretty-print", "prettyPrint"), + ("quota-user", "quotaUser"), + ("upload-type", "uploadType"), + ("upload-protocol", "upload_protocol"), + ] + }; + + match engine._doit(true) { + Err(Some(err)) => Err(err), + Err(None) => Ok(engine), + Ok(_) => unreachable!(), + } + } + + fn doit(&self) -> Result<(), DoitError> { + match self._doit(false) { + Ok(res) => res, + Err(_) => unreachable!(), + } + } +} + +fn main() { + let mut exit_status = 0i32; + let arg_data = [ + ("projects", "methods: 'locations-get', 'locations-key-rings-create', 'locations-key-rings-crypto-keys-create', 'locations-key-rings-crypto-keys-crypto-key-versions-create', 'locations-key-rings-crypto-keys-crypto-key-versions-destroy', 'locations-key-rings-crypto-keys-crypto-key-versions-get', 'locations-key-rings-crypto-keys-crypto-key-versions-list', 'locations-key-rings-crypto-keys-crypto-key-versions-patch', 'locations-key-rings-crypto-keys-crypto-key-versions-restore', 'locations-key-rings-crypto-keys-decrypt', 'locations-key-rings-crypto-keys-encrypt', 'locations-key-rings-crypto-keys-get', 'locations-key-rings-crypto-keys-get-iam-policy', 'locations-key-rings-crypto-keys-list', 'locations-key-rings-crypto-keys-patch', 'locations-key-rings-crypto-keys-set-iam-policy', 'locations-key-rings-crypto-keys-test-iam-permissions', 'locations-key-rings-crypto-keys-update-primary-version', 'locations-key-rings-get', 'locations-key-rings-get-iam-policy', 'locations-key-rings-list', 'locations-key-rings-set-iam-policy', 'locations-key-rings-test-iam-permissions' and 'locations-list'", vec![ + ("locations-get", + Some(r##"Get information about a location."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"Resource name for the location."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-create", + Some(r##"Create a new KeyRing in a given Project and Location."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The resource name of the location associated with the + KeyRings, in the format `projects/*/locations/*`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-create", + Some(r##"Create a new CryptoKey within a KeyRing. + + CryptoKey.purpose is required."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the KeyRing associated with the + CryptoKeys."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-create", + Some(r##"Create a new CryptoKeyVersion in a CryptoKey. + + The server will assign the next sequential id. If unset, + state will be set to + ENABLED."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-create", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The name of the CryptoKey associated with + the CryptoKeyVersions."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-destroy", + Some(r##"Schedule a CryptoKeyVersion for destruction. + + Upon calling this method, CryptoKeyVersion.state will be set to + DESTROY_SCHEDULED + and destroy_time will be set to a time 24 + hours in the future, at which point the state + will be changed to + DESTROYED, and the key + material will be irrevocably destroyed. + + Before the destroy_time is reached, + RestoreCryptoKeyVersion may be called to reverse the process."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-destroy", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the CryptoKeyVersion to destroy."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-get", + Some(r##"Returns metadata for a given CryptoKeyVersion."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the CryptoKeyVersion to get."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-list", + Some(r##"Lists CryptoKeyVersions."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The resource name of the CryptoKey to list, in the format + `projects/*/locations/*/keyRings/*/cryptoKeys/*`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-patch", + Some(r##"Update a CryptoKeyVersion's metadata. + + state may be changed between + ENABLED and + DISABLED using this + method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to + move between other states."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Output only. The resource name for this CryptoKeyVersion in the format + `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-crypto-key-versions-restore", + Some(r##"Restore a CryptoKeyVersion in the + DESTROY_SCHEDULED, + state. + + Upon restoration of the CryptoKeyVersion, state + will be set to DISABLED, + and destroy_time will be cleared."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-crypto-key-versions-restore", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the CryptoKeyVersion to restore."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-decrypt", + Some(r##"Decrypt data that was protected by Encrypt."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-decrypt", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the CryptoKey to use for decryption. + The server will choose the appropriate version."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-encrypt", + Some(r##"Encrypt data, so that it can only be recovered by a call to Decrypt."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-encrypt", + vec![ + (Some(r##"name"##), + None, + Some(r##"Required. The resource name of the CryptoKey or CryptoKeyVersion + to use for encryption. + + If a CryptoKey is specified, the server will use its + primary version."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-get", + Some(r##"Returns metadata for a given CryptoKey, as well as its + primary CryptoKeyVersion."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the CryptoKey to get."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-get-iam-policy", + Some(r##"Gets the access control policy for a resource. + Returns an empty policy if the resource exists and does not have a policy + set."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-list", + Some(r##"Lists CryptoKeys."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The resource name of the KeyRing to list, in the format + `projects/*/locations/*/keyRings/*`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-patch", + Some(r##"Update a CryptoKey."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-patch", + vec![ + (Some(r##"name"##), + None, + Some(r##"Output only. The resource name for this CryptoKey in the format + `projects/*/locations/*/keyRings/*/cryptoKeys/*`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-set-iam-policy", + Some(r##"Sets the access control policy on the specified resource. Replaces any + existing policy."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-crypto-keys-update-primary-version", + Some(r##"Update the version of a CryptoKey that will be used in Encrypt"##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-crypto-keys-update-primary-version", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource name of the CryptoKey to update."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-get", + Some(r##"Returns metadata for a given KeyRing."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-get", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name of the KeyRing to get."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-get-iam-policy", + Some(r##"Gets the access control policy for a resource. + Returns an empty policy if the resource exists and does not have a policy + set."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-get-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being requested. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-list", + Some(r##"Lists KeyRings."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-list", + vec![ + (Some(r##"parent"##), + None, + Some(r##"Required. The resource name of the location associated with the + KeyRings, in the format `projects/*/locations/*`."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-set-iam-policy", + Some(r##"Sets the access control policy on the specified resource. Replaces any + existing policy."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-set-iam-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy is being specified. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-key-rings-test-iam-permissions", + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-key-rings-test-iam-permissions", + vec![ + (Some(r##"resource"##), + None, + Some(r##"REQUIRED: The resource for which the policy detail is being requested. + See the operation documentation for the appropriate value for this field."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("locations-list", + Some(r##"Lists information about the supported locations for this service."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudkms1_beta1_cli/projects_locations-list", + vec![ + (Some(r##"name"##), + None, + Some(r##"The resource that owns the locations collection, if applicable."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ]; + + let mut app = App::new("cloudkms1-beta1") + .author("Sebastian Thiel ") + .version("1.0.4+20170515") + .about("Manages encryption for your cloud services the same way you do on-premise. 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_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/cloudkms1_beta1/Cargo.toml b/gen/cloudkms1_beta1/Cargo.toml new file mode 100644 index 0000000000..fe7fc2f741 --- /dev/null +++ b/gen/cloudkms1_beta1/Cargo.toml @@ -0,0 +1,28 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-cloudkms1_beta1" +version = "1.0.4+20170515" +authors = ["Sebastian Thiel "] +description = "A complete library to interact with Cloud KMS (protocol v1beta1)" +repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1_beta1" +homepage = "https://cloud.google.com/kms/" +documentation = "https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515" +license = "MIT" +keywords = ["cloudkms", "google", "protocol", "web", "api"] + + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 0.9" +serde_json = "^ 0.9" +serde_derive = "^ 0.9" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/cloudkms1_beta1/LICENSE.md b/gen/cloudkms1_beta1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/cloudkms1_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/cloudkms1_beta1/README.md b/gen/cloudkms1_beta1/README.md new file mode 100644 index 0000000000..ca4b2f2f47 --- /dev/null +++ b/gen/cloudkms1_beta1/README.md @@ -0,0 +1,184 @@ + +The `google-cloudkms1_beta1` library allows access to all features of the *Google Cloud KMS* service. + +This documentation was generated from *Cloud KMS* crate version *1.0.4+20170515*, where *20170515* is the exact revision of the *cloudkms:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. + +Everything else about the *Cloud KMS* *v1_beta1* 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_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.CloudKMS.html) ... + +* projects + * [*locations get*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationGetCall.html), [*locations key rings create*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCreateCall.html), [*locations key rings crypto keys create*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCreateCall.html), [*locations key rings crypto keys crypto key versions create*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html), [*locations key rings crypto keys crypto key versions destroy*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html), [*locations key rings crypto keys crypto key versions get*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html), [*locations key rings crypto keys crypto key versions list*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html), [*locations key rings crypto keys crypto key versions patch*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html), [*locations key rings crypto keys crypto key versions restore*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html), [*locations key rings crypto keys decrypt*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html), [*locations key rings crypto keys encrypt*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html), [*locations key rings crypto keys get*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyGetCall.html), [*locations key rings crypto keys get iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html), [*locations key rings crypto keys list*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyListCall.html), [*locations key rings crypto keys patch*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyPatchCall.html), [*locations key rings crypto keys set iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html), [*locations key rings crypto keys test iam permissions*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html), [*locations key rings crypto keys update primary version*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html), [*locations key rings get*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingGetCall.html), [*locations key rings get iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingGetIamPolicyCall.html), [*locations key rings list*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingListCall.html), [*locations key rings set iam policy*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingSetIamPolicyCall.html), [*locations key rings test iam permissions*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationKeyRingTestIamPermissionCall.html) and [*locations list*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.ProjectLocationListCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/struct.CloudKMS.html)** + * a central object to maintain state and allow accessing all *Activities* + * creates [*Method Builders*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/trait.Resource.html)** + * primary types that you can apply *Activities* to + * a collection of properties and *Parts* + * **[Parts](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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().locations_key_rings_crypto_keys_crypto_key_versions_destroy(...).doit() +let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_get(...).doit() +let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_patch(...).doit() +let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_restore(...).doit() +let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_create(...).doit() +``` + +The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` +supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be +specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired. +The `doit()` method performs the actual communication with the server and returns the respective result. + +# Usage + +## Setting up your Project + +To use this library, you would put the following lines into your `Cargo.toml` file: + +```toml +[dependencies] +google-cloudkms1_beta1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate yup_oauth2 as oauth2; +extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +use cloudkms1_beta1::CryptoKeyVersion; +use cloudkms1_beta1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use cloudkms1_beta1::CloudKMS; + +// Get an ApplicationSecret instance by some means. It contains the `client_id` and +// `client_secret`, among other things. +let secret: ApplicationSecret = Default::default(); +// Instantiate the authenticator. It will choose a suitable authentication flow for you, +// unless you replace `None` with the desired Flow. +// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +// retrieve them from storage. +let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, + hyper::Client::new(), + ::default(), None); +let mut hub = CloudKMS::new(hyper::Client::new(), auth); +// As the method needs a request, you would usually fill it with the desired information +// into the respective structure. Some of the parts shown here might not be applicable ! +// Values shown here are possibly random and not representative ! +let mut req = CryptoKeyVersion::default(); + +// You can configure optional parameters by calling the respective setters at will, and +// execute the final call using `doit()`. +// Values shown here are possibly random and not representative ! +let result = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_patch(req, "name") + .update_mask("sit") + .doit(); + +match result { + Err(e) => match e { + // The Error enum provides details about what exactly happened. + // You can also just use its `Debug`, `Display` or `Error` traits + Error::HttpError(_) + |Error::MissingAPIKey + |Error::MissingToken(_) + |Error::Cancelled + |Error::UploadSizeLimitExceeded(_, _) + |Error::Failure(_) + |Error::BadRequest(_) + |Error::FieldClash(_) + |Error::JsonDecodeError(_, _) => println!("{}", e), + }, + Ok(res) => println!("Success: {:?}", res), +} + +``` +## Handling Errors + +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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-cloudkms1_beta1/1.0.4+20170515/google_cloudkms1_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 **cloudkms1_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/cloudkms1_beta1/src/cmn.rs b/gen/cloudkms1_beta1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/cloudkms1_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/cloudkms1_beta1/src/lib.rs b/gen/cloudkms1_beta1/src/lib.rs new file mode 100644 index 0000000000..e8a5fa2834 --- /dev/null +++ b/gen/cloudkms1_beta1/src/lib.rs @@ -0,0 +1,8276 @@ +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +//! This documentation was generated from *Cloud KMS* crate version *1.0.4+20170515*, where *20170515* is the exact revision of the *cloudkms:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! +//! Everything else about the *Cloud KMS* *v1_beta1* API can be found at the +//! [official documentation site](https://cloud.google.com/kms/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudkms1_beta1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.CloudKMS.html) ... +//! +//! * projects +//! * [*locations get*](struct.ProjectLocationGetCall.html), [*locations key rings create*](struct.ProjectLocationKeyRingCreateCall.html), [*locations key rings crypto keys create*](struct.ProjectLocationKeyRingCryptoKeyCreateCall.html), [*locations key rings crypto keys crypto key versions create*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html), [*locations key rings crypto keys crypto key versions destroy*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html), [*locations key rings crypto keys crypto key versions get*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html), [*locations key rings crypto keys crypto key versions list*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html), [*locations key rings crypto keys crypto key versions patch*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html), [*locations key rings crypto keys crypto key versions restore*](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html), [*locations key rings crypto keys decrypt*](struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html), [*locations key rings crypto keys encrypt*](struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html), [*locations key rings crypto keys get*](struct.ProjectLocationKeyRingCryptoKeyGetCall.html), [*locations key rings crypto keys get iam policy*](struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html), [*locations key rings crypto keys list*](struct.ProjectLocationKeyRingCryptoKeyListCall.html), [*locations key rings crypto keys patch*](struct.ProjectLocationKeyRingCryptoKeyPatchCall.html), [*locations key rings crypto keys set iam policy*](struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html), [*locations key rings crypto keys test iam permissions*](struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html), [*locations key rings crypto keys update primary version*](struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html), [*locations key rings get*](struct.ProjectLocationKeyRingGetCall.html), [*locations key rings get iam policy*](struct.ProjectLocationKeyRingGetIamPolicyCall.html), [*locations key rings list*](struct.ProjectLocationKeyRingListCall.html), [*locations key rings set iam policy*](struct.ProjectLocationKeyRingSetIamPolicyCall.html), [*locations key rings test iam permissions*](struct.ProjectLocationKeyRingTestIamPermissionCall.html) and [*locations list*](struct.ProjectLocationListCall.html) +//! +//! +//! +//! +//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs). +//! +//! # Structure of this Library +//! +//! The API is structured into the following primary items: +//! +//! * **[Hub](struct.CloudKMS.html)** +//! * a central object to maintain state and allow accessing all *Activities* +//! * creates [*Method Builders*](trait.MethodsBuilder.html) which in turn +//! allow access to individual [*Call Builders*](trait.CallBuilder.html) +//! * **[Resources](trait.Resource.html)** +//! * primary types that you can apply *Activities* to +//! * a collection of properties and *Parts* +//! * **[Parts](trait.Part.html)** +//! * a collection of properties +//! * never directly used in *Activities* +//! * **[Activities](trait.CallBuilder.html)** +//! * operations to apply to *Resources* +//! +//! All *structures* are marked with applicable traits to further categorize them and ease browsing. +//! +//! Generally speaking, you can invoke *Activities* like this: +//! +//! ```Rust,ignore +//! let r = hub.resource().activity(...).doit() +//! ``` +//! +//! Or specifically ... +//! +//! ```ignore +//! let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_destroy(...).doit() +//! let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_get(...).doit() +//! let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_patch(...).doit() +//! let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_restore(...).doit() +//! let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_create(...).doit() +//! ``` +//! +//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` +//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be +//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired. +//! The `doit()` method performs the actual communication with the server and returns the respective result. +//! +//! # Usage +//! +//! ## Setting up your Project +//! +//! To use this library, you would put the following lines into your `Cargo.toml` file: +//! +//! ```toml +//! [dependencies] +//! google-cloudkms1_beta1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +//! use cloudkms1_beta1::CryptoKeyVersion; +//! use cloudkms1_beta1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use cloudkms1_beta1::CloudKMS; +//! +//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and +//! // `client_secret`, among other things. +//! let secret: ApplicationSecret = Default::default(); +//! // Instantiate the authenticator. It will choose a suitable authentication flow for you, +//! // unless you replace `None` with the desired Flow. +//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +//! // retrieve them from storage. +//! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +//! hyper::Client::new(), +//! ::default(), None); +//! let mut hub = CloudKMS::new(hyper::Client::new(), auth); +//! // As the method needs a request, you would usually fill it with the desired information +//! // into the respective structure. Some of the parts shown here might not be applicable ! +//! // Values shown here are possibly random and not representative ! +//! let mut req = CryptoKeyVersion::default(); +//! +//! // You can configure optional parameters by calling the respective setters at will, and +//! // execute the final call using `doit()`. +//! // Values shown here are possibly random and not representative ! +//! let result = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_patch(req, "name") +//! .update_mask("sed") +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } +//! # } +//! ``` +//! ## Handling Errors +//! +//! All errors produced by the system are provided either as [Result](enum.Result.html) enumeration as return value of +//! the doit() methods, or handed as possibly intermediate results to either the +//! [Hub Delegate](trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +//! +//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This +//! makes the system potentially resilient to all kinds of errors. +//! +//! ## Uploads and Downloads +//! If a method supports downloads, the response body, which is part of the [Result](enum.Result.html), should be +//! read by you to obtain the media. +//! If such a method also supports a [Response Result](trait.ResponseResult.html), it will return that by default. +//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making +//! this call: `.param("alt", "media")`. +//! +//! Methods supporting uploads can do so using up to 2 different protocols: +//! *simple* and *resumable*. The distinctiveness of each is represented by customized +//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively. +//! +//! ## Customization and Callbacks +//! +//! You may alter the way an `doit()` method is called by providing a [delegate](trait.Delegate.html) to the +//! [Method Builder](trait.CallBuilder.html) before making the final `doit()` call. +//! Respective methods will be called to provide progress information, as well as determine whether the system should +//! retry on failure. +//! +//! The [delegate trait](trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +//! +//! ## Optional Parts in Server-Requests +//! +//! All structures provided by this library are made to be [enocodable](trait.RequestValue.html) and +//! [decodable](trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +//! are valid. +//! Most optionals are are considered [Parts](trait.Part.html) which are identifiable by name, which will be sent to +//! the server to indicate either the set parts of the request or the desired parts in the response. +//! +//! ## Builder Arguments +//! +//! Using [method builders](trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +//! These will always take a single argument, for which the following statements are true. +//! +//! * [PODs][wiki-pod] are handed by copy +//! * strings are passed as `&str` +//! * [request values](trait.RequestValue.html) are moved +//! +//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times. +//! +//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure +//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern +//! [google-go-api]: https://github.com/google/google-api-go-client +//! +//! + +// Unused attributes happen thanks to defined, but unused structures +// We don't warn about this, as depending on the API, some data structures or facilities are never used. +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// unused imports in fully featured APIs. Same with unused_mut ... . +#![allow(unused_imports, unused_mut, dead_code)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +extern crate yup_oauth2 as oauth2; +extern crate mime; +extern crate url; + +mod cmn; + +use std::collections::HashMap; +use std::cell::RefCell; +use std::borrow::BorrowMut; +use std::default::Default; +use std::collections::BTreeMap; +use serde_json as json; +use std::io; +use std::fs; +use std::thread::sleep; +use std::time::Duration; + +pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part, + ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder, + Resource, ErrorResponse, remove_json_null_values}; + + +// ############## +// UTILITIES ### +// ############ + +/// Identifies the an OAuth2 authorization scope. +/// A scope is needed when requesting an +/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). +#[derive(PartialEq, Eq, Hash)] +pub enum Scope { + /// View and manage your data across Google Cloud Platform services + CloudPlatform, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::CloudPlatform + } +} + + + +// ######## +// HUB ### +// ###### + +/// Central instance to access all CloudKMS related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::CryptoKeyVersion; +/// use cloudkms1_beta1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudkms1_beta1::CloudKMS; +/// +/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and +/// // `client_secret`, among other things. +/// let secret: ApplicationSecret = Default::default(); +/// // Instantiate the authenticator. It will choose a suitable authentication flow for you, +/// // unless you replace `None` with the desired Flow. +/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +/// // retrieve them from storage. +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CryptoKeyVersion::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_patch(req, "name") +/// .update_mask("dolores") +/// .doit(); +/// +/// match result { +/// Err(e) => match e { +/// // The Error enum provides details about what exactly happened. +/// // You can also just use its `Debug`, `Display` or `Error` traits +/// Error::HttpError(_) +/// |Error::MissingAPIKey +/// |Error::MissingToken(_) +/// |Error::Cancelled +/// |Error::UploadSizeLimitExceeded(_, _) +/// |Error::Failure(_) +/// |Error::BadRequest(_) +/// |Error::FieldClash(_) +/// |Error::JsonDecodeError(_, _) => println!("{}", e), +/// }, +/// Ok(res) => println!("Success: {:?}", res), +/// } +/// # } +/// ``` +pub struct CloudKMS { + client: RefCell, + auth: RefCell, + _user_agent: String, +} + +impl<'a, C, A> Hub for CloudKMS {} + +impl<'a, C, A> CloudKMS + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> CloudKMS { + CloudKMS { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.4".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.4`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + let prev = self._user_agent.clone(); + self._user_agent = agent_name; + prev + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Response message for KeyManagementService.ListCryptoKeys. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys list projects](struct.ProjectLocationKeyRingCryptoKeyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListCryptoKeysResponse { + /// A token to retrieve next page of results. Pass this value in + /// ListCryptoKeysRequest.page_token to retrieve the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The 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 {} + + +/// Provides the configuration for logging a type of permissions. +/// Example: +/// +/// { +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:foo@gmail.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// } +/// ] +/// } +/// +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +/// foo@gmail.com from DATA_READ logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// Follows the same format of Binding.members. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, +} + +impl Part for AuditLogConfig {} + + +/// Request message for KeyManagementService.Encrypt. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys encrypt projects](struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EncryptRequest { + /// Required. The data to encrypt. Must be no larger than 64KiB. + pub plaintext: Option, + /// Optional data that, if specified, must also be provided during decryption + /// through DecryptRequest.additional_authenticated_data. Must be no + /// larger than 64KiB. + #[serde(rename="additionalAuthenticatedData")] + pub additional_authenticated_data: Option, +} + +impl RequestValue for EncryptRequest {} + + +/// Request message for `TestIamPermissions` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings test iam permissions projects](struct.ProjectLocationKeyRingTestIamPermissionCall.html) (request) +/// * [locations key rings crypto keys test iam permissions projects](struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsRequest { + /// The set of permissions to check for the `resource`. Permissions with + /// wildcards (such as '*' or 'storage.*') are not allowed. For more + /// information see + /// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + pub permissions: Option>, +} + +impl RequestValue for TestIamPermissionsRequest {} + + +/// Request message for `SetIamPolicy` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys set iam policy projects](struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html) (request) +/// * [locations key rings set iam policy projects](struct.ProjectLocationKeyRingSetIamPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetIamPolicyRequest { + /// REQUIRED: The complete policy to be applied to the `resource`. The size of + /// the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. + pub policy: Option, + /// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + /// the fields in the mask will be modified. If no mask is provided, the + /// following default mask is used: + /// paths: "bindings, etag" + /// This field is only used by Cloud IAM. + #[serde(rename="updateMask")] + pub update_mask: Option, +} + +impl RequestValue for SetIamPolicyRequest {} + + +/// A KeyRing is a toplevel logical grouping of CryptoKeys. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings create projects](struct.ProjectLocationKeyRingCreateCall.html) (request|response) +/// * [locations key rings get projects](struct.ProjectLocationKeyRingGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct KeyRing { + /// Output only. The time at which this KeyRing was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Output only. The resource name for the KeyRing in the format + /// `projects/*/locations/*/keyRings/*`. + pub name: Option, +} + +impl RequestValue for KeyRing {} +impl ResponseResult for KeyRing {} + + +/// A CryptoKeyVersion represents an individual cryptographic key, and the +/// associated key material. +/// +/// It can be used for cryptographic operations either directly, or via its +/// parent CryptoKey, in which case the server will choose the appropriate +/// version for the operation. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys crypto key versions destroy projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html) (response) +/// * [locations key rings crypto keys crypto key versions get projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall.html) (response) +/// * [locations key rings crypto keys crypto key versions patch projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall.html) (request|response) +/// * [locations key rings crypto keys crypto key versions restore projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html) (response) +/// * [locations key rings crypto keys crypto key versions create projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CryptoKeyVersion { + /// The current state of the CryptoKeyVersion. + pub state: Option, + /// Output only. The time this CryptoKeyVersion's key material is scheduled + /// for destruction. Only present if state is + /// DESTROY_SCHEDULED. + #[serde(rename="destroyTime")] + pub destroy_time: Option, + /// Output only. The time at which this CryptoKeyVersion was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// Output only. The time this CryptoKeyVersion's key material was + /// destroyed. Only present if state is + /// DESTROYED. + #[serde(rename="destroyEventTime")] + pub destroy_event_time: Option, + /// Output only. The resource name for this CryptoKeyVersion in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + pub name: Option, +} + +impl RequestValue for CryptoKeyVersion {} +impl ResponseResult for CryptoKeyVersion {} + + +/// A rule to be applied in a Policy. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Rule { + /// If one or more 'not_in' clauses are specified, the rule matches + /// if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. + /// The format for in and not_in entries is the same as for members in a + /// Binding (see google/iam/v1/policy.proto). + #[serde(rename="notIn")] + pub not_in: Option>, + /// Human-readable description of the rule. + pub description: Option, + /// If one or more 'in' clauses are specified, the rule matches if + /// the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries. + #[serde(rename="in")] + pub in_: Option>, + /// Required + pub action: Option, + /// Additional restrictions that must be met + pub conditions: Option>, + /// The config returned to callers of tech.iam.IAM.CheckPolicy for any entries + /// that match the LOG action. + #[serde(rename="logConfig")] + pub log_config: Option>, + /// A permission is a string of form '..' + /// (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, + /// and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs. + pub permissions: Option>, +} + +impl Part for Rule {} + + +/// Response message for KeyManagementService.ListKeyRings. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings list projects](struct.ProjectLocationKeyRingListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListKeyRingsResponse { + /// A token to retrieve next page of results. Pass this value in + /// ListKeyRingsRequest.page_token to retrieve the next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of KeyRings that matched the query. + #[serde(rename="totalSize")] + pub total_size: Option, + /// The list of KeyRings. + #[serde(rename="keyRings")] + pub key_rings: Option>, +} + +impl ResponseResult for ListKeyRingsResponse {} + + +/// The response message for Locations.ListLocations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations list projects](struct.ProjectLocationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListLocationsResponse { + /// The standard List next-page token. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// A list of locations that matches the specified filter in the request. + pub locations: Option>, +} + +impl ResponseResult for ListLocationsResponse {} + + +/// A resource that represents Google Cloud Platform location. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations get projects](struct.ProjectLocationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Location { + /// Cross-service attributes for the location. For example + /// + /// {"cloud.googleapis.com/region": "us-east1"} + pub labels: Option>, + /// The canonical id for this location. For example: `"us-east1"`. + #[serde(rename="locationId")] + pub location_id: Option, + /// Resource name for the location, which may vary between implementations. + /// For example: `"projects/example-project/locations/us-east1"` + pub name: Option, + /// Service-specific metadata. For example the available capacity at the given + /// location. + pub metadata: Option>, +} + +impl ResponseResult for Location {} + + +/// Defines an Identity and Access Management (IAM) policy. It is used to +/// specify access control policies for Cloud Platform resources. +/// +/// +/// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of +/// `members` to a `role`, where the members can be user accounts, Google groups, +/// Google domains, and service accounts. A `role` is a named list of permissions +/// defined by IAM. +/// +/// **Example** +/// +/// { +/// "bindings": [ +/// { +/// "role": "roles/owner", +/// "members": [ +/// "user:mike@example.com", +/// "group:admins@example.com", +/// "domain:google.com", +/// "serviceAccount:my-other-app@appspot.gserviceaccount.com", +/// ] +/// }, +/// { +/// "role": "roles/viewer", +/// "members": ["user:sean@example.com"] +/// } +/// ] +/// } +/// +/// For a description of IAM and its features, see the +/// [IAM developer's guide](https://cloud.google.com/iam). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys get iam policy projects](struct.ProjectLocationKeyRingCryptoKeyGetIamPolicyCall.html) (response) +/// * [locations key rings get iam policy projects](struct.ProjectLocationKeyRingGetIamPolicyCall.html) (response) +/// * [locations key rings crypto keys set iam policy projects](struct.ProjectLocationKeyRingCryptoKeySetIamPolicyCall.html) (response) +/// * [locations key rings set iam policy projects](struct.ProjectLocationKeyRingSetIamPolicyCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Policy { + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, + /// Version of the `Policy`. The default version is 0. + pub version: Option, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// If no `etag` is provided in the call to `setIamPolicy`, then the existing + /// policy is overwritten blindly. + pub etag: Option, + /// If more than one rule is specified, the rules are applied in the following + /// manner: + /// - All matching LOG rules are always applied. + /// - If any DENY/DENY_WITH_LOG rule matches, permission is denied. + /// Logging will be applied if one or more matching rule requires logging. + /// - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is + /// granted. + /// Logging will be applied if one or more matching rule requires logging. + /// - Otherwise, if no rule applies, permission is denied. + pub rules: Option>, + /// Associates a list of `members` to a `role`. + /// Multiple `bindings` must not be specified for the same `role`. + /// `bindings` with no members will result in an error. + pub bindings: Option>, + /// no description provided + #[serde(rename="iamOwned")] + pub iam_owned: Option, +} + +impl ResponseResult for Policy {} + + +/// Response message for KeyManagementService.Decrypt. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys decrypt projects](struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DecryptResponse { + /// The decrypted data originally supplied in EncryptRequest.plaintext. + pub plaintext: Option, +} + +impl ResponseResult for DecryptResponse {} + + +/// Response message for KeyManagementService.ListCryptoKeyVersions. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys crypto key versions list projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListCryptoKeyVersionsResponse { + /// A token to retrieve next page of results. Pass this value in + /// ListCryptoKeyVersionsRequest.page_token to retrieve the next page of + /// results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The total number of CryptoKeyVersions that matched the + /// query. + #[serde(rename="totalSize")] + pub total_size: Option, + /// The list of CryptoKeyVersions. + #[serde(rename="cryptoKeyVersions")] + pub crypto_key_versions: Option>, +} + +impl ResponseResult for ListCryptoKeyVersionsResponse {} + + +/// Options for counters +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CounterOptions { + /// The field value to attribute. + pub field: Option, + /// The metric to update. + pub metric: Option, +} + +impl Part for CounterOptions {} + + +/// A CryptoKey represents a logical key that can be used for cryptographic +/// operations. +/// +/// A CryptoKey is made up of one or more versions, which +/// represent the actual key material used in cryptographic operations. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys get projects](struct.ProjectLocationKeyRingCryptoKeyGetCall.html) (response) +/// * [locations key rings crypto keys update primary version projects](struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html) (response) +/// * [locations key rings crypto keys create projects](struct.ProjectLocationKeyRingCryptoKeyCreateCall.html) (request|response) +/// * [locations key rings crypto keys patch projects](struct.ProjectLocationKeyRingCryptoKeyPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CryptoKey { + /// Output only. The resource name for this CryptoKey in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + pub name: Option, + /// At next_rotation_time, the Key Management Service will automatically: + /// + /// 1. Create a new version of this CryptoKey. + /// 2. Mark the new version as primary. + /// + /// Key rotations performed manually via + /// CreateCryptoKeyVersion and + /// UpdateCryptoKeyPrimaryVersion + /// do not affect next_rotation_time. + #[serde(rename="nextRotationTime")] + pub next_rotation_time: Option, + /// next_rotation_time will be advanced by this period when the service + /// automatically rotates a key. Must be at least one day. + /// + /// If rotation_period is set, next_rotation_time must also be set. + #[serde(rename="rotationPeriod")] + pub rotation_period: Option, + /// Output only. A copy of the "primary" CryptoKeyVersion that will be used + /// by Encrypt when this CryptoKey is given + /// in EncryptRequest.name. + /// + /// The CryptoKey's primary version can be updated via + /// UpdateCryptoKeyPrimaryVersion. + pub primary: Option, + /// Output only. The time at which this CryptoKey was created. + #[serde(rename="createTime")] + pub create_time: Option, + /// The immutable purpose of this CryptoKey. Currently, the only acceptable + /// purpose is ENCRYPT_DECRYPT. + pub purpose: Option, +} + +impl RequestValue for CryptoKey {} +impl ResponseResult for CryptoKey {} + + +/// Response message for `TestIamPermissions` method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings test iam permissions projects](struct.ProjectLocationKeyRingTestIamPermissionCall.html) (response) +/// * [locations key rings crypto keys test iam permissions projects](struct.ProjectLocationKeyRingCryptoKeyTestIamPermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsResponse { + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. + pub permissions: Option>, +} + +impl ResponseResult for TestIamPermissionsResponse {} + + +/// Request message for KeyManagementService.RestoreCryptoKeyVersion. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys crypto key versions restore projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RestoreCryptoKeyVersionRequest { _never_set: Option } + +impl RequestValue for RestoreCryptoKeyVersionRequest {} + + +/// Response message for KeyManagementService.Encrypt. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys encrypt projects](struct.ProjectLocationKeyRingCryptoKeyEncryptCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EncryptResponse { + /// The encrypted data. + pub ciphertext: Option, + /// The resource name of the CryptoKeyVersion used in encryption. + pub name: Option, +} + +impl ResponseResult for EncryptResponse {} + + +/// Request message for KeyManagementService.DestroyCryptoKeyVersion. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys crypto key versions destroy projects](struct.ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DestroyCryptoKeyVersionRequest { _never_set: Option } + +impl RequestValue for DestroyCryptoKeyVersionRequest {} + + +/// Request message for KeyManagementService.Decrypt. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys decrypt projects](struct.ProjectLocationKeyRingCryptoKeyDecryptCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DecryptRequest { + /// Required. The encrypted data originally returned in + /// EncryptResponse.ciphertext. + pub ciphertext: Option, + /// Optional data that must match the data originally supplied in + /// EncryptRequest.additional_authenticated_data. + #[serde(rename="additionalAuthenticatedData")] + pub additional_authenticated_data: Option, +} + +impl RequestValue for DecryptRequest {} + + +/// Write a Data Access (Gin) log +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DataAccessOptions { _never_set: Option } + +impl Part for DataAccessOptions {} + + +/// Associates `members` with a `role`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + /// Required + pub role: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// + /// * `domain:{domain}`: A Google Apps domain name that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, +} + +impl Part for Binding {} + + +/// Request message for KeyManagementService.UpdateCryptoKeyPrimaryVersion. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [locations key rings crypto keys update primary version projects](struct.ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdateCryptoKeyPrimaryVersionRequest { + /// The id of the child CryptoKeyVersion to use as primary. + #[serde(rename="cryptoKeyVersionId")] + pub crypto_key_version_id: Option, +} + +impl RequestValue for UpdateCryptoKeyPrimaryVersionRequest {} + + +/// 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 {} + + +/// Write a Cloud Audit log +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CloudAuditOptions { + /// The log_name to populate in the Cloud Audit Record. + #[serde(rename="logName")] + pub log_name: Option, +} + +impl Part for CloudAuditOptions {} + + +/// Specifies what kind of log the caller must write +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogConfig { + /// Counter options. + pub counter: Option, + /// Data access options. + #[serde(rename="dataAccess")] + pub data_access: Option, + /// Cloud audit options. + #[serde(rename="cloudAudit")] + pub cloud_audit: Option, +} + +impl Part for LogConfig {} + + +/// A condition to be met. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Condition { + /// Trusted attributes supplied by the IAM system. + pub iam: Option, + /// Trusted attributes supplied by any service that owns resources and uses + /// the IAM system for access control. + pub sys: Option, + /// The objects of the condition. This is mutually exclusive with 'value'. + pub values: Option>, + /// Trusted attributes discharged by the service. + pub svc: Option, + /// DEPRECATED. Use 'values' instead. + pub value: Option, + /// An operator to apply the subject with. + pub op: Option, +} + +impl Part for Condition {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `CloudKMS` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudkms1_beta1::CloudKMS; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `locations_get(...)`, `locations_key_rings_create(...)`, `locations_key_rings_crypto_keys_create(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_create(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_destroy(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_get(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_list(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_patch(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_restore(...)`, `locations_key_rings_crypto_keys_decrypt(...)`, `locations_key_rings_crypto_keys_encrypt(...)`, `locations_key_rings_crypto_keys_get(...)`, `locations_key_rings_crypto_keys_get_iam_policy(...)`, `locations_key_rings_crypto_keys_list(...)`, `locations_key_rings_crypto_keys_patch(...)`, `locations_key_rings_crypto_keys_set_iam_policy(...)`, `locations_key_rings_crypto_keys_test_iam_permissions(...)`, `locations_key_rings_crypto_keys_update_primary_version(...)`, `locations_key_rings_get(...)`, `locations_key_rings_get_iam_policy(...)`, `locations_key_rings_list(...)`, `locations_key_rings_set_iam_policy(...)`, `locations_key_rings_test_iam_permissions(...)` and `locations_list(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, +} + +impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} + +impl<'a, C, A> ProjectMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Update a CryptoKeyVersion's metadata. + /// + /// state may be changed between + /// ENABLED and + /// DISABLED using this + /// method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to + /// move between other states. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Output only. The resource name for this CryptoKeyVersion in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_patch(&self, request: CryptoKeyVersion, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a new KeyRing in a given Project and Location. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The resource name of the location associated with the + /// KeyRings, in the format `projects/*/locations/*`. + pub fn locations_key_rings_create(&self, request: KeyRing, parent: &str) -> ProjectLocationKeyRingCreateCall<'a, C, A> { + ProjectLocationKeyRingCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _key_ring_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists KeyRings. + /// + /// # Arguments + /// + /// * `parent` - Required. The resource name of the location associated with the + /// KeyRings, in the format `projects/*/locations/*`. + pub fn locations_key_rings_list(&self, parent: &str) -> ProjectLocationKeyRingListCall<'a, C, A> { + ProjectLocationKeyRingListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Schedule a CryptoKeyVersion for destruction. + /// + /// Upon calling this method, CryptoKeyVersion.state will be set to + /// DESTROY_SCHEDULED + /// and destroy_time will be set to a time 24 + /// hours in the future, at which point the state + /// will be changed to + /// DESTROYED, and the key + /// material will be irrevocably destroyed. + /// + /// Before the destroy_time is reached, + /// RestoreCryptoKeyVersion may be called to reverse the process. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the CryptoKeyVersion to destroy. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_destroy(&self, request: DestroyCryptoKeyVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Encrypt data, so that it can only be recovered by a call to Decrypt. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of the CryptoKey or CryptoKeyVersion + /// to use for encryption. + /// If a CryptoKey is specified, the server will use its + /// primary version. + pub fn locations_key_rings_crypto_keys_encrypt(&self, request: EncryptRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyEncryptCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns metadata for a given KeyRing. + /// + /// # Arguments + /// + /// * `name` - The name of the KeyRing to get. + pub fn locations_key_rings_get(&self, name: &str) -> ProjectLocationKeyRingGetCall<'a, C, A> { + ProjectLocationKeyRingGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns metadata for a given CryptoKey, as well as its + /// primary CryptoKeyVersion. + /// + /// # Arguments + /// + /// * `name` - The name of the CryptoKey to get. + pub fn locations_key_rings_crypto_keys_get(&self, name: &str) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists information about the supported locations for this service. + /// + /// # Arguments + /// + /// * `name` - The resource that owns the locations collection, if applicable. + pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, C, A> { + ProjectLocationListCall { + hub: self.hub, + _name: name.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> { + ProjectLocationKeyRingTestIamPermissionCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_crypto_keys_get_iam_policy(&self, resource: &str) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyGetIamPolicyCall { + hub: self.hub, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update the version of a CryptoKey that will be used in Encrypt + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the CryptoKey to update. + pub fn locations_key_rings_crypto_keys_update_primary_version(&self, request: UpdateCryptoKeyPrimaryVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Update a CryptoKey. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Output only. The resource name for this CryptoKey in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + pub fn locations_key_rings_crypto_keys_patch(&self, request: CryptoKey, name: &str) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyPatchCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _update_mask: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Decrypt data that was protected by Encrypt. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - Required. The resource name of the CryptoKey to use for decryption. + /// The server will choose the appropriate version. + pub fn locations_key_rings_crypto_keys_decrypt(&self, request: DecryptRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyDecryptCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the access control policy for a resource. + /// Returns an empty policy if the resource exists and does not have a policy + /// set. + /// + /// # Arguments + /// + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_get_iam_policy(&self, resource: &str) -> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> { + ProjectLocationKeyRingGetIamPolicyCall { + hub: self.hub, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> { + ProjectLocationKeyRingSetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Get information about a location. + /// + /// # Arguments + /// + /// * `name` - Resource name for the location. + pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, C, A> { + ProjectLocationGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_crypto_keys_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyTestIamPermissionCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists CryptoKeyVersions. + /// + /// # Arguments + /// + /// * `parent` - Required. The resource name of the CryptoKey to list, in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_list(&self, parent: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists CryptoKeys. + /// + /// # Arguments + /// + /// * `parent` - Required. The resource name of the KeyRing to list, in the format + /// `projects/*/locations/*/keyRings/*`. + pub fn locations_key_rings_crypto_keys_list(&self, parent: &str) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyListCall { + hub: self.hub, + _parent: parent.to_string(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a new CryptoKeyVersion in a CryptoKey. + /// + /// The server will assign the next sequential id. If unset, + /// state will be set to + /// ENABLED. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the CryptoKey associated with + /// the CryptoKeyVersions. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_create(&self, request: CryptoKeyVersion, parent: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns metadata for a given CryptoKeyVersion. + /// + /// # Arguments + /// + /// * `name` - The name of the CryptoKeyVersion to get. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_get(&self, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall { + hub: self.hub, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on the specified resource. Replaces any + /// existing policy. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn locations_key_rings_crypto_keys_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeySetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Restore a CryptoKeyVersion in the + /// DESTROY_SCHEDULED, + /// state. + /// + /// Upon restoration of the CryptoKeyVersion, state + /// will be set to DISABLED, + /// and destroy_time will be cleared. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the CryptoKeyVersion to restore. + pub fn locations_key_rings_crypto_keys_crypto_key_versions_restore(&self, request: RestoreCryptoKeyVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall { + hub: self.hub, + _request: request, + _name: name.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Create a new CryptoKey within a KeyRing. + /// + /// CryptoKey.purpose is required. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `parent` - Required. The name of the KeyRing associated with the + /// CryptoKeys. + pub fn locations_key_rings_crypto_keys_create(&self, request: CryptoKey, parent: &str) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> { + ProjectLocationKeyRingCryptoKeyCreateCall { + hub: self.hub, + _request: request, + _parent: parent.to_string(), + _crypto_key_id: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Update a CryptoKeyVersion's metadata. +/// +/// state may be changed between +/// ENABLED and +/// DISABLED using this +/// method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to +/// move between other states. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::CryptoKeyVersion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CryptoKeyVersion::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_patch(req, "name") +/// .update_mask("accusam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: CryptoKeyVersion, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CryptoKeyVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CryptoKeyVersion) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. The resource name for this CryptoKeyVersion in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required list of fields to be updated in this request. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Create a new KeyRing in a given Project and Location. +/// +/// A builder for the *locations.keyRings.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::KeyRing; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = KeyRing::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_create(req, "parent") +/// .key_ring_id("justo") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: KeyRing, + _parent: String, + _key_ring_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, KeyRing)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._key_ring_id { + params.push(("keyRingId", value.to_string())); + } + for &field in ["alt", "parent", "keyRingId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+parent}/keyRings".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: KeyRing) -> ProjectLocationKeyRingCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the location associated with the + /// KeyRings, in the format `projects/*/locations/*`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationKeyRingCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Required. It must be unique within a location and match the regular + /// expression `[a-zA-Z0-9_-]{1,63}` + /// + /// Sets the *key ring id* query property to the given value. + pub fn key_ring_id(mut self, new_value: &str) -> ProjectLocationKeyRingCreateCall<'a, C, A> { + self._key_ring_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists KeyRings. +/// +/// A builder for the *locations.keyRings.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_list("parent") +/// .page_token("erat") +/// .page_size(-35) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListKeyRingsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+parent}/keyRings".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the location associated with the + /// KeyRings, in the format `projects/*/locations/*`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationKeyRingListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional pagination token, returned earlier via + /// ListKeyRingsResponse.next_page_token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationKeyRingListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional limit on the number of KeyRings to include in the + /// response. Further KeyRings can subsequently be obtained by + /// including the ListKeyRingsResponse.next_page_token in a subsequent + /// request. If unspecified, the server will pick an appropriate default. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationKeyRingListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Schedule a CryptoKeyVersion for destruction. +/// +/// Upon calling this method, CryptoKeyVersion.state will be set to +/// DESTROY_SCHEDULED +/// and destroy_time will be set to a time 24 +/// hours in the future, at which point the state +/// will be changed to +/// DESTROYED, and the key +/// material will be irrevocably destroyed. +/// +/// Before the destroy_time is reached, +/// RestoreCryptoKeyVersion may be called to reverse the process. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::DestroyCryptoKeyVersionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = DestroyCryptoKeyVersionRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_destroy(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: DestroyCryptoKeyVersionRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CryptoKeyVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.destroy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}:destroy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: DestroyCryptoKeyVersionRequest) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the CryptoKeyVersion to destroy. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Encrypt data, so that it can only be recovered by a call to Decrypt. +/// +/// A builder for the *locations.keyRings.cryptoKeys.encrypt* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::EncryptRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = EncryptRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_encrypt(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: EncryptRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, EncryptResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.encrypt", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}:encrypt".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: EncryptRequest) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the CryptoKey or CryptoKeyVersion + /// to use for encryption. + /// + /// If a CryptoKey is specified, the server will use its + /// primary version. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns metadata for a given KeyRing. +/// +/// A builder for the *locations.keyRings.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, KeyRing)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the KeyRing to get. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns metadata for a given CryptoKey, as well as its +/// primary CryptoKeyVersion. +/// +/// A builder for the *locations.keyRings.cryptoKeys.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CryptoKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the CryptoKey to get. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + 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 yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_list("name") +/// .page_token("aliquyam") +/// .page_size(-66) +/// .filter("no") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _name: String, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListLocationsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "name", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}/locations".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing 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: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. +/// +/// A builder for the *locations.keyRings.testIamPermissions* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = TestIamPermissionsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:testIamPermissions".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// A builder for the *locations.keyRings.cryptoKeys.getIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_get_iam_policy("resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:getIamPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Update the version of a CryptoKey that will be used in Encrypt +/// +/// A builder for the *locations.keyRings.cryptoKeys.updatePrimaryVersion* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::UpdateCryptoKeyPrimaryVersionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = UpdateCryptoKeyPrimaryVersionRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_update_primary_version(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: UpdateCryptoKeyPrimaryVersionRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CryptoKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.updatePrimaryVersion", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}:updatePrimaryVersion".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: UpdateCryptoKeyPrimaryVersionRequest) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the CryptoKey to update. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Update a CryptoKey. +/// +/// A builder for the *locations.keyRings.cryptoKeys.patch* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::CryptoKey; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CryptoKey::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_patch(req, "name") +/// .update_mask("diam") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: CryptoKey, + _name: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CryptoKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "name", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Patch, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CryptoKey) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Output only. The resource name for this CryptoKey in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// Required list of fields to be updated in this request. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Decrypt data that was protected by Encrypt. +/// +/// A builder for the *locations.keyRings.cryptoKeys.decrypt* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::DecryptRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = DecryptRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_decrypt(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: DecryptRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DecryptResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.decrypt", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}:decrypt".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: DecryptRequest) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The resource name of the CryptoKey to use for decryption. + /// The server will choose the appropriate version. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets the access control policy for a resource. +/// Returns an empty policy if the resource exists and does not have a policy +/// set. +/// +/// A builder for the *locations.keyRings.getIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_get_iam_policy("resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:getIamPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any +/// existing policy. +/// +/// A builder for the *locations.keyRings.setIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SetIamPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:setIamPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + 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 yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Location)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing 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: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. +/// +/// A builder for the *locations.keyRings.cryptoKeys.testIamPermissions* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = TestIamPermissionsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TestIamPermissionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:testIamPermissions".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists CryptoKeyVersions. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_list("parent") +/// .page_token("Lorem") +/// .page_size(-75) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListCryptoKeyVersionsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+parent}/cryptoKeyVersions".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the CryptoKey to list, in the format + /// `projects/*/locations/*/keyRings/*/cryptoKeys/*`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional pagination token, returned earlier via + /// ListCryptoKeyVersionsResponse.next_page_token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional limit on the number of CryptoKeyVersions to + /// include in the response. Further CryptoKeyVersions can + /// subsequently be obtained by including the + /// ListCryptoKeyVersionsResponse.next_page_token in a subsequent request. + /// If unspecified, the server will pick an appropriate default. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists CryptoKeys. +/// +/// A builder for the *locations.keyRings.cryptoKeys.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_list("parent") +/// .page_token("sadipscing") +/// .page_size(-48) +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListCryptoKeysResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+parent}/cryptoKeys".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The resource name of the KeyRing to list, in the format + /// `projects/*/locations/*/keyRings/*`. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional pagination token, returned earlier via + /// ListCryptoKeysResponse.next_page_token. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional limit on the number of CryptoKeys to include in the + /// response. Further CryptoKeys can subsequently be obtained by + /// including the ListCryptoKeysResponse.next_page_token in a subsequent + /// request. If unspecified, the server will pick an appropriate default. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Create a new CryptoKeyVersion in a CryptoKey. +/// +/// The server will assign the next sequential id. If unset, +/// state will be set to +/// ENABLED. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::CryptoKeyVersion; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CryptoKeyVersion::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_create(req, "parent") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: CryptoKeyVersion, + _parent: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CryptoKeyVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + for &field in ["alt", "parent"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+parent}/cryptoKeyVersions".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CryptoKeyVersion) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the CryptoKey associated with + /// the CryptoKeyVersions. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns metadata for a given CryptoKeyVersion. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_get("name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CryptoKeyVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The name of the CryptoKeyVersion to get. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Sets the access control policy on the specified resource. Replaces any +/// existing policy. +/// +/// A builder for the *locations.keyRings.cryptoKeys.setIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SetIamPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+resource}:setIamPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetIamPolicyRequest) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Restore a CryptoKeyVersion in the +/// DESTROY_SCHEDULED, +/// state. +/// +/// Upon restoration of the CryptoKeyVersion, state +/// will be set to DISABLED, +/// and destroy_time will be cleared. +/// +/// A builder for the *locations.keyRings.cryptoKeys.cryptoKeyVersions.restore* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::RestoreCryptoKeyVersionRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = RestoreCryptoKeyVersionRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_restore(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: RestoreCryptoKeyVersionRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CryptoKeyVersion)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.cryptoKeyVersions.restore", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+name}:restore".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["name"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: RestoreCryptoKeyVersionRequest) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the CryptoKeyVersion to restore. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> { + self._name = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Create a new CryptoKey within a KeyRing. +/// +/// CryptoKey.purpose is required. +/// +/// A builder for the *locations.keyRings.cryptoKeys.create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudkms1_beta1 as cloudkms1_beta1; +/// use cloudkms1_beta1::CryptoKey; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudkms1_beta1::CloudKMS; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudKMS::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CryptoKey::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().locations_key_rings_crypto_keys_create(req, "parent") +/// .crypto_key_id("eirmod") +/// .doit(); +/// # } +/// ``` +pub struct ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudKMS, + _request: CryptoKey, + _parent: String, + _crypto_key_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CryptoKey)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudkms.projects.locations.keyRings.cryptoKeys.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._crypto_key_id { + params.push(("cryptoKeyId", value.to_string())); + } + for &field in ["alt", "parent", "cryptoKeyId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudkms.googleapis.com/v1beta1/{+parent}/cryptoKeys".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CryptoKey) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the KeyRing associated with the + /// CryptoKeys. + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Required. It must be unique within a KeyRing and match the regular + /// expression `[a-zA-Z0-9_-]{1,63}` + /// + /// Sets the *crypto key id* query property to the given value. + pub fn crypto_key_id(mut self, new_value: &str) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> { + self._crypto_key_id = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + + diff --git a/gen/cloudlatencytest2-cli/Cargo.toml b/gen/cloudlatencytest2-cli/Cargo.toml index e0ed2e619c..d06668bdbb 100644 --- a/gen/cloudlatencytest2-cli/Cargo.toml +++ b/gen/cloudlatencytest2-cli/Cargo.toml @@ -23,7 +23,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/cloudlatencytest2/src/lib.rs b/gen/cloudlatencytest2/src/lib.rs index 1d046b5108..d86ce216b0 100644 --- a/gen/cloudlatencytest2/src/lib.rs +++ b/gen/cloudlatencytest2/src/lib.rs @@ -173,7 +173,7 @@ // 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 +// 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)] @@ -304,8 +304,6 @@ pub struct Cloudlatencytest { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Cloudlatencytest {} @@ -318,8 +316,6 @@ impl<'a, C, A> Cloudlatencytest client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/".to_string(), - _root_url: "https://cloudlatencytest-pa.googleapis.com/".to_string(), } } @@ -336,26 +332,6 @@ impl<'a, C, A> Cloudlatencytest self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://cloudlatencytest-pa.googleapis.com/v2/statscollection/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://cloudlatencytest-pa.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -651,7 +627,7 @@ impl<'a, C, A> StatscollectionUpdateaggregatedstatCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "updateaggregatedstats"; + let mut url = "https://cloudlatencytest-pa.googleapis.com/v2/statscollection/updateaggregatedstats".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MonitoringReadonly.as_ref().to_string(), ()); } @@ -884,7 +860,7 @@ impl<'a, C, A> StatscollectionUpdatestatCall<'a, C, A> where C: BorrowMut StatscollectionUpdatestatCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Cloud Monitoring (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudmonitoring2_beta2-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-cloudmonitoring2_beta2] path = "../cloudmonitoring2_beta2" -version = "1.0.4+20161031" +version = "1.0.4+20170501" diff --git a/gen/cloudmonitoring2_beta2-cli/README.md b/gen/cloudmonitoring2_beta2-cli/README.md index 02f8005076..fa2bd0ca52 100644 --- a/gen/cloudmonitoring2_beta2-cli/README.md +++ b/gen/cloudmonitoring2_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 Monitoring* API at revision *20161031*. The CLI is at version *1.0.4*. +This documentation was generated from the *Cloud Monitoring* API at revision *20170501*. The CLI is at version *1.0.4*. ```bash cloudmonitoring2-beta2 [options] diff --git a/gen/cloudmonitoring2_beta2-cli/mkdocs.yml b/gen/cloudmonitoring2_beta2-cli/mkdocs.yml index 3708d6b6f0..6cb47f093d 100644 --- a/gen/cloudmonitoring2_beta2-cli/mkdocs.yml +++ b/gen/cloudmonitoring2_beta2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Monitoring v1.0.4+20161031 +site_name: Cloud Monitoring v1.0.4+20170501 site_url: http://byron.github.io/google-apis-rs/google-cloudmonitoring2_beta2-cli site_description: A complete library to interact with Cloud Monitoring (protocol v2beta2) diff --git a/gen/cloudmonitoring2_beta2-cli/src/main.rs b/gen/cloudmonitoring2_beta2-cli/src/main.rs index 99c77be6fd..38c82c01f6 100644 --- a/gen/cloudmonitoring2_beta2-cli/src/main.rs +++ b/gen/cloudmonitoring2_beta2-cli/src/main.rs @@ -915,7 +915,7 @@ fn main() { let mut app = App::new("cloudmonitoring2-beta2") .author("Sebastian Thiel ") - .version("1.0.4+20161031") + .version("1.0.4+20170501") .about("Accesses Google Cloud Monitoring data.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_cloudmonitoring2_beta2_cli") .arg(Arg::with_name("url") diff --git a/gen/cloudmonitoring2_beta2/Cargo.toml b/gen/cloudmonitoring2_beta2/Cargo.toml index e7b04186d8..2be403eb54 100644 --- a/gen/cloudmonitoring2_beta2/Cargo.toml +++ b/gen/cloudmonitoring2_beta2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudmonitoring2_beta2" -version = "1.0.4+20161031" +version = "1.0.4+20170501" authors = ["Sebastian Thiel "] description = "A complete library to interact with Cloud Monitoring (protocol v2beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/cloudmonitoring2_beta2" homepage = "https://cloud.google.com/monitoring/v2beta2/" -documentation = "https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031" +documentation = "https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501" license = "MIT" keywords = ["cloudmonitoring", "google", "protocol", "web", "api"] diff --git a/gen/cloudmonitoring2_beta2/README.md b/gen/cloudmonitoring2_beta2/README.md index df172a565c..8e14b5a7d9 100644 --- a/gen/cloudmonitoring2_beta2/README.md +++ b/gen/cloudmonitoring2_beta2/README.md @@ -5,20 +5,20 @@ DO NOT EDIT ! --> The `google-cloudmonitoring2_beta2` library allows access to all features of the *Google Cloud Monitoring* service. -This documentation was generated from *Cloud Monitoring* crate version *1.0.4+20161031*, where *20161031* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Cloud Monitoring* crate version *1.0.4+20170501*, where *20170501* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the [official documentation site](https://cloud.google.com/monitoring/v2beta2/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/struct.CloudMonitoring.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/struct.CloudMonitoring.html) ... -* [metric descriptors](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/struct.MetricDescriptor.html) - * [*create*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/struct.MetricDescriptorCreateCall.html), [*delete*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/struct.MetricDescriptorDeleteCall.html) and [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/struct.MetricDescriptorListCall.html) +* [metric descriptors](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptor.html) + * [*create*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptorCreateCall.html), [*delete*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptorDeleteCall.html) and [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/struct.MetricDescriptorListCall.html) * timeseries - * [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/struct.TimeseryListCall.html) and [*write*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/struct.TimeseryWriteCall.html) -* [timeseries descriptors](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/struct.TimeseriesDescriptor.html) - * [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/struct.TimeseriesDescriptorListCall.html) + * [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/struct.TimeseryListCall.html) and [*write*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/struct.TimeseryWriteCall.html) +* [timeseries descriptors](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/struct.TimeseriesDescriptor.html) + * [*list*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/struct.TimeseriesDescriptorListCall.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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/struct.CloudMonitoring.html)** +* **[Hub](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/struct.CloudMonitoring.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_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")`. @@ -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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_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-cloudmonitoring2_beta2/1.0.4+20161031/google_cloudmonitoring2_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudmonitoring2_beta2/1.0.4+20170501/google_cloudmonitoring2_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/cloudmonitoring2_beta2/src/lib.rs b/gen/cloudmonitoring2_beta2/src/lib.rs index 33bd42391e..f36ea64150 100644 --- a/gen/cloudmonitoring2_beta2/src/lib.rs +++ b/gen/cloudmonitoring2_beta2/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Monitoring* crate version *1.0.4+20161031*, where *20161031* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Cloud Monitoring* crate version *1.0.4+20170501*, where *20170501* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the //! [official documentation site](https://cloud.google.com/monitoring/v2beta2/). @@ -185,7 +185,7 @@ // 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 +// 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)] @@ -323,8 +323,6 @@ pub struct CloudMonitoring { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for CloudMonitoring {} @@ -337,8 +335,6 @@ impl<'a, C, A> CloudMonitoring client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -361,26 +357,6 @@ impl<'a, C, A> CloudMonitoring self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/cloudmonitoring/v2beta2/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1183,7 +1159,7 @@ impl<'a, C, A> TimeseriesDescriptorListCall<'a, C, A> where C: BorrowMut TimeseryWriteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/timeseries:write"; + let mut url = "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/{project}/timeseries:write".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1842,7 +1818,7 @@ impl<'a, C, A> TimeseryListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/timeseries/{metric}"; + let mut url = "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/{project}/timeseries/{metric}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2209,7 +2185,7 @@ impl<'a, C, A> MetricDescriptorListCall<'a, C, A> where C: BorrowMut MetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut MetricDescriptorCreateCall<'a, C, A> where C: BorrowMut MetricDescriptorCreateCall<'a, C, A> where C: BorrowMut"] 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-cloudresourcemanager1] path = "../cloudresourcemanager1" -version = "1.0.4+20161212" +version = "1.0.4+20170517" diff --git a/gen/cloudresourcemanager1-cli/README.md b/gen/cloudresourcemanager1-cli/README.md index 30fd9ae61f..51fad1eb04 100644 --- a/gen/cloudresourcemanager1-cli/README.md +++ b/gen/cloudresourcemanager1-cli/README.md @@ -25,26 +25,49 @@ 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 *20161212*. The CLI is at version *1.0.4*. +This documentation was generated from the *Cloud Resource Manager* API at revision *20170517*. The CLI is at version *1.0.4*. ```bash cloudresourcemanager1 [options] + folders + clear-org-policy (-r )... [-p ]... [-o ] + get-effective-org-policy (-r )... [-p ]... [-o ] + get-org-policy (-r )... [-p ]... [-o ] + list-available-org-policy-constraints (-r )... [-p ]... [-o ] + list-org-policies (-r )... [-p ]... [-o ] + set-org-policy (-r )... [-p ]... [-o ] + liens + create (-r )... [-p ]... [-o ] + delete [-p ]... [-o ] + list [-p ]... [-o ] operations get [-p ]... [-o ] organizations + clear-org-policy (-r )... [-p ]... [-o ] get [-p ]... [-o ] + get-effective-org-policy (-r )... [-p ]... [-o ] get-iam-policy (-r )... [-p ]... [-o ] + get-org-policy (-r )... [-p ]... [-o ] + list-available-org-policy-constraints (-r )... [-p ]... [-o ] + list-org-policies (-r )... [-p ]... [-o ] search (-r )... [-p ]... [-o ] set-iam-policy (-r )... [-p ]... [-o ] + set-org-policy (-r )... [-p ]... [-o ] test-iam-permissions (-r )... [-p ]... [-o ] projects + clear-org-policy (-r )... [-p ]... [-o ] create (-r )... [-p ]... [-o ] delete [-p ]... [-o ] get [-p ]... [-o ] get-ancestry (-r )... [-p ]... [-o ] + get-effective-org-policy (-r )... [-p ]... [-o ] get-iam-policy (-r )... [-p ]... [-o ] + get-org-policy (-r )... [-p ]... [-o ] list [-p ]... [-o ] + list-available-org-policy-constraints (-r )... [-p ]... [-o ] + list-org-policies (-r )... [-p ]... [-o ] set-iam-policy (-r )... [-p ]... [-o ] + set-org-policy (-r )... [-p ]... [-o ] test-iam-permissions (-r )... [-p ]... [-o ] undelete (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] diff --git a/gen/cloudresourcemanager1-cli/mkdocs.yml b/gen/cloudresourcemanager1-cli/mkdocs.yml index dc900568f7..ef07016d04 100644 --- a/gen/cloudresourcemanager1-cli/mkdocs.yml +++ b/gen/cloudresourcemanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Cloud Resource Manager v1.0.4+20161212 +site_name: Cloud Resource Manager v1.0.4+20170517 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) @@ -9,19 +9,40 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['folders_clear-org-policy.md', 'Folders', 'Clear Org Policy'] +- ['folders_get-effective-org-policy.md', 'Folders', 'Get Effective Org Policy'] +- ['folders_get-org-policy.md', 'Folders', 'Get Org Policy'] +- ['folders_list-available-org-policy-constraints.md', 'Folders', 'List Available Org Policy Constraints'] +- ['folders_list-org-policies.md', 'Folders', 'List Org Policies'] +- ['folders_set-org-policy.md', 'Folders', 'Set Org Policy'] +- ['liens_create.md', 'Liens', 'Create'] +- ['liens_delete.md', 'Liens', 'Delete'] +- ['liens_list.md', 'Liens', 'List'] - ['operations_get.md', 'Operations', 'Get'] +- ['organizations_clear-org-policy.md', 'Organizations', 'Clear Org Policy'] - ['organizations_get.md', 'Organizations', 'Get'] +- ['organizations_get-effective-org-policy.md', 'Organizations', 'Get Effective Org Policy'] - ['organizations_get-iam-policy.md', 'Organizations', 'Get Iam Policy'] +- ['organizations_get-org-policy.md', 'Organizations', 'Get Org Policy'] +- ['organizations_list-available-org-policy-constraints.md', 'Organizations', 'List Available Org Policy Constraints'] +- ['organizations_list-org-policies.md', 'Organizations', 'List Org Policies'] - ['organizations_search.md', 'Organizations', 'Search'] - ['organizations_set-iam-policy.md', 'Organizations', 'Set Iam Policy'] +- ['organizations_set-org-policy.md', 'Organizations', 'Set Org Policy'] - ['organizations_test-iam-permissions.md', 'Organizations', 'Test Iam Permissions'] +- ['projects_clear-org-policy.md', 'Projects', 'Clear Org Policy'] - ['projects_create.md', 'Projects', 'Create'] - ['projects_delete.md', 'Projects', 'Delete'] - ['projects_get.md', 'Projects', 'Get'] - ['projects_get-ancestry.md', 'Projects', 'Get Ancestry'] +- ['projects_get-effective-org-policy.md', 'Projects', 'Get Effective Org Policy'] - ['projects_get-iam-policy.md', 'Projects', 'Get Iam Policy'] +- ['projects_get-org-policy.md', 'Projects', 'Get Org Policy'] - ['projects_list.md', 'Projects', 'List'] +- ['projects_list-available-org-policy-constraints.md', 'Projects', 'List Available Org Policy Constraints'] +- ['projects_list-org-policies.md', 'Projects', 'List Org Policies'] - ['projects_set-iam-policy.md', 'Projects', 'Set Iam Policy'] +- ['projects_set-org-policy.md', 'Projects', 'Set Org Policy'] - ['projects_test-iam-permissions.md', 'Projects', 'Test Iam Permissions'] - ['projects_undelete.md', 'Projects', 'Undelete'] - ['projects_update.md', 'Projects', 'Update'] diff --git a/gen/cloudresourcemanager1-cli/src/main.rs b/gen/cloudresourcemanager1-cli/src/main.rs index c10596e539..f1cdcd44cc 100644 --- a/gen/cloudresourcemanager1-cli/src/main.rs +++ b/gen/cloudresourcemanager1-cli/src/main.rs @@ -46,6 +46,732 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _folders_clear_org_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()[..] { + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "constraint" => Some(("constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["constraint", "etag"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ClearOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.folders().clear_org_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 _folders_get_effective_org_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()[..] { + "constraint" => Some(("constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["constraint"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetEffectiveOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.folders().get_effective_org_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 _folders_get_org_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()[..] { + "constraint" => Some(("constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["constraint"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.folders().get_org_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 _folders_list_available_org_policy_constraints(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::ListAvailableOrgPolicyConstraintsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.folders().list_available_org_policy_constraints(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 _folders_list_org_policies(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::ListOrgPoliciesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.folders().list_org_policies(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 _folders_set_org_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.update-time" => Some(("policy.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.constraint" => Some(("policy.constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.list-policy.all-values" => Some(("policy.listPolicy.allValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.list-policy.denied-values" => Some(("policy.listPolicy.deniedValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "policy.list-policy.inherit-from-parent" => Some(("policy.listPolicy.inheritFromParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "policy.list-policy.suggested-value" => Some(("policy.listPolicy.suggestedValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.list-policy.allowed-values" => Some(("policy.listPolicy.allowedValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "policy.boolean-policy.enforced" => Some(("policy.booleanPolicy.enforced", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["all-values", "allowed-values", "boolean-policy", "constraint", "denied-values", "enforced", "etag", "inherit-from-parent", "list-policy", "policy", "suggested-value", "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::SetOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.folders().set_org_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 _liens_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()[..] { + "origin" => Some(("origin", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "restrictions" => Some(("restrictions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "parent" => Some(("parent", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reason" => Some(("reason", 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", "origin", "parent", "reason", "restrictions"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Lien = json::value::from_value(object).unwrap(); + let mut call = self.hub.liens().create(request); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _liens_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.liens().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 _liens_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.liens().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 { + "parent" => { + call = call.parent(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["page-token", "page-size", "parent"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _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("")); @@ -98,6 +824,92 @@ impl<'n> Engine<'n> { } } + fn _organizations_clear_org_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()[..] { + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "constraint" => Some(("constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["constraint", "etag"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ClearOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().clear_org_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 _organizations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.organizations().get(opt.value_of("name").unwrap_or("")); @@ -150,6 +962,91 @@ impl<'n> Engine<'n> { } } + fn _organizations_get_effective_org_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()[..] { + "constraint" => Some(("constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["constraint"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetEffectiveOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().get_effective_org_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 _organizations_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -234,6 +1131,263 @@ impl<'n> Engine<'n> { } } + fn _organizations_get_org_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()[..] { + "constraint" => Some(("constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["constraint"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().get_org_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 _organizations_list_available_org_policy_constraints(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::ListAvailableOrgPolicyConstraintsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().list_available_org_policy_constraints(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 _organizations_list_org_policies(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::ListOrgPoliciesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().list_org_policies(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 _organizations_search(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -346,8 +1500,9 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -407,6 +1562,100 @@ impl<'n> Engine<'n> { } } + fn _organizations_set_org_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.update-time" => Some(("policy.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.constraint" => Some(("policy.constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.list-policy.all-values" => Some(("policy.listPolicy.allValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.list-policy.denied-values" => Some(("policy.listPolicy.deniedValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "policy.list-policy.inherit-from-parent" => Some(("policy.listPolicy.inheritFromParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "policy.list-policy.suggested-value" => Some(("policy.listPolicy.suggestedValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.list-policy.allowed-values" => Some(("policy.listPolicy.allowedValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "policy.boolean-policy.enforced" => Some(("policy.booleanPolicy.enforced", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["all-values", "allowed-values", "boolean-policy", "constraint", "denied-values", "enforced", "etag", "inherit-from-parent", "list-policy", "policy", "suggested-value", "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::SetOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.organizations().set_org_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 _organizations_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -492,6 +1741,92 @@ impl<'n> Engine<'n> { } } + fn _projects_clear_org_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()[..] { + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "constraint" => Some(("constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["constraint", "etag"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::ClearOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().clear_org_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_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -772,6 +2107,91 @@ impl<'n> Engine<'n> { } } + fn _projects_get_effective_org_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()[..] { + "constraint" => Some(("constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["constraint"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetEffectiveOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().get_effective_org_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_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -856,6 +2276,91 @@ impl<'n> Engine<'n> { } } + fn _projects_get_org_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()[..] { + "constraint" => Some(("constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["constraint"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::GetOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().get_org_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_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().list(); @@ -918,6 +2423,178 @@ impl<'n> Engine<'n> { } } + fn _projects_list_available_org_policy_constraints(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::ListAvailableOrgPolicyConstraintsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().list_available_org_policy_constraints(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_list_org_policies(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::ListOrgPoliciesRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().list_org_policies(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_set_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -943,8 +2620,9 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1004,6 +2682,100 @@ impl<'n> Engine<'n> { } } + fn _projects_set_org_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.update-time" => Some(("policy.updateTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.constraint" => Some(("policy.constraint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.list-policy.all-values" => Some(("policy.listPolicy.allValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.list-policy.denied-values" => Some(("policy.listPolicy.deniedValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "policy.list-policy.inherit-from-parent" => Some(("policy.listPolicy.inheritFromParent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "policy.list-policy.suggested-value" => Some(("policy.listPolicy.suggestedValue", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "policy.list-policy.allowed-values" => Some(("policy.listPolicy.allowedValues", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "policy.boolean-policy.enforced" => Some(("policy.booleanPolicy.enforced", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["all-values", "allowed-values", "boolean-policy", "constraint", "denied-values", "enforced", "etag", "inherit-from-parent", "list-policy", "policy", "suggested-value", "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::SetOrgPolicyRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().set_org_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_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -1270,6 +3042,49 @@ impl<'n> Engine<'n> { let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { + ("folders", Some(opt)) => { + match opt.subcommand() { + ("clear-org-policy", Some(opt)) => { + call_result = self._folders_clear_org_policy(opt, dry_run, &mut err); + }, + ("get-effective-org-policy", Some(opt)) => { + call_result = self._folders_get_effective_org_policy(opt, dry_run, &mut err); + }, + ("get-org-policy", Some(opt)) => { + call_result = self._folders_get_org_policy(opt, dry_run, &mut err); + }, + ("list-available-org-policy-constraints", Some(opt)) => { + call_result = self._folders_list_available_org_policy_constraints(opt, dry_run, &mut err); + }, + ("list-org-policies", Some(opt)) => { + call_result = self._folders_list_org_policies(opt, dry_run, &mut err); + }, + ("set-org-policy", Some(opt)) => { + call_result = self._folders_set_org_policy(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("folders".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("liens", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._liens_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._liens_delete(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._liens_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("liens".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("operations", Some(opt)) => { match opt.subcommand() { ("get", Some(opt)) => { @@ -1283,18 +3098,36 @@ impl<'n> Engine<'n> { }, ("organizations", Some(opt)) => { match opt.subcommand() { + ("clear-org-policy", Some(opt)) => { + call_result = self._organizations_clear_org_policy(opt, dry_run, &mut err); + }, ("get", Some(opt)) => { call_result = self._organizations_get(opt, dry_run, &mut err); }, + ("get-effective-org-policy", Some(opt)) => { + call_result = self._organizations_get_effective_org_policy(opt, dry_run, &mut err); + }, ("get-iam-policy", Some(opt)) => { call_result = self._organizations_get_iam_policy(opt, dry_run, &mut err); }, + ("get-org-policy", Some(opt)) => { + call_result = self._organizations_get_org_policy(opt, dry_run, &mut err); + }, + ("list-available-org-policy-constraints", Some(opt)) => { + call_result = self._organizations_list_available_org_policy_constraints(opt, dry_run, &mut err); + }, + ("list-org-policies", Some(opt)) => { + call_result = self._organizations_list_org_policies(opt, dry_run, &mut err); + }, ("search", Some(opt)) => { call_result = self._organizations_search(opt, dry_run, &mut err); }, ("set-iam-policy", Some(opt)) => { call_result = self._organizations_set_iam_policy(opt, dry_run, &mut err); }, + ("set-org-policy", Some(opt)) => { + call_result = self._organizations_set_org_policy(opt, dry_run, &mut err); + }, ("test-iam-permissions", Some(opt)) => { call_result = self._organizations_test_iam_permissions(opt, dry_run, &mut err); }, @@ -1306,6 +3139,9 @@ impl<'n> Engine<'n> { }, ("projects", Some(opt)) => { match opt.subcommand() { + ("clear-org-policy", Some(opt)) => { + call_result = self._projects_clear_org_policy(opt, dry_run, &mut err); + }, ("create", Some(opt)) => { call_result = self._projects_create(opt, dry_run, &mut err); }, @@ -1318,15 +3154,30 @@ impl<'n> Engine<'n> { ("get-ancestry", Some(opt)) => { call_result = self._projects_get_ancestry(opt, dry_run, &mut err); }, + ("get-effective-org-policy", Some(opt)) => { + call_result = self._projects_get_effective_org_policy(opt, dry_run, &mut err); + }, ("get-iam-policy", Some(opt)) => { call_result = self._projects_get_iam_policy(opt, dry_run, &mut err); }, + ("get-org-policy", Some(opt)) => { + call_result = self._projects_get_org_policy(opt, dry_run, &mut err); + }, ("list", Some(opt)) => { call_result = self._projects_list(opt, dry_run, &mut err); }, + ("list-available-org-policy-constraints", Some(opt)) => { + call_result = self._projects_list_available_org_policy_constraints(opt, dry_run, &mut err); + }, + ("list-org-policies", Some(opt)) => { + call_result = self._projects_list_org_policies(opt, dry_run, &mut err); + }, ("set-iam-policy", Some(opt)) => { call_result = self._projects_set_iam_policy(opt, dry_run, &mut err); }, + ("set-org-policy", Some(opt)) => { + call_result = self._projects_set_org_policy(opt, dry_run, &mut err); + }, ("test-iam-permissions", Some(opt)) => { call_result = self._projects_test_iam_permissions(opt, dry_run, &mut err); }, @@ -1428,6 +3279,265 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ + ("folders", "methods: 'clear-org-policy', 'get-effective-org-policy', 'get-org-policy', 'list-available-org-policy-constraints', 'list-org-policies' and 'set-org-policy'", vec![ + ("clear-org-policy", + Some(r##"Clears a `Policy` from a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/folders_clear-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource for the `Policy` to clear."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-effective-org-policy", + Some(r##"Gets the effective `Policy` on a resource. This is the result of merging + `Policies` in the resource hierarchy. The returned `Policy` will not have + an `etag`set because it is a computed `Policy` across multiple resources."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/folders_get-effective-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"The name of the resource to start computing the effective `Policy`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-org-policy", + Some(r##"Gets a `Policy` on a resource. + + If no `Policy` is set on the resource, a `Policy` is returned with default + values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + `etag` value can be used with `SetOrgPolicy()` to create or update a + `Policy` during read-modify-write."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/folders_get-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource the `Policy` is set on."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-available-org-policy-constraints", + Some(r##"Lists `Constraints` that could be applied on the specified resource."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/folders_list-available-org-policy-constraints", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource to list `Constraints` for."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-org-policies", + Some(r##"Lists all the `Policies` set for a particular resource."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/folders_list-org-policies", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource to list Policies for."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-org-policy", + Some(r##"Updates the specified `Policy` on the resource. Creates a new `Policy` for + that `Constraint` on the resource if one does not exist. + + Not supplying an `etag` on the request `Policy` results in an unconditional + write of the `Policy`."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/folders_set-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Resource name of the resource to attach the `Policy`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("liens", "methods: 'create', 'delete' and 'list'", vec![ + ("create", + Some(r##"Create a Lien which applies to the resource denoted by the `parent` field. + + Callers of this method will require permission on the `parent` resource. + For example, applying to `projects/1234` requires permission + `resourcemanager.projects.updateLiens`. + + NOTE: Some resources may limit the number of Liens which may be applied."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/liens_create", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Delete a Lien by `name`. + + Callers of this method will require permission on the `parent` resource. + For example, a Lien with a `parent` of `projects/1234` requires permission + `resourcemanager.projects.updateLiens`."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/liens_delete", + vec![ + (Some(r##"name"##), + None, + Some(r##"The name/identifier of the Lien to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list", + Some(r##"List all Liens applied to the `parent` resource. + + Callers of this method will require permission on the `parent` resource. + For example, a Lien with a `parent` of `projects/1234` requires permission + `resourcemanager.projects.get`."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/liens_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)), + ]), + ]), + ("operations", "methods: 'get'", vec![ ("get", Some(r##"Gets the latest state of a long-running operation. Clients can use this @@ -1455,7 +3565,35 @@ fn main() { ]), ]), - ("organizations", "methods: 'get', 'get-iam-policy', 'search', 'set-iam-policy' and 'test-iam-permissions'", vec![ + ("organizations", "methods: 'clear-org-policy', 'get', 'get-effective-org-policy', 'get-iam-policy', 'get-org-policy', 'list-available-org-policy-constraints', 'list-org-policies', 'search', 'set-iam-policy', 'set-org-policy' and 'test-iam-permissions'", vec![ + ("clear-org-policy", + Some(r##"Clears a `Policy` from a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_clear-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource for the `Policy` to clear."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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##"Fetches an Organization resource identified by the specified resource name."##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_get", @@ -1472,6 +3610,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)), + ]), + ("get-effective-org-policy", + Some(r##"Gets the effective `Policy` on a resource. This is the result of merging + `Policies` in the resource hierarchy. The returned `Policy` will not have + an `etag`set because it is a computed `Policy` across multiple resources."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_get-effective-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"The name of the resource to start computing the effective `Policy`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1487,8 +3655,96 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + 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)), + ]), + ("get-org-policy", + Some(r##"Gets a `Policy` on a resource. + + If no `Policy` is set on the resource, a `Policy` is returned with default + values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + `etag` value can be used with `SetOrgPolicy()` to create or update a + `Policy` during read-modify-write."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_get-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource the `Policy` is set on."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-available-org-policy-constraints", + Some(r##"Lists `Constraints` that could be applied on the specified resource."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_list-available-org-policy-constraints", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource to list `Constraints` for."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-org-policies", + Some(r##"Lists all the `Policies` set for a particular resource."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_list-org-policies", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource to list Policies for."##), Some(true), Some(false)), @@ -1544,8 +3800,39 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being specified. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + 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)), + ]), + ("set-org-policy", + Some(r##"Updates the specified `Policy` on the resource. Creates a new `Policy` for + that `Constraint` on the resource if one does not exist. + + Not supplying an `etag` on the request `Policy` results in an unconditional + write of the `Policy`."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/organizations_set-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Resource name of the resource to attach the `Policy`."##), Some(true), Some(false)), @@ -1576,8 +3863,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy detail is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1601,7 +3887,35 @@ fn main() { ]), ]), - ("projects", "methods: 'create', 'delete', 'get', 'get-ancestry', 'get-iam-policy', 'list', 'set-iam-policy', 'test-iam-permissions', 'undelete' and 'update'", vec![ + ("projects", "methods: 'clear-org-policy', 'create', 'delete', 'get', 'get-ancestry', 'get-effective-org-policy', 'get-iam-policy', 'get-org-policy', 'list', 'list-available-org-policy-constraints', 'list-org-policies', 'set-iam-policy', 'set-org-policy', 'test-iam-permissions', 'undelete' and 'update'", vec![ + ("clear-org-policy", + Some(r##"Clears a `Policy` from a resource."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/projects_clear-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource for the `Policy` to clear."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), ("create", Some(r##"Request that a new Project be created. The result is an Operation which can be used to track the creation process. It is automatically deleted @@ -1732,6 +4046,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)), + ]), + ("get-effective-org-policy", + Some(r##"Gets the effective `Policy` on a resource. This is the result of merging + `Policies` in the resource hierarchy. The returned `Policy` will not have + an `etag`set because it is a computed `Policy` across multiple resources."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/projects_get-effective-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"The name of the resource to start computing the effective `Policy`."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1746,8 +4090,40 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + 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)), + ]), + ("get-org-policy", + Some(r##"Gets a `Policy` on a resource. + + If no `Policy` is set on the resource, a `Policy` is returned with default + values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + `etag` value can be used with `SetOrgPolicy()` to create or update a + `Policy` during read-modify-write."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/projects_get-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource the `Policy` is set on."##), Some(true), Some(false)), @@ -1781,6 +4157,62 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("list-available-org-policy-constraints", + Some(r##"Lists `Constraints` that could be applied on the specified resource."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/projects_list-available-org-policy-constraints", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource to list `Constraints` for."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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-org-policies", + Some(r##"Lists all the `Policies` set for a particular resource."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/projects_list-org-policies", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Name of the resource to list Policies for."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1815,7 +4247,7 @@ fn main() { + There must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to - to remove the last ToS-accepted owner from the policy will fail. This + remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. @@ -1831,8 +4263,39 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being specified. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + 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)), + ]), + ("set-org-policy", + Some(r##"Updates the specified `Policy` on the resource. Creates a new `Policy` for + that `Constraint` on the resource if one does not exist. + + Not supplying an `etag` on the request `Policy` results in an unconditional + write of the `Policy`."##), + "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_cli/projects_set-org-policy", + vec![ + (Some(r##"resource"##), + None, + Some(r##"Resource name of the resource to attach the `Policy`."##), Some(true), Some(false)), @@ -1861,8 +4324,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy detail is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1959,7 +4421,7 @@ fn main() { let mut app = App::new("cloudresourcemanager1") .author("Sebastian Thiel ") - .version("1.0.4+20161212") + .version("1.0.4+20170517") .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 07cb8e0f3f..9de26194b2 100644 --- a/gen/cloudresourcemanager1/Cargo.toml +++ b/gen/cloudresourcemanager1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-cloudresourcemanager1" -version = "1.0.4+20161212" +version = "1.0.4+20170517" 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.4+20161212" +documentation = "https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517" license = "MIT" keywords = ["cloudresourcemanager", "google", "protocol", "web", "api"] diff --git a/gen/cloudresourcemanager1/README.md b/gen/cloudresourcemanager1/README.md index cb00cd3746..8c886e5422 100644 --- a/gen/cloudresourcemanager1/README.md +++ b/gen/cloudresourcemanager1/README.md @@ -5,20 +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.4+20161212*, where *20161212* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Cloud Resource Manager* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161212/google_cloudresourcemanager1/struct.CloudResourceManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.CloudResourceManager.html) ... -* [operations](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.Operation.html) - * [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.OperationGetCall.html) -* [organizations](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.Organization.html) - * [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.OrganizationGetCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.OrganizationGetIamPolicyCall.html), [*search*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.OrganizationSearchCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.OrganizationSetIamPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.OrganizationTestIamPermissionCall.html) -* [projects](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.Project.html) - * [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.ProjectGetAncestryCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.ProjectGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.ProjectListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.ProjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/struct.ProjectUpdateCall.html) +* folders + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.FolderClearOrgPolicyCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.FolderGetEffectiveOrgPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.FolderGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.FolderListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.FolderListOrgPolicyCall.html) and [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.FolderSetOrgPolicyCall.html) +* [liens](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.Lien.html) + * [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.LienCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.LienDeleteCall.html) and [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.LienListCall.html) +* [operations](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.Operation.html) + * [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OperationGetCall.html) +* [organizations](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.Organization.html) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationClearOrgPolicyCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationGetCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationGetOrgPolicyCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationListOrgPolicyCall.html), [*search*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationSearchCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationSetOrgPolicyCall.html) and [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.OrganizationTestIamPermissionCall.html) +* [projects](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.Project.html) + * [*clear org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectClearOrgPolicyCall.html), [*create*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectGetAncestryCall.html), [*get effective org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectGetEffectiveOrgPolicyCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectGetIamPolicyCall.html), [*get org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectGetOrgPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectListCall.html), [*list available org policy constraints*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectListAvailableOrgPolicyConstraintCall.html), [*list org policies*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectListOrgPolicyCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectSetIamPolicyCall.html), [*set org policy*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectSetOrgPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/struct.ProjectUpdateCall.html) @@ -27,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.4+20161212/google_cloudresourcemanager1/struct.CloudResourceManager.html)** +* **[Hub](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/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.4+20161212/google_cloudresourcemanager1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/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.4+20161212/google_cloudresourcemanager1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/google_cloudresourcemanager1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -53,14 +57,20 @@ Or specifically ... ```ignore let r = hub.projects().test_iam_permissions(...).doit() let r = hub.projects().undelete(...).doit() -let r = hub.projects().set_iam_policy(...).doit() +let r = hub.projects().list_org_policies(...).doit() +let r = hub.projects().get_effective_org_policy(...).doit() let r = hub.projects().get(...).doit() let r = hub.projects().get_ancestry(...).doit() let r = hub.projects().update(...).doit() let r = hub.projects().get_iam_policy(...).doit() let r = hub.projects().delete(...).doit() -let r = hub.projects().create(...).doit() let r = hub.projects().list(...).doit() +let r = hub.projects().create(...).doit() +let r = hub.projects().set_iam_policy(...).doit() +let r = hub.projects().get_org_policy(...).doit() +let r = hub.projects().set_org_policy(...).doit() +let r = hub.projects().list_available_org_policy_constraints(...).doit() +let r = hub.projects().clear_org_policy(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -131,17 +141,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/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.4+20170517/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.4+20161212/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.4+20170517/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.4+20161212/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.4+20170517/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.4+20161212/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.4+20170517/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")`. @@ -151,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-cloudresourcemanager1/1.0.4+20161212/google_cloudresourcemanager1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/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.4+20170517/google_cloudresourcemanager1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/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.4+20161212/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.4+20170517/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.4+20161212/google_cloudresourcemanager1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudresourcemanager1/1.0.4+20161212/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.4+20170517/google_cloudresourcemanager1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/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.4+20161212/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.4+20170517/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.4+20161212/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.4+20170517/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.4+20161212/google_cloudresourcemanager1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudresourcemanager1/1.0.4+20170517/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 9772dcf2fb..14aac2daf2 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.4+20161212*, where *20161212* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Cloud Resource Manager* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/resource-manager). @@ -11,12 +11,16 @@ //! //! Handle the following *Resources* with ease from the central [hub](struct.CloudResourceManager.html) ... //! +//! * folders +//! * [*clear org policy*](struct.FolderClearOrgPolicyCall.html), [*get effective org policy*](struct.FolderGetEffectiveOrgPolicyCall.html), [*get org policy*](struct.FolderGetOrgPolicyCall.html), [*list available org policy constraints*](struct.FolderListAvailableOrgPolicyConstraintCall.html), [*list org policies*](struct.FolderListOrgPolicyCall.html) and [*set org policy*](struct.FolderSetOrgPolicyCall.html) +//! * [liens](struct.Lien.html) +//! * [*create*](struct.LienCreateCall.html), [*delete*](struct.LienDeleteCall.html) and [*list*](struct.LienListCall.html) //! * [operations](struct.Operation.html) //! * [*get*](struct.OperationGetCall.html) //! * [organizations](struct.Organization.html) -//! * [*get*](struct.OrganizationGetCall.html), [*get iam policy*](struct.OrganizationGetIamPolicyCall.html), [*search*](struct.OrganizationSearchCall.html), [*set iam policy*](struct.OrganizationSetIamPolicyCall.html) and [*test iam permissions*](struct.OrganizationTestIamPermissionCall.html) +//! * [*clear org policy*](struct.OrganizationClearOrgPolicyCall.html), [*get*](struct.OrganizationGetCall.html), [*get effective org policy*](struct.OrganizationGetEffectiveOrgPolicyCall.html), [*get iam policy*](struct.OrganizationGetIamPolicyCall.html), [*get org policy*](struct.OrganizationGetOrgPolicyCall.html), [*list available org policy constraints*](struct.OrganizationListAvailableOrgPolicyConstraintCall.html), [*list org policies*](struct.OrganizationListOrgPolicyCall.html), [*search*](struct.OrganizationSearchCall.html), [*set iam policy*](struct.OrganizationSetIamPolicyCall.html), [*set org policy*](struct.OrganizationSetOrgPolicyCall.html) and [*test iam permissions*](struct.OrganizationTestIamPermissionCall.html) //! * [projects](struct.Project.html) -//! * [*create*](struct.ProjectCreateCall.html), [*delete*](struct.ProjectDeleteCall.html), [*get*](struct.ProjectGetCall.html), [*get ancestry*](struct.ProjectGetAncestryCall.html), [*get iam policy*](struct.ProjectGetIamPolicyCall.html), [*list*](struct.ProjectListCall.html), [*set iam policy*](struct.ProjectSetIamPolicyCall.html), [*test iam permissions*](struct.ProjectTestIamPermissionCall.html), [*undelete*](struct.ProjectUndeleteCall.html) and [*update*](struct.ProjectUpdateCall.html) +//! * [*clear org policy*](struct.ProjectClearOrgPolicyCall.html), [*create*](struct.ProjectCreateCall.html), [*delete*](struct.ProjectDeleteCall.html), [*get*](struct.ProjectGetCall.html), [*get ancestry*](struct.ProjectGetAncestryCall.html), [*get effective org policy*](struct.ProjectGetEffectiveOrgPolicyCall.html), [*get iam policy*](struct.ProjectGetIamPolicyCall.html), [*get org policy*](struct.ProjectGetOrgPolicyCall.html), [*list*](struct.ProjectListCall.html), [*list available org policy constraints*](struct.ProjectListAvailableOrgPolicyConstraintCall.html), [*list org policies*](struct.ProjectListOrgPolicyCall.html), [*set iam policy*](struct.ProjectSetIamPolicyCall.html), [*set org policy*](struct.ProjectSetOrgPolicyCall.html), [*test iam permissions*](struct.ProjectTestIamPermissionCall.html), [*undelete*](struct.ProjectUndeleteCall.html) and [*update*](struct.ProjectUpdateCall.html) //! //! //! @@ -53,14 +57,20 @@ //! ```ignore //! let r = hub.projects().test_iam_permissions(...).doit() //! let r = hub.projects().undelete(...).doit() -//! let r = hub.projects().set_iam_policy(...).doit() +//! let r = hub.projects().list_org_policies(...).doit() +//! let r = hub.projects().get_effective_org_policy(...).doit() //! let r = hub.projects().get(...).doit() //! let r = hub.projects().get_ancestry(...).doit() //! let r = hub.projects().update(...).doit() //! let r = hub.projects().get_iam_policy(...).doit() //! let r = hub.projects().delete(...).doit() -//! let r = hub.projects().create(...).doit() //! let r = hub.projects().list(...).doit() +//! let r = hub.projects().create(...).doit() +//! let r = hub.projects().set_iam_policy(...).doit() +//! let r = hub.projects().get_org_policy(...).doit() +//! let r = hub.projects().set_org_policy(...).doit() +//! let r = hub.projects().list_available_org_policy_constraints(...).doit() +//! let r = hub.projects().clear_org_policy(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -186,7 +196,7 @@ // 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 +// 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)] @@ -318,8 +328,6 @@ pub struct CloudResourceManager { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for CloudResourceManager {} @@ -332,11 +340,15 @@ impl<'a, C, A> CloudResourceManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://cloudresourcemanager.googleapis.com/".to_string(), - _root_url: "https://cloudresourcemanager.googleapis.com/".to_string(), } } + pub fn folders(&'a self) -> FolderMethods<'a, C, A> { + FolderMethods { hub: &self } + } + pub fn liens(&'a self) -> LienMethods<'a, C, A> { + LienMethods { hub: &self } + } pub fn operations(&'a self) -> OperationMethods<'a, C, A> { OperationMethods { hub: &self } } @@ -356,86 +368,12 @@ impl<'a, C, A> CloudResourceManager self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://cloudresourcemanager.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://cloudresourcemanager.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// The request sent to the UndeleteProject -/// method. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [undelete projects](struct.ProjectUndeleteCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UndeleteProjectRequest { _never_set: Option } - -impl RequestValue for UndeleteProjectRequest {} - - -/// 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*). -/// -/// * [get iam policy projects](struct.ProjectGetIamPolicyCall.html) (request) -/// * [get iam policy organizations](struct.OrganizationGetIamPolicyCall.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*). -/// -/// * [test iam permissions organizations](struct.OrganizationTestIamPermissionCall.html) (request) -/// * [test iam permissions projects](struct.ProjectTestIamPermissionCall.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 {} - - /// The response returned from the `SearchOrganizations` method. /// /// # Activities @@ -479,137 +417,77 @@ pub struct SetIamPolicyRequest { /// 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 {} -/// Response from the GetAncestry method. +/// Associates `members` with a `role`. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get ancestry projects](struct.ProjectGetAncestryCall.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 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 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 ResponseResult for GetAncestryResponse {} +impl Part for Binding {} -/// A Project is a high-level Google Cloud Platform entity. It is a -/// container for ACLs, APIs, AppEngine Apps, VMs, and other -/// Google Cloud Platform resources. +/// Ignores policies set above this resource and restores the +/// `constraint_default` enforcement behavior of the specific `Constraint` at +/// this resource. /// -/// # Activities +/// 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. /// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [test iam permissions projects](struct.ProjectTestIamPermissionCall.html) (none) -/// * [undelete projects](struct.ProjectUndeleteCall.html) (none) -/// * [set iam policy projects](struct.ProjectSetIamPolicyCall.html) (none) -/// * [get projects](struct.ProjectGetCall.html) (response) -/// * [get ancestry projects](struct.ProjectGetAncestryCall.html) (none) -/// * [update projects](struct.ProjectUpdateCall.html) (request|response) -/// * [get iam policy projects](struct.ProjectGetIamPolicyCall.html) (none) -/// * [delete projects](struct.ProjectDeleteCall.html) (none) -/// * [create projects](struct.ProjectCreateCall.html) (request) -/// * [list projects](struct.ProjectListCall.html) (none) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Project { - /// The user-assigned display name of the Project. - /// It must be 4 to 30 characters. - /// Allowed characters are: lowercase and uppercase letters, numbers, - /// hyphen, single-quote, double-quote, space, and exclamation point. - /// - /// Example: My Project - /// - /// Read-write. - pub name: Option, - /// An optional reference to a parent Resource. - /// - /// The only supported parent type is "organization". Once set, the parent - /// cannot be modified. The `parent` can be set on creation or using the - /// `UpdateProject` method; the end user must have the - /// `resourcemanager.projects.create` permission on the parent. - /// - /// Read-write. - pub parent: Option, - /// The unique, user-assigned ID of the Project. - /// It must be 6 to 30 lowercase letters, digits, or hyphens. - /// It must start with a letter. - /// Trailing hyphens are prohibited. - /// - /// Example: tokyo-rain-123 - /// - /// Read-only after creation. - #[serde(rename="projectId")] - pub project_id: Option, - /// The labels associated with this Project. - /// - /// Label keys must be between 1 and 63 characters long and must conform - /// to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. - /// - /// Label values must be between 0 and 63 characters long and must conform - /// to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. - /// - /// No more than 256 labels can be associated with a given resource. - /// - /// Clients should store labels in a representation such as JSON that does not - /// depend on specific characters being disallowed. - /// - /// Example: "environment" : "dev" - /// - /// Read-write. - pub labels: Option>, - /// 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, - /// The Project lifecycle state. - /// - /// Read-only. - #[serde(rename="lifecycleState")] - pub lifecycle_state: Option, -} +pub struct RestoreDefault { _never_set: Option } -impl RequestValue for Project {} -impl Resource for Project {} -impl ResponseResult for Project {} - - -/// The request sent to 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*). -/// -/// * [get ancestry projects](struct.ProjectGetAncestryCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetAncestryRequest { _never_set: Option } - -impl RequestValue for GetAncestryRequest {} +impl Part for RestoreDefault {} /// Defines an Identity and Access Management (IAM) policy. It is used to @@ -671,6 +549,9 @@ pub struct Policy { /// If no `etag` is provided in the call to `setIamPolicy`, then the existing /// policy is overwritten blindly. pub etag: Option, + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, /// Version of the `Policy`. The default version is 0. pub version: Option, } @@ -678,50 +559,6 @@ pub struct Policy { impl ResponseResult for Policy {} -/// The root node in the resource hierarchy to which a particular entity's -/// (e.g., company) resources belong. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [test iam permissions organizations](struct.OrganizationTestIamPermissionCall.html) (none) -/// * [search organizations](struct.OrganizationSearchCall.html) (none) -/// * [set iam policy organizations](struct.OrganizationSetIamPolicyCall.html) (none) -/// * [get organizations](struct.OrganizationGetCall.html) (response) -/// * [get iam policy organizations](struct.OrganizationGetIamPolicyCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Organization { - /// The owner of this Organization. The owner should be specified on - /// creation. Once set, it cannot be changed. - /// This field is required. - pub owner: Option, - /// A friendly string to be used to refer to the Organization in the UI. - /// Assigned by the server, set to the firm name of the Google For Work - /// customer that owns this organization. - /// @OutputOnly - #[serde(rename="displayName")] - pub display_name: Option, - /// Timestamp when the Organization was created. Assigned by the server. - /// @OutputOnly - #[serde(rename="creationTime")] - pub creation_time: Option, - /// The organization's current lifecycle state. Assigned by the server. - /// @OutputOnly - #[serde(rename="lifecycleState")] - pub lifecycle_state: Option, - /// Output Only. The resource name of the organization. This is the - /// organization's relative path in the API. Its format is - /// "organizations/[organization_id]". For example, "organizations/1234". - pub name: Option, -} - -impl Resource for Organization {} -impl ResponseResult for Organization {} - - /// Identifying information for a single ancestor of a project. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -751,8 +588,12 @@ impl Part for Ancestor {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [delete projects](struct.ProjectDeleteCall.html) (response) +/// * [clear org policy folders](struct.FolderClearOrgPolicyCall.html) (response) /// * [undelete projects](struct.ProjectUndeleteCall.html) (response) +/// * [delete projects](struct.ProjectDeleteCall.html) (response) +/// * [delete liens](struct.LienDeleteCall.html) (response) +/// * [clear org policy organizations](struct.OrganizationClearOrgPolicyCall.html) (response) +/// * [clear org policy projects](struct.ProjectClearOrgPolicyCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Empty { _never_set: Option } @@ -777,7 +618,7 @@ impl ResponseResult for Empty {} /// 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` which can be used for common error conditions. +/// in the package `google.rpc` that can be used for common error conditions. /// /// # Language mapping /// @@ -800,7 +641,7 @@ impl ResponseResult for Empty {} /// errors. /// /// - Workflow errors. A typical workflow has multiple steps. Each step may -/// have a `Status` message for error reporting purpose. +/// 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 @@ -889,9 +730,57 @@ pub struct ListProjectsResponse { impl ResponseResult for ListProjectsResponse {} +/// The response returned from the ListAvailableOrgPolicyConstraints method. +/// Returns all `Constraints` that could be set at this level of the hierarchy +/// (contrast with the response from `ListPolicies`, which returns all policies +/// which are set). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list available org policy constraints folders](struct.FolderListAvailableOrgPolicyConstraintCall.html) (response) +/// * [list available org policy constraints projects](struct.ProjectListAvailableOrgPolicyConstraintCall.html) (response) +/// * [list available org policy constraints organizations](struct.OrganizationListAvailableOrgPolicyConstraintCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListAvailableOrgPolicyConstraintsResponse { + /// Page token used to retrieve the next page. This is currently not used. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The collection of constraints that are settable on the request resource. + pub constraints: Option>, +} + +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 AppEngine app, +/// interact with through one of our API's. Some examples are an App Engine app, /// a Compute Engine instance, a Cloud SQL database, and so on. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -899,7 +788,7 @@ impl ResponseResult for ListProjectsResponse {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ResourceId { /// Required field representing the resource type this id is for. - /// At present, the only valid type is "organization". + /// At present, the valid types are: "organization" #[serde(rename="type")] pub type_: Option, /// Required field for the type-specific id. This should correspond to the id @@ -910,43 +799,835 @@ pub struct ResourceId { impl Part for ResourceId {} -/// Associates `members` with a `role`. +/// Used in `policy_type` to specify how `list_policy` behaves at this +/// resource. +/// +/// A `ListPolicy` can define specific values that are allowed or denied by +/// setting either the `allowed_values` or `denied_values` fields. It can also +/// be used to allow or deny all values, by setting the `all_values` field. If +/// `all_values` is `ALL_VALUES_UNSPECIFIED`, exactly one of `allowed_values` +/// or `denied_values` must be set (attempting to set both or neither will +/// result in a failed request). If `all_values` is set to either `ALLOW` or +/// `DENY`, `allowed_values` and `denied_values` must be unset. /// /// 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: +pub struct ListPolicy { + /// The policy all_values state. + #[serde(rename="allValues")] + pub all_values: Option, + /// List of values allowed at this resource. an only be set if no values are + /// set for `denied_values` and `all_values` is set to + /// `ALL_VALUES_UNSPECIFIED`. + #[serde(rename="allowedValues")] + pub allowed_values: Option>, + /// Determines the inheritance behavior for this `Policy`. /// - /// * `allUsers`: A special identifier that represents anyone who is - /// on the internet; with or without a Google account. + /// By default, a `ListPolicy` set at a resource supercedes any `Policy` set + /// anywhere up the resource hierarchy. However, if `inherit_from_parent` is + /// set to `true`, then the values from the effective `Policy` of the parent + /// resource are inherited, meaning the values set in this `Policy` are + /// added to the values inherited up the hierarchy. /// - /// * `allAuthenticatedUsers`: A special identifier that represents anyone - /// who is authenticated with a Google account or a service account. + /// Setting `Policy` hierarchies that inherit both allowed values and denied + /// values isn't recommended in most circumstances to keep the configuration + /// simple and understandable. However, it is possible to set a `Policy` with + /// `allowed_values` set that inherits a `Policy` with `denied_values` set. + /// In this case, the values that are allowed must be in `allowed_values` and + /// not present in `denied_values`. /// - /// * `user:{emailid}`: An email address that represents a specific Google - /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// For example, suppose you have a `Constraint` + /// `constraints/serviceuser.services`, which has a `constraint_type` of + /// `list_constraint`, and with `constraint_default` set to `ALLOW`. + /// Suppose that at the Organization level, a `Policy` is applied that + /// restricts the allowed API activations to {`E1`, `E2`}. Then, if a + /// `Policy` is applied to a project below the Organization that has + /// `inherit_from_parent` set to `false` and field all_values set to DENY, + /// then an attempt to activate any API will be denied. /// + /// The following examples demonstrate different possible layerings: /// - /// * `serviceAccount:{emailid}`: An email address that represents a service - /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// Example 1 (no inherited values): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: “E1” allowed_values:”E2”} + /// ``projects/bar`` has `inherit_from_parent` `false` and values: + /// {allowed_values: "E3" allowed_values: "E4"} + /// The accepted values at `organizations/foo` are `E1`, `E2`. + /// The accepted values at `projects/bar` are `E3`, and `E4`. /// - /// * `group:{emailid}`: An email address that represents a Google group. - /// For example, `admins@example.com`. + /// Example 2 (inherited values): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: “E1” allowed_values:”E2”} + /// `projects/bar` has a `Policy` with values: + /// {value: “E3” value: ”E4” inherit_from_parent: true} + /// The accepted values at `organizations/foo` are `E1`, `E2`. + /// The accepted values at `projects/bar` are `E1`, `E2`, `E3`, and `E4`. /// - /// * `domain:{domain}`: A Google Apps domain name that represents all the - /// users of that domain. For example, `google.com` or `example.com`. + /// Example 3 (inheriting both allowed and denied values): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: "E1" allowed_values: "E2"} + /// `projects/bar` has a `Policy` with: + /// {denied_values: "E1"} + /// The accepted values at `organizations/foo` are `E1`, `E2`. + /// The value accepted at `projects/bar` is `E2`. /// + /// Example 4 (RestoreDefault): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: “E1” allowed_values:”E2”} + /// `projects/bar` has a `Policy` with values: + /// {RestoreDefault: {}} + /// The accepted values at `organizations/foo` are `E1`, `E2`. + /// The accepted values at `projects/bar` are either all or none depending on + /// the value of `constraint_default` (if `ALLOW`, all; if + /// `DENY`, none). /// - pub members: Option>, + /// Example 5 (no policy inherits parent policy): + /// `organizations/foo` has no `Policy` set. + /// `projects/bar` has no `Policy` set. + /// The accepted values at both levels are either all or none depending on + /// the value of `constraint_default` (if `ALLOW`, all; if + /// `DENY`, none). + /// + /// Example 6 (ListConstraint allowing all): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: “E1” allowed_values: ”E2”} + /// `projects/bar` has a `Policy` with: + /// {all: ALLOW} + /// The accepted values at `organizations/foo` are `E1`, E2`. + /// Any value is accepted at `projects/bar`. + /// + /// Example 7 (ListConstraint allowing none): + /// `organizations/foo` has a `Policy` with values: + /// {allowed_values: “E1” allowed_values: ”E2”} + /// `projects/bar` has a `Policy` with: + /// {all: DENY} + /// The accepted values at `organizations/foo` are `E1`, E2`. + /// No value is accepted at `projects/bar`. + #[serde(rename="inheritFromParent")] + pub inherit_from_parent: Option, + /// Optional. The Google Cloud Console will try to default to a configuration + /// that matches the value specified in this `Policy`. If `suggested_value` + /// is not set, it will inherit the value specified higher in the hierarchy, + /// unless `inherit_from_parent` is `false`. + #[serde(rename="suggestedValue")] + pub suggested_value: Option, + /// List of values denied at this resource. Can only be set if no values are + /// set for `allowed_values` and `all_values` is set to + /// `ALL_VALUES_UNSPECIFIED`. + #[serde(rename="deniedValues")] + pub denied_values: Option>, } -impl Part for Binding {} +impl Part for ListPolicy {} + + +/// Used in `policy_type` to specify how `boolean_policy` will behave at this +/// resource. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BooleanPolicy { + /// If `true`, then the `Policy` is enforced. If `false`, then any + /// configuration is acceptable. + /// + /// Suppose you have a `Constraint` `constraints/compute.disableSerialPortAccess` + /// with `constraint_default` set to `ALLOW`. A `Policy` for that + /// `Constraint` exhibits the following behavior: + /// - If the `Policy` at this resource has enforced set to `false`, serial + /// port connection attempts will be allowed. + /// - If the `Policy` at this resource has enforced set to `true`, serial + /// port connection attempts will be refused. + /// - If the `Policy` at this resource is `RestoreDefault`, serial port + /// connection attempts will be allowed. + /// - If no `Policy` is set at this resource or anywhere higher in the + /// resource hierarchy, serial port connection attempts will be allowed. + /// - If no `Policy` is set at this resource, but one exists higher in the + /// resource hierarchy, the behavior is as if the`Policy` were set at + /// this resource. + /// + /// The following examples demonstrate the different possible layerings: + /// + /// Example 1 (nearest `Constraint` wins): + /// `organizations/foo` has a `Policy` with: + /// {enforced: false} + /// `projects/bar` has no `Policy` set. + /// The constraint at `projects/bar` and `organizations/foo` will not be + /// enforced. + /// + /// Example 2 (enforcement gets replaced): + /// `organizations/foo` has a `Policy` with: + /// {enforced: false} + /// `projects/bar` has a `Policy` with: + /// {enforced: true} + /// The constraint at `organizations/foo` is not enforced. + /// The constraint at `projects/bar` is enforced. + /// + /// Example 3 (RestoreDefault): + /// `organizations/foo` has a `Policy` with: + /// {enforced: true} + /// `projects/bar` has a `Policy` with: + /// {RestoreDefault: {}} + /// The constraint at `organizations/foo` is enforced. + /// The constraint at `projects/bar` is not enforced, because + /// `constraint_default` for the `Constraint` is `ALLOW`. + pub enforced: Option, +} + +impl Part for BooleanPolicy {} + + +/// 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*). +/// +/// * [set org policy folders](struct.FolderSetOrgPolicyCall.html) (response) +/// * [get org policy organizations](struct.OrganizationGetOrgPolicyCall.html) (response) +/// * [get effective org policy projects](struct.ProjectGetEffectiveOrgPolicyCall.html) (response) +/// * [set org policy organizations](struct.OrganizationSetOrgPolicyCall.html) (response) +/// * [get effective org policy folders](struct.FolderGetEffectiveOrgPolicyCall.html) (response) +/// * [get org policy folders](struct.FolderGetOrgPolicyCall.html) (response) +/// * [get effective org policy organizations](struct.OrganizationGetEffectiveOrgPolicyCall.html) (response) +/// * [get org policy projects](struct.ProjectGetOrgPolicyCall.html) (response) +/// * [set org policy projects](struct.ProjectSetOrgPolicyCall.html) (response) +/// +#[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, +} + +impl ResponseResult for OrgPolicy {} + + +/// The request sent to the SetOrgPolicyRequest method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [set org policy folders](struct.FolderSetOrgPolicyCall.html) (request) +/// * [set org policy organizations](struct.OrganizationSetOrgPolicyCall.html) (request) +/// * [set org policy projects](struct.ProjectSetOrgPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetOrgPolicyRequest { + /// `Policy` to set on the resource. + pub policy: Option, +} + +impl RequestValue for SetOrgPolicyRequest {} + + +/// Provides the configuration for logging a type of permissions. +/// Example: +/// +/// { +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:foo@gmail.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// } +/// ] +/// } +/// +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +/// foo@gmail.com from DATA_READ logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// Follows the same format of Binding.members. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, +} + +impl Part for AuditLogConfig {} + + +/// Request message for `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*). +/// +/// * [get iam policy projects](struct.ProjectGetIamPolicyCall.html) (request) +/// * [get iam policy organizations](struct.OrganizationGetIamPolicyCall.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*). +/// +/// * [test iam permissions organizations](struct.OrganizationTestIamPermissionCall.html) (request) +/// * [test iam permissions projects](struct.ProjectTestIamPermissionCall.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 {} + + +/// A `Constraint` describes a way in which a resource's configuration can be +/// restricted. For example, it controls which cloud services can be activated +/// across an organization, or whether a Compute Engine instance can have +/// serial port connections established. `Constraints` can be configured by the +/// organization's policy adminstrator to fit the needs of the organzation by +/// setting Policies for `Constraints` at different locations in the +/// organization's resource hierarchy. Policies are inherited down the resource +/// hierarchy from higher levels, but can also be overridden. For details about +/// the inheritance rules please read about +/// Policies. +/// +/// `Constraints` have a default behavior determined by the `constraint_default` +/// field, which is the enforcement behavior that is used in the absence of a +/// `Policy` being defined or inherited for the resource 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 Constraint { + /// The evaluation behavior of this constraint in the absense of 'Policy'. + #[serde(rename="constraintDefault")] + pub constraint_default: Option, + /// Version of the `Constraint`. Default version is 0; + pub version: Option, + /// The human readable name. + /// + /// Mutable. + #[serde(rename="displayName")] + pub display_name: Option, + /// Detailed description of what this `Constraint` controls as well as how and + /// where it is enforced. + /// + /// Mutable. + pub description: Option, + /// Defines this constraint as being a BooleanConstraint. + #[serde(rename="booleanConstraint")] + pub boolean_constraint: Option, + /// Defines this constraint as being a ListConstraint. + #[serde(rename="listConstraint")] + pub list_constraint: Option, + /// Immutable value, required to globally be unique. For example, + /// `constraints/serviceuser.services` + pub name: Option, +} + +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 {} + + +/// 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*). +/// +/// * [get ancestry projects](struct.ProjectGetAncestryCall.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>, +} + +impl ResponseResult for GetAncestryResponse {} + + +/// A Project is a high-level Google Cloud Platform entity. It is a +/// container for ACLs, APIs, App Engine Apps, VMs, and other +/// Google Cloud Platform resources. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [test iam permissions projects](struct.ProjectTestIamPermissionCall.html) (none) +/// * [undelete projects](struct.ProjectUndeleteCall.html) (none) +/// * [list org policies projects](struct.ProjectListOrgPolicyCall.html) (none) +/// * [get effective org policy projects](struct.ProjectGetEffectiveOrgPolicyCall.html) (none) +/// * [get projects](struct.ProjectGetCall.html) (response) +/// * [get ancestry projects](struct.ProjectGetAncestryCall.html) (none) +/// * [update projects](struct.ProjectUpdateCall.html) (request|response) +/// * [get iam policy projects](struct.ProjectGetIamPolicyCall.html) (none) +/// * [delete projects](struct.ProjectDeleteCall.html) (none) +/// * [list projects](struct.ProjectListCall.html) (none) +/// * [create projects](struct.ProjectCreateCall.html) (request) +/// * [set iam policy projects](struct.ProjectSetIamPolicyCall.html) (none) +/// * [get org policy projects](struct.ProjectGetOrgPolicyCall.html) (none) +/// * [set org policy projects](struct.ProjectSetOrgPolicyCall.html) (none) +/// * [list available org policy constraints projects](struct.ProjectListAvailableOrgPolicyConstraintCall.html) (none) +/// * [clear org policy projects](struct.ProjectClearOrgPolicyCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Project { + /// The user-assigned display name of the Project. + /// It must be 4 to 30 characters. + /// Allowed characters are: lowercase and uppercase letters, numbers, + /// hyphen, single-quote, double-quote, space, and exclamation point. + /// + /// Example: My Project + /// Read-write. + pub name: Option, + /// An optional reference to a parent Resource. + /// + /// The only supported parent type is "organization". Once set, the parent + /// cannot be modified. The `parent` can be set on creation or using the + /// `UpdateProject` method; the end user must have the + /// `resourcemanager.projects.create` permission on the parent. + /// + /// Read-write. + pub parent: Option, + /// The unique, user-assigned ID of the Project. + /// It must be 6 to 30 lowercase letters, digits, or hyphens. + /// It must start with a letter. + /// Trailing hyphens are prohibited. + /// + /// Example: tokyo-rain-123 + /// Read-only after creation. + #[serde(rename="projectId")] + pub project_id: Option, + /// The labels associated with this Project. + /// + /// Label keys must be between 1 and 63 characters long and must conform + /// to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?. + /// + /// Label values must be between 0 and 63 characters long and must conform + /// to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?. + /// + /// No more than 256 labels can be associated with a given resource. + /// + /// Clients should store labels in a representation such as JSON that does not + /// depend on specific characters being disallowed. + /// + /// Example: "environment" : "dev" + /// Read-write. + pub labels: Option>, + /// 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, + /// The Project lifecycle state. + /// + /// Read-only. + #[serde(rename="lifecycleState")] + pub lifecycle_state: Option, +} + +impl RequestValue for Project {} +impl Resource for Project {} +impl ResponseResult for Project {} + + +/// The request sent to the UndeleteProject +/// method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [undelete projects](struct.ProjectUndeleteCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UndeleteProjectRequest { _never_set: Option } + +impl RequestValue for UndeleteProjectRequest {} + + +/// The request sent to the +/// GetAncestry +/// method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +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. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 iam policy organizations](struct.OrganizationSetIamPolicyCall.html) (none) +/// * [get iam policy organizations](struct.OrganizationGetIamPolicyCall.html) (none) +/// * [get org policy organizations](struct.OrganizationGetOrgPolicyCall.html) (none) +/// * [test iam permissions organizations](struct.OrganizationTestIamPermissionCall.html) (none) +/// * [get effective org policy organizations](struct.OrganizationGetEffectiveOrgPolicyCall.html) (none) +/// * [set org policy organizations](struct.OrganizationSetOrgPolicyCall.html) (none) +/// * [get organizations](struct.OrganizationGetCall.html) (response) +/// * [list available org policy constraints organizations](struct.OrganizationListAvailableOrgPolicyConstraintCall.html) (none) +/// * [search organizations](struct.OrganizationSearchCall.html) (none) +/// * [list org policies organizations](struct.OrganizationListOrgPolicyCall.html) (none) +/// * [clear org policy organizations](struct.OrganizationClearOrgPolicyCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Organization { + /// The owner of this Organization. The owner should be specified on + /// creation. Once set, it cannot be changed. + /// This field is required. + pub owner: Option, + /// A friendly string to be used to refer to the Organization in the UI. + /// Assigned by the server, set to the primary domain of the G Suite + /// customer that owns the organization. + /// @OutputOnly + #[serde(rename="displayName")] + pub display_name: Option, + /// Timestamp when the Organization was created. Assigned by the server. + /// @OutputOnly + #[serde(rename="creationTime")] + pub creation_time: Option, + /// The organization's current lifecycle state. Assigned by the server. + /// @OutputOnly + #[serde(rename="lifecycleState")] + pub lifecycle_state: Option, + /// Output Only. The resource name of the organization. This is the + /// organization's relative path in the API. Its format is + /// "organizations/[organization_id]". For example, "organizations/1234". + pub name: Option, +} + +impl Resource for Organization {} +impl ResponseResult for Organization {} + + +/// A `Constraint` that allows or disallows a list of string values, which are +/// configured by an Organization's policy administrator with a `Policy`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[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, +} + +impl Part for ListConstraint {} + + +/// The request sent to the GetOrgPolicy method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get org policy projects](struct.ProjectGetOrgPolicyCall.html) (request) +/// * [get org policy folders](struct.FolderGetOrgPolicyCall.html) (request) +/// * [get org policy organizations](struct.OrganizationGetOrgPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetOrgPolicyRequest { + /// Name of the `Constraint` to get the `Policy`. + pub constraint: Option, +} + +impl RequestValue for GetOrgPolicyRequest {} + + +/// The request sent to the [ListAvailableOrgPolicyConstraints] +/// google.cloud.OrgPolicy.v1.ListAvailableOrgPolicyConstraints] 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*). +/// +/// * [list available org policy constraints folders](struct.FolderListAvailableOrgPolicyConstraintCall.html) (request) +/// * [list available org policy constraints projects](struct.ProjectListAvailableOrgPolicyConstraintCall.html) (request) +/// * [list available org policy constraints organizations](struct.OrganizationListAvailableOrgPolicyConstraintCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListAvailableOrgPolicyConstraintsRequest { + /// Page token used to retrieve the next page. This is currently unsupported + /// and will be ignored. The server may at any point start using this field. + #[serde(rename="pageToken")] + pub page_token: Option, + /// Size of the pages to be returned. This is currently unsupported and will + /// be ignored. The server may at any point start using this field to limit + /// page size. + #[serde(rename="pageSize")] + pub page_size: Option, +} + +impl RequestValue for ListAvailableOrgPolicyConstraintsRequest {} + + +/// The request sent to the ListOrgPolicies 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*). +/// +/// * [list org policies organizations](struct.OrganizationListOrgPolicyCall.html) (request) +/// * [list org policies projects](struct.ProjectListOrgPolicyCall.html) (request) +/// * [list org policies folders](struct.FolderListOrgPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOrgPoliciesRequest { + /// Page token used to retrieve the next page. This is currently unsupported + /// and will be ignored. The server may at any point start using this field. + #[serde(rename="pageToken")] + pub page_token: Option, + /// Size of the pages to be returned. This is currently unsupported and will + /// be ignored. The server may at any point start using this field to limit + /// page size. + #[serde(rename="pageSize")] + pub page_size: Option, +} + +impl RequestValue for ListOrgPoliciesRequest {} + + +/// 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 {} + + +/// 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 { + /// 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 {} /// The request sent to the `SearchOrganizations` method. @@ -1032,6 +1713,52 @@ impl Resource for Operation {} impl ResponseResult for Operation {} +/// The request sent to the GetEffectiveOrgPolicy method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get effective org policy folders](struct.FolderGetEffectiveOrgPolicyCall.html) (request) +/// * [get effective org policy organizations](struct.OrganizationGetEffectiveOrgPolicyCall.html) (request) +/// * [get effective org policy projects](struct.ProjectGetEffectiveOrgPolicyCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetEffectiveOrgPolicyRequest { + /// The name of the `Constraint` to compute the effective `Policy`. + pub constraint: Option, +} + +impl RequestValue for GetEffectiveOrgPolicyRequest {} + + +/// 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 entity that owns an Organization. The lifetime of the Organization and /// all of its descendants are bound to the `OrganizationOwner`. If the /// `OrganizationOwner` is deleted, the Organization and all its descendants will @@ -1054,6 +1781,984 @@ impl Part for OrganizationOwner {} // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *folder* resources. +/// It is not used directly, but through the `CloudResourceManager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudresourcemanager1::CloudResourceManager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `clear_org_policy(...)`, `get_effective_org_policy(...)`, `get_org_policy(...)`, `list_available_org_policy_constraints(...)`, `list_org_policies(...)` and `set_org_policy(...)` +/// // to build up your call. +/// let rb = hub.folders(); +/// # } +/// ``` +pub struct FolderMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, +} + +impl<'a, C, A> MethodsBuilder for FolderMethods<'a, C, A> {} + +impl<'a, C, A> FolderMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets the effective `Policy` on a resource. This is the result of merging + /// `Policies` in the resource hierarchy. The returned `Policy` will not have + /// an `etag`set because it is a computed `Policy` across multiple resources. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - The name of the resource to start computing the effective `Policy`. + pub fn get_effective_org_policy(&self, request: GetEffectiveOrgPolicyRequest, resource: &str) -> FolderGetEffectiveOrgPolicyCall<'a, C, A> { + FolderGetEffectiveOrgPolicyCall { + 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: + /// + /// Clears a `Policy` from a resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource for the `Policy` to clear. + pub fn clear_org_policy(&self, request: ClearOrgPolicyRequest, resource: &str) -> FolderClearOrgPolicyCall<'a, C, A> { + FolderClearOrgPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists `Constraints` that could be applied on the specified resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource to list `Constraints` for. + pub fn list_available_org_policy_constraints(&self, request: ListAvailableOrgPolicyConstraintsRequest, resource: &str) -> FolderListAvailableOrgPolicyConstraintCall<'a, C, A> { + FolderListAvailableOrgPolicyConstraintCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a `Policy` on a resource. + /// + /// If no `Policy` is set on the resource, a `Policy` is returned with default + /// values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + /// `etag` value can be used with `SetOrgPolicy()` to create or update a + /// `Policy` during read-modify-write. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource the `Policy` is set on. + pub fn get_org_policy(&self, request: GetOrgPolicyRequest, resource: &str) -> FolderGetOrgPolicyCall<'a, C, A> { + FolderGetOrgPolicyCall { + 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 the specified `Policy` on the resource. Creates a new `Policy` for + /// that `Constraint` on the resource if one does not exist. + /// + /// Not supplying an `etag` on the request `Policy` results in an unconditional + /// write of the `Policy`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Resource name of the resource to attach the `Policy`. + pub fn set_org_policy(&self, request: SetOrgPolicyRequest, resource: &str) -> FolderSetOrgPolicyCall<'a, C, A> { + FolderSetOrgPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all the `Policies` set for a particular resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource to list Policies for. + pub fn list_org_policies(&self, request: ListOrgPoliciesRequest, resource: &str) -> FolderListOrgPolicyCall<'a, C, A> { + FolderListOrgPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *organization* resources. +/// It is not used directly, but through the `CloudResourceManager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudresourcemanager1::CloudResourceManager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `clear_org_policy(...)`, `get(...)`, `get_effective_org_policy(...)`, `get_iam_policy(...)`, `get_org_policy(...)`, `list_available_org_policy_constraints(...)`, `list_org_policies(...)`, `search(...)`, `set_iam_policy(...)`, `set_org_policy(...)` and `test_iam_permissions(...)` +/// // to build up your call. +/// let rb = hub.organizations(); +/// # } +/// ``` +pub struct OrganizationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, +} + +impl<'a, C, A> MethodsBuilder for OrganizationMethods<'a, C, A> {} + +impl<'a, C, A> OrganizationMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Clears a `Policy` from a resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource for the `Policy` to clear. + pub fn clear_org_policy(&self, request: ClearOrgPolicyRequest, resource: &str) -> OrganizationClearOrgPolicyCall<'a, C, A> { + OrganizationClearOrgPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a `Policy` on a resource. + /// + /// If no `Policy` is set on the resource, a `Policy` is returned with default + /// values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + /// `etag` value can be used with `SetOrgPolicy()` to create or update a + /// `Policy` during read-modify-write. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource the `Policy` is set on. + pub fn get_org_policy(&self, request: GetOrgPolicyRequest, resource: &str) -> OrganizationGetOrgPolicyCall<'a, C, A> { + OrganizationGetOrgPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists `Constraints` that could be applied on the specified resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource to list `Constraints` for. + pub fn list_available_org_policy_constraints(&self, request: ListAvailableOrgPolicyConstraintsRequest, resource: &str) -> OrganizationListAvailableOrgPolicyConstraintCall<'a, C, A> { + OrganizationListAvailableOrgPolicyConstraintCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all the `Policies` set for a particular resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource to list Policies for. + pub fn list_org_policies(&self, request: ListOrgPoliciesRequest, resource: &str) -> OrganizationListOrgPolicyCall<'a, C, A> { + OrganizationListOrgPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the access control policy on an Organization resource. Replaces any + /// existing policy. The `resource` field should be the organization's resource + /// name, e.g. "organizations/123". + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> OrganizationSetIamPolicyCall<'a, C, A> { + OrganizationSetIamPolicyCall { + 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: + /// + /// Fetches an Organization resource identified by the specified resource name. + /// + /// # Arguments + /// + /// * `name` - The resource name of the Organization to fetch, e.g. "organizations/1234". + pub fn get(&self, name: &str) -> OrganizationGetCall<'a, C, A> { + OrganizationGetCall { + 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 effective `Policy` on a resource. This is the result of merging + /// `Policies` in the resource hierarchy. The returned `Policy` will not have + /// an `etag`set because it is a computed `Policy` across multiple resources. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - The name of the resource to start computing the effective `Policy`. + pub fn get_effective_org_policy(&self, request: GetEffectiveOrgPolicyRequest, resource: &str) -> OrganizationGetEffectiveOrgPolicyCall<'a, C, A> { + OrganizationGetEffectiveOrgPolicyCall { + 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: + /// + /// Searches Organization resources that are visible to the user and satisfy + /// the specified filter. This method returns Organizations in an unspecified + /// order. New Organizations do not necessarily appear at the end of the + /// results. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn search(&self, request: SearchOrganizationsRequest) -> OrganizationSearchCall<'a, C, A> { + OrganizationSearchCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the access control policy for an Organization resource. May be empty + /// if no such policy or resource exists. The `resource` field should be the + /// organization's resource name, e.g. "organizations/123". + /// + /// # 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 get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> OrganizationGetIamPolicyCall<'a, C, A> { + OrganizationGetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified Organization. + /// The `resource` field should be the organization's resource name, + /// e.g. "organizations/123". + /// + /// # 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 test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> OrganizationTestIamPermissionCall<'a, C, A> { + OrganizationTestIamPermissionCall { + 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 the specified `Policy` on the resource. Creates a new `Policy` for + /// that `Constraint` on the resource if one does not exist. + /// + /// Not supplying an `etag` on the request `Policy` results in an unconditional + /// write of the `Policy`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Resource name of the resource to attach the `Policy`. + pub fn set_org_policy(&self, request: SetOrgPolicyRequest, resource: &str) -> OrganizationSetOrgPolicyCall<'a, C, A> { + OrganizationSetOrgPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *lien* resources. +/// It is not used directly, but through the `CloudResourceManager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudresourcemanager1::CloudResourceManager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create(...)`, `delete(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.liens(); +/// # } +/// ``` +pub struct LienMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, +} + +impl<'a, C, A> MethodsBuilder for LienMethods<'a, C, A> {} + +impl<'a, C, A> LienMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Create a Lien which applies to the resource denoted by the `parent` field. + /// + /// Callers of this method will require permission on the `parent` resource. + /// For example, applying to `projects/1234` requires permission + /// `resourcemanager.projects.updateLiens`. + /// + /// NOTE: Some resources may limit the number of Liens which may be applied. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: Lien) -> LienCreateCall<'a, C, A> { + LienCreateCall { + 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: + /// + /// Delete a Lien by `name`. + /// + /// Callers of this method will require permission on the `parent` resource. + /// For example, a Lien with a `parent` of `projects/1234` requires permission + /// `resourcemanager.projects.updateLiens`. + /// + /// # Arguments + /// + /// * `name` - The name/identifier of the Lien to delete. + pub fn delete(&self, name: &str) -> LienDeleteCall<'a, C, A> { + LienDeleteCall { + 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: + /// + /// List all Liens applied to the `parent` resource. + /// + /// Callers of this method will require permission on the `parent` resource. + /// For example, a Lien with a `parent` of `projects/1234` requires permission + /// `resourcemanager.projects.get`. + pub fn list(&self) -> LienListCall<'a, C, A> { + LienListCall { + hub: self.hub, + _parent: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `CloudResourceManager` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use cloudresourcemanager1::CloudResourceManager; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `clear_org_policy(...)`, `create(...)`, `delete(...)`, `get(...)`, `get_ancestry(...)`, `get_effective_org_policy(...)`, `get_iam_policy(...)`, `get_org_policy(...)`, `list(...)`, `list_available_org_policy_constraints(...)`, `list_org_policies(...)`, `set_iam_policy(...)`, `set_org_policy(...)`, `test_iam_permissions(...)`, `undelete(...)` and `update(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, +} + +impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} + +impl<'a, C, A> ProjectMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Marks the Project identified by the specified + /// `project_id` (for example, `my-project-123`) for deletion. + /// This method will only affect the Project if the following criteria are met: + /// + /// + The Project does not have a billing account associated with it. + /// + The Project has a lifecycle state of + /// ACTIVE. + /// + /// This method changes the Project's lifecycle state from + /// ACTIVE + /// to DELETE_REQUESTED. + /// The deletion starts at an unspecified time, + /// at which point the Project is no longer accessible. + /// + /// Until the deletion completes, you can check the lifecycle state + /// checked by retrieving the Project with GetProject, + /// and the Project remains visible to ListProjects. + /// However, you cannot update the project. + /// + /// After the deletion completes, the Project is not retrievable by + /// the GetProject and + /// ListProjects methods. + /// + /// The caller must have modify permissions for this Project. + /// + /// # Arguments + /// + /// * `projectId` - The Project ID (for example, `foo-bar-123`). + /// Required. + pub fn delete(&self, project_id: &str) -> ProjectDeleteCall<'a, C, A> { + ProjectDeleteCall { + hub: self.hub, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns the IAM access control policy for the specified Project. + /// Permission is denied if the policy or the resource does not exist. + /// + /// # 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 get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectGetIamPolicyCall<'a, C, A> { + ProjectGetIamPolicyCall { + 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: + /// + /// Request that a new Project be created. The result is an Operation which + /// can be used to track the creation process. It is automatically deleted + /// after a few hours, so there is no need to call DeleteOperation. + /// + /// Our SLO permits Project creation to take up to 30 seconds at the 90th + /// percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile + /// latency. 95th percentile latency is around 11 seconds. We recommend + /// polling at the 5th second with an exponential backoff. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn create(&self, request: Project) -> ProjectCreateCall<'a, C, A> { + ProjectCreateCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a `Policy` on a resource. + /// + /// If no `Policy` is set on the resource, a `Policy` is returned with default + /// values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The + /// `etag` value can be used with `SetOrgPolicy()` to create or update a + /// `Policy` during read-modify-write. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource the `Policy` is set on. + pub fn get_org_policy(&self, request: GetOrgPolicyRequest, resource: &str) -> ProjectGetOrgPolicyCall<'a, C, A> { + ProjectGetOrgPolicyCall { + 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 the specified `Policy` on the resource. Creates a new `Policy` for + /// that `Constraint` on the resource if one does not exist. + /// + /// Not supplying an `etag` on the request `Policy` results in an unconditional + /// write of the `Policy`. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Resource name of the resource to attach the `Policy`. + pub fn set_org_policy(&self, request: SetOrgPolicyRequest, resource: &str) -> ProjectSetOrgPolicyCall<'a, C, A> { + ProjectSetOrgPolicyCall { + 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: + /// + /// Clears a `Policy` from a resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource for the `Policy` to clear. + pub fn clear_org_policy(&self, request: ClearOrgPolicyRequest, resource: &str) -> ProjectClearOrgPolicyCall<'a, C, A> { + ProjectClearOrgPolicyCall { + 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: + /// + /// Restores the Project identified by the specified + /// `project_id` (for example, `my-project-123`). + /// You can only use this method for a Project that has a lifecycle state of + /// DELETE_REQUESTED. + /// After deletion starts, the Project cannot be restored. + /// + /// The caller must have modify permissions for this Project. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The project ID (for example, `foo-bar-123`). + /// Required. + pub fn undelete(&self, request: UndeleteProjectRequest, project_id: &str) -> ProjectUndeleteCall<'a, C, A> { + ProjectUndeleteCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists all the `Policies` set for a particular resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource to list Policies for. + pub fn list_org_policies(&self, request: ListOrgPoliciesRequest, resource: &str) -> ProjectListOrgPolicyCall<'a, C, A> { + ProjectListOrgPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns permissions that a caller has on the specified Project. + /// + /// # 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 test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectTestIamPermissionCall<'a, C, A> { + ProjectTestIamPermissionCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists `Constraints` that could be applied on the specified resource. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - Name of the resource to list `Constraints` for. + pub fn list_available_org_policy_constraints(&self, request: ListAvailableOrgPolicyConstraintsRequest, resource: &str) -> ProjectListAvailableOrgPolicyConstraintCall<'a, C, A> { + ProjectListAvailableOrgPolicyConstraintCall { + 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: + /// + /// Retrieves the Project identified by the specified + /// `project_id` (for example, `my-project-123`). + /// + /// The caller must have read permissions for this Project. + /// + /// # Arguments + /// + /// * `projectId` - The Project ID (for example, `my-project-123`). + /// Required. + pub fn get(&self, project_id: &str) -> ProjectGetCall<'a, C, A> { + ProjectGetCall { + hub: self.hub, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists Projects that are visible to the user and satisfy the + /// specified filter. This method returns Projects in an unspecified order. + /// New Projects do not necessarily appear at the end of the list. + pub fn list(&self) -> ProjectListCall<'a, C, A> { + ProjectListCall { + hub: self.hub, + _page_token: Default::default(), + _page_size: Default::default(), + _filter: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Sets the IAM access control policy for the specified Project. Replaces + /// any existing policy. + /// + /// The following constraints apply when using `setIamPolicy()`: + /// + /// + Project does not support `allUsers` and `allAuthenticatedUsers` as + /// `members` in a `Binding` of a `Policy`. + /// + /// + The owner role can be granted only to `user` and `serviceAccount`. + /// + /// + Service accounts can be made owners of a project directly + /// without any restrictions. However, to be added as an owner, a user must be + /// invited via Cloud Platform console and must accept the invitation. + /// + /// + A user cannot be granted the owner role using `setIamPolicy()`. The user + /// must be granted the owner role using the Cloud Platform Console and must + /// explicitly accept the invitation. + /// + /// + Invitations to grant the owner role cannot be sent using + /// `setIamPolicy()`; + /// they must be sent only using the Cloud Platform Console. + /// + /// + Membership changes that leave the project without any owners that have + /// accepted the Terms of Service (ToS) will be rejected. + /// + /// + There must be at least one owner who has accepted the Terms of + /// Service (ToS) agreement in the policy. Calling `setIamPolicy()` to + /// remove the last ToS-accepted owner from the policy will fail. This + /// restriction also applies to legacy projects that no longer have owners + /// who have accepted the ToS. Edits to IAM policies will be rejected until + /// the lack of a ToS-accepting owner is rectified. + /// + /// + Calling this method requires enabling the App Engine Admin API. + /// + /// Note: Removing service accounts from policies or changing their roles + /// can render services completely inoperable. It is important to understand + /// how the service account is being used before removing or updating its + /// roles. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. + pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSetIamPolicyCall<'a, C, A> { + ProjectSetIamPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a list of ancestors in the resource hierarchy for the Project + /// identified by the specified `project_id` (for example, `my-project-123`). + /// + /// The caller must have read permissions for this Project. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Project ID (for example, `my-project-123`). + /// Required. + pub fn get_ancestry(&self, request: GetAncestryRequest, project_id: &str) -> ProjectGetAncestryCall<'a, C, A> { + ProjectGetAncestryCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the attributes of the Project identified by the specified + /// `project_id` (for example, `my-project-123`). + /// + /// The caller must have modify permissions for this Project. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The project ID (for example, `my-project-123`). + /// Required. + pub fn update(&self, request: Project, project_id: &str) -> ProjectUpdateCall<'a, C, A> { + ProjectUpdateCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets the effective `Policy` on a resource. This is the result of merging + /// `Policies` in the resource hierarchy. The returned `Policy` will not have + /// an `etag`set because it is a computed `Policy` across multiple resources. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `resource` - The name of the resource to start computing the effective `Policy`. + pub fn get_effective_org_policy(&self, request: GetEffectiveOrgPolicyRequest, resource: &str) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> { + ProjectGetEffectiveOrgPolicyCall { + hub: self.hub, + _request: request, + _resource: resource.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *operation* resources. /// It is not used directly, but through the `CloudResourceManager` hub. /// @@ -1114,482 +2819,18 @@ impl<'a, C, A> OperationMethods<'a, C, A> { -/// A builder providing access to all methods supported on *organization* resources. -/// It is not used directly, but through the `CloudResourceManager` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use cloudresourcemanager1::CloudResourceManager; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::new(), -/// ::default(), None); -/// let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get(...)`, `get_iam_policy(...)`, `search(...)`, `set_iam_policy(...)` and `test_iam_permissions(...)` -/// // to build up your call. -/// let rb = hub.organizations(); -/// # } -/// ``` -pub struct OrganizationMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudResourceManager, -} - -impl<'a, C, A> MethodsBuilder for OrganizationMethods<'a, C, A> {} - -impl<'a, C, A> OrganizationMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Sets the access control policy on an Organization resource. Replaces any - /// existing policy. The `resource` field should be the organization's resource - /// name, e.g. "organizations/123". - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. - pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> OrganizationSetIamPolicyCall<'a, C, A> { - OrganizationSetIamPolicyCall { - hub: self.hub, - _request: request, - _resource: resource.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets the access control policy for an Organization resource. May be empty - /// if no such policy or resource exists. The `resource` field should be the - /// organization's resource name, e.g. "organizations/123". - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. - pub fn get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> OrganizationGetIamPolicyCall<'a, C, A> { - OrganizationGetIamPolicyCall { - hub: self.hub, - _request: request, - _resource: resource.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns permissions that a caller has on the specified Organization. - /// The `resource` field should be the organization's resource name, - /// e.g. "organizations/123". - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. - pub fn test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> OrganizationTestIamPermissionCall<'a, C, A> { - OrganizationTestIamPermissionCall { - 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: - /// - /// Fetches an Organization resource identified by the specified resource name. - /// - /// # Arguments - /// - /// * `name` - The resource name of the Organization to fetch, e.g. "organizations/1234". - pub fn get(&self, name: &str) -> OrganizationGetCall<'a, C, A> { - OrganizationGetCall { - 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: - /// - /// Searches Organization resources that are visible to the user and satisfy - /// the specified filter. This method returns Organizations in an unspecified - /// order. New Organizations do not necessarily appear at the end of the - /// results. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn search(&self, request: SearchOrganizationsRequest) -> OrganizationSearchCall<'a, C, A> { - OrganizationSearchCall { - hub: self.hub, - _request: request, - _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 `CloudResourceManager` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use cloudresourcemanager1::CloudResourceManager; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::new(), -/// ::default(), None); -/// let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `create(...)`, `delete(...)`, `get(...)`, `get_ancestry(...)`, `get_iam_policy(...)`, `list(...)`, `set_iam_policy(...)`, `test_iam_permissions(...)`, `undelete(...)` and `update(...)` -/// // to build up your call. -/// let rb = hub.projects(); -/// # } -/// ``` -pub struct ProjectMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudResourceManager, -} - -impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} - -impl<'a, C, A> ProjectMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Returns permissions that a caller has on the specified Project. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. - pub fn test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectTestIamPermissionCall<'a, C, A> { - ProjectTestIamPermissionCall { - 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: - /// - /// Restores the Project identified by the specified - /// `project_id` (for example, `my-project-123`). - /// You can only use this method for a Project that has a lifecycle state of - /// DELETE_REQUESTED. - /// After deletion starts, the Project cannot be restored. - /// - /// The caller must have modify permissions for this Project. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `projectId` - The project ID (for example, `foo-bar-123`). - /// Required. - pub fn undelete(&self, request: UndeleteProjectRequest, project_id: &str) -> ProjectUndeleteCall<'a, C, A> { - ProjectUndeleteCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Sets the IAM access control policy for the specified Project. Replaces - /// any existing policy. - /// - /// The following constraints apply when using `setIamPolicy()`: - /// - /// + Project does not support `allUsers` and `allAuthenticatedUsers` as - /// `members` in a `Binding` of a `Policy`. - /// - /// + The owner role can be granted only to `user` and `serviceAccount`. - /// - /// + Service accounts can be made owners of a project directly - /// without any restrictions. However, to be added as an owner, a user must be - /// invited via Cloud Platform console and must accept the invitation. - /// - /// + A user cannot be granted the owner role using `setIamPolicy()`. The user - /// must be granted the owner role using the Cloud Platform Console and must - /// explicitly accept the invitation. - /// - /// + Invitations to grant the owner role cannot be sent using - /// `setIamPolicy()`; - /// they must be sent only using the Cloud Platform Console. - /// - /// + Membership changes that leave the project without any owners that have - /// accepted the Terms of Service (ToS) will be rejected. - /// - /// + There must be at least one owner who has accepted the Terms of - /// Service (ToS) agreement in the policy. Calling `setIamPolicy()` to - /// to remove the last ToS-accepted owner from the policy will fail. This - /// restriction also applies to legacy projects that no longer have owners - /// who have accepted the ToS. Edits to IAM policies will be rejected until - /// the lack of a ToS-accepting owner is rectified. - /// - /// + Calling this method requires enabling the App Engine Admin API. - /// - /// Note: Removing service accounts from policies or changing their roles - /// can render services completely inoperable. It is important to understand - /// how the service account is being used before removing or updating its - /// roles. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. - pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSetIamPolicyCall<'a, C, A> { - ProjectSetIamPolicyCall { - 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: - /// - /// Retrieves the Project identified by the specified - /// `project_id` (for example, `my-project-123`). - /// - /// The caller must have read permissions for this Project. - /// - /// # Arguments - /// - /// * `projectId` - The Project ID (for example, `my-project-123`). - /// Required. - pub fn get(&self, project_id: &str) -> ProjectGetCall<'a, C, A> { - ProjectGetCall { - hub: self.hub, - _project_id: project_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Gets a list of ancestors in the resource hierarchy for the Project - /// identified by the specified `project_id` (for example, `my-project-123`). - /// - /// The caller must have read permissions for this Project. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `projectId` - The Project ID (for example, `my-project-123`). - /// Required. - pub fn get_ancestry(&self, request: GetAncestryRequest, project_id: &str) -> ProjectGetAncestryCall<'a, C, A> { - ProjectGetAncestryCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the attributes of the Project identified by the specified - /// `project_id` (for example, `my-project-123`). - /// - /// The caller must have modify permissions for this Project. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `projectId` - The project ID (for example, `my-project-123`). - /// Required. - pub fn update(&self, request: Project, project_id: &str) -> ProjectUpdateCall<'a, C, A> { - ProjectUpdateCall { - hub: self.hub, - _request: request, - _project_id: project_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the IAM access control policy for the specified Project. - /// Permission is denied if the policy or the resource does not exist. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. - pub fn get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectGetIamPolicyCall<'a, C, A> { - ProjectGetIamPolicyCall { - 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: - /// - /// Marks the Project identified by the specified - /// `project_id` (for example, `my-project-123`) for deletion. - /// This method will only affect the Project if the following criteria are met: - /// - /// + The Project does not have a billing account associated with it. - /// + The Project has a lifecycle state of - /// ACTIVE. - /// - /// This method changes the Project's lifecycle state from - /// ACTIVE - /// to DELETE_REQUESTED. - /// The deletion starts at an unspecified time, - /// at which point the Project is no longer accessible. - /// - /// Until the deletion completes, you can check the lifecycle state - /// checked by retrieving the Project with GetProject, - /// and the Project remains visible to ListProjects. - /// However, you cannot update the project. - /// - /// After the deletion completes, the Project is not retrievable by - /// the GetProject and - /// ListProjects methods. - /// - /// The caller must have modify permissions for this Project. - /// - /// # Arguments - /// - /// * `projectId` - The Project ID (for example, `foo-bar-123`). - /// Required. - pub fn delete(&self, project_id: &str) -> ProjectDeleteCall<'a, C, A> { - ProjectDeleteCall { - hub: self.hub, - _project_id: project_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Request that a new Project be created. The result is an Operation which - /// can be used to track the creation process. It is automatically deleted - /// after a few hours, so there is no need to call DeleteOperation. - /// - /// Our SLO permits Project creation to take up to 30 seconds at the 90th - /// percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile - /// latency. 95th percentile latency is around 11 seconds. We recommend - /// polling at the 5th second with an exponential backoff. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn create(&self, request: Project) -> ProjectCreateCall<'a, C, A> { - ProjectCreateCall { - hub: self.hub, - _request: request, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists Projects that are visible to the user and satisfy the - /// specified filter. This method returns Projects in an unspecified order. - /// New Projects do not necessarily appear at the end of the list. - pub fn list(&self) -> ProjectListCall<'a, C, A> { - ProjectListCall { - hub: self.hub, - _page_token: Default::default(), - _page_size: Default::default(), - _filter: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - // ################### // CallBuilders ### // ################# -/// 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. +/// Gets the effective `Policy` on a resource. This is the result of merging +/// `Policies` in the resource hierarchy. The returned `Policy` will not have +/// an `etag`set because it is a computed `Policy` across multiple resources. /// -/// A builder for the *get* method supported by a *operation* resource. -/// It is not used directly, but through a `OperationMethods` instance. +/// A builder for the *getEffectiveOrgPolicy* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. /// /// # Example /// @@ -1599,6 +2840,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::GetEffectiveOrgPolicyRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -1609,30 +2851,36 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # hyper::Client::new(), /// # ::default(), None); /// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = GetEffectiveOrgPolicyRequest::default(); +/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.operations().get("name") +/// let result = hub.folders().get_effective_org_policy(req, "resource") /// .doit(); /// # } /// ``` -pub struct OperationGetCall<'a, C, A> +pub struct FolderGetEffectiveOrgPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudResourceManager, - _name: String, + _request: GetEffectiveOrgPolicyRequest, + _resource: 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> CallBuilder for FolderGetEffectiveOrgPolicyCall<'a, C, A> {} -impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> FolderGetEffectiveOrgPolicyCall<'a, C, 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, OrgPolicy)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -1641,11 +2889,11 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "cloudresourcemanager.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() { + dlg.begin(MethodInfo { id: "cloudresourcemanager.folders.getEffectiveOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -1657,12 +2905,12 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+name}"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:getEffectiveOrgPolicy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+name}", "name")].iter() { + 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 { @@ -1677,7 +2925,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["name"].iter() { + for param_name in ["resource"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -1692,6 +2940,17 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: url.push_str(&url::form_urlencoded::serialize(params)); } + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -1708,11 +2967,15 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: } }; let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + let mut req = client.borrow_mut().request(hyper::method::Method::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() @@ -1763,14 +3026,23 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: } - /// The name of the operation resource. /// - /// Sets the *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 name(mut self, new_value: &str) -> OperationGetCall<'a, C, A> { - self._name = new_value.to_string(); + pub fn request(mut self, new_value: GetEffectiveOrgPolicyRequest) -> FolderGetEffectiveOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the resource to start computing the effective `Policy`. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> FolderGetEffectiveOrgPolicyCall<'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 @@ -1779,7 +3051,7 @@ impl<'a, C, A> OperationGetCall<'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) -> OperationGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> FolderGetEffectiveOrgPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -1798,15 +3070,15 @@ 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> + pub fn param(mut self, name: T, value: T) -> FolderGetEffectiveOrgPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -1823,7 +3095,2505 @@ impl<'a, C, A> OperationGetCall<'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) -> OperationGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> FolderGetEffectiveOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Clears a `Policy` from a resource. +/// +/// A builder for the *clearOrgPolicy* method supported by a *folder* resource. +/// It is not used directly, but through a `FolderMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::ClearOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ClearOrgPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.folders().clear_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct FolderClearOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: ClearOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderClearOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> FolderClearOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.folders.clearOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:clearOrgPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ClearOrgPolicyRequest) -> FolderClearOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource for the `Policy` to clear. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> FolderClearOrgPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> FolderClearOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderClearOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderClearOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists `Constraints` that could be applied on the specified resource. +/// +/// A builder for the *listAvailableOrgPolicyConstraints* 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 yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::ListAvailableOrgPolicyConstraintsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ListAvailableOrgPolicyConstraintsRequest::default(); +/// +/// // You can configure optional parameters by calling 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().list_available_org_policy_constraints(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct FolderListAvailableOrgPolicyConstraintCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: ListAvailableOrgPolicyConstraintsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderListAvailableOrgPolicyConstraintCall<'a, C, A> {} + +impl<'a, C, A> FolderListAvailableOrgPolicyConstraintCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAvailableOrgPolicyConstraintsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.folders.listAvailableOrgPolicyConstraints", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:listAvailableOrgPolicyConstraints".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: ListAvailableOrgPolicyConstraintsRequest) -> FolderListAvailableOrgPolicyConstraintCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource to list `Constraints` for. + /// + /// 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) -> FolderListAvailableOrgPolicyConstraintCall<'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) -> FolderListAvailableOrgPolicyConstraintCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *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> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderListAvailableOrgPolicyConstraintCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a `Policy` on a resource. +/// +/// If no `Policy` is set on the resource, a `Policy` is returned with default +/// values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The +/// `etag` value can be used with `SetOrgPolicy()` to create or update a +/// `Policy` during read-modify-write. +/// +/// A builder for the *getOrgPolicy* 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 yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::GetOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = GetOrgPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling 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().get_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct FolderGetOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: GetOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderGetOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> FolderGetOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrgPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.folders.getOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:getOrgPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: GetOrgPolicyRequest) -> FolderGetOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource the `Policy` is set on. + /// + /// 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) -> FolderGetOrgPolicyCall<'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) -> FolderGetOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderGetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderGetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates the specified `Policy` on the resource. Creates a new `Policy` for +/// that `Constraint` on the resource if one does not exist. +/// +/// Not supplying an `etag` on the request `Policy` results in an unconditional +/// write of the `Policy`. +/// +/// A builder for the *setOrgPolicy* 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 yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::SetOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SetOrgPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling 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().set_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct FolderSetOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: SetOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderSetOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> FolderSetOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrgPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.folders.setOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:setOrgPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: SetOrgPolicyRequest) -> FolderSetOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Resource name of the resource to attach the `Policy`. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> FolderSetOrgPolicyCall<'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) -> FolderSetOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderSetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderSetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists all the `Policies` set for a particular resource. +/// +/// A builder for the *listOrgPolicies* 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 yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::ListOrgPoliciesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ListOrgPoliciesRequest::default(); +/// +/// // You can configure optional parameters by calling 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().list_org_policies(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct FolderListOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: ListOrgPoliciesRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FolderListOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> FolderListOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOrgPoliciesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.folders.listOrgPolicies", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:listOrgPolicies".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: ListOrgPoliciesRequest) -> FolderListOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource to list Policies for. + /// + /// 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) -> FolderListOrgPolicyCall<'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) -> FolderListOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> FolderListOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FolderListOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Clears a `Policy` from a resource. +/// +/// A builder for the *clearOrgPolicy* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::ClearOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ClearOrgPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.organizations().clear_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationClearOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: ClearOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationClearOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> OrganizationClearOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.organizations.clearOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:clearOrgPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ClearOrgPolicyRequest) -> OrganizationClearOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource for the `Policy` to clear. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> OrganizationClearOrgPolicyCall<'a, C, A> { + self._resource = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrganizationClearOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationClearOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationClearOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a `Policy` on a resource. +/// +/// If no `Policy` is set on the resource, a `Policy` is returned with default +/// values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The +/// `etag` value can be used with `SetOrgPolicy()` to create or update a +/// `Policy` during read-modify-write. +/// +/// A builder for the *getOrgPolicy* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::GetOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = GetOrgPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling 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().get_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationGetOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: GetOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationGetOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> OrganizationGetOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrgPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.organizations.getOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:getOrgPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: GetOrgPolicyRequest) -> OrganizationGetOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource the `Policy` is set on. + /// + /// 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) -> OrganizationGetOrgPolicyCall<'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) -> OrganizationGetOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationGetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationGetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists `Constraints` that could be applied on the specified resource. +/// +/// A builder for the *listAvailableOrgPolicyConstraints* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::ListAvailableOrgPolicyConstraintsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ListAvailableOrgPolicyConstraintsRequest::default(); +/// +/// // You can configure optional parameters by calling 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().list_available_org_policy_constraints(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationListAvailableOrgPolicyConstraintCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: ListAvailableOrgPolicyConstraintsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationListAvailableOrgPolicyConstraintCall<'a, C, A> {} + +impl<'a, C, A> OrganizationListAvailableOrgPolicyConstraintCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAvailableOrgPolicyConstraintsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.organizations.listAvailableOrgPolicyConstraints", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:listAvailableOrgPolicyConstraints".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: ListAvailableOrgPolicyConstraintsRequest) -> OrganizationListAvailableOrgPolicyConstraintCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource to list `Constraints` for. + /// + /// 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) -> OrganizationListAvailableOrgPolicyConstraintCall<'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) -> OrganizationListAvailableOrgPolicyConstraintCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *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> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationListAvailableOrgPolicyConstraintCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists all the `Policies` set for a particular resource. +/// +/// A builder for the *listOrgPolicies* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::ListOrgPoliciesRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ListOrgPoliciesRequest::default(); +/// +/// // You can configure optional parameters by calling 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().list_org_policies(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationListOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: ListOrgPoliciesRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationListOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> OrganizationListOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOrgPoliciesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.organizations.listOrgPolicies", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:listOrgPolicies".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: ListOrgPoliciesRequest) -> OrganizationListOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource to list Policies for. + /// + /// 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) -> OrganizationListOrgPolicyCall<'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) -> OrganizationListOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationListOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationListOrgPolicyCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -1911,7 +5681,7 @@ impl<'a, C, A> OrganizationSetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationSetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSetIamPolicyCall<'a, C, A> @@ -2111,566 +5880,6 @@ impl<'a, C, A> OrganizationSetIamPolicyCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = 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.organizations().get_iam_policy(req, "resource") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationGetIamPolicyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudResourceManager, - _request: GetIamPolicyRequest, - _resource: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationGetIamPolicyCall<'a, C, A> {} - -impl<'a, C, A> OrganizationGetIamPolicyCall<'a, C, 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: "cloudresourcemanager.organizations.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) -> OrganizationGetIamPolicyCall<'a, C, A> { - self._request = new_value; - self - } - /// REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> OrganizationGetIamPolicyCall<'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) -> OrganizationGetIamPolicyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> OrganizationGetIamPolicyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationGetIamPolicyCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Returns permissions that a caller has on the specified Organization. -/// The `resource` field should be the organization's resource name, -/// e.g. "organizations/123". -/// -/// A builder for the *testIamPermissions* method supported by a *organization* resource. -/// It is not used directly, but through a `OrganizationMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; -/// use cloudresourcemanager1::TestIamPermissionsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use cloudresourcemanager1::CloudResourceManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = 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.organizations().test_iam_permissions(req, "resource") -/// .doit(); -/// # } -/// ``` -pub struct OrganizationTestIamPermissionCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudResourceManager, - _request: TestIamPermissionsRequest, - _resource: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrganizationTestIamPermissionCall<'a, C, A> {} - -impl<'a, C, A> OrganizationTestIamPermissionCall<'a, C, 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: "cloudresourcemanager.organizations.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) -> OrganizationTestIamPermissionCall<'a, C, A> { - self._request = new_value; - self - } - /// REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. - /// - /// Sets the *resource* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> OrganizationTestIamPermissionCall<'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) -> OrganizationTestIamPermissionCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> OrganizationTestIamPermissionCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrganizationTestIamPermissionCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Fetches an Organization resource identified by the specified resource name. /// /// A builder for the *get* method supported by a *organization* resource. @@ -2742,7 +5951,7 @@ impl<'a, C, A> OrganizationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+name}"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2883,12 +6092,12 @@ impl<'a, C, A> OrganizationGetCall<'a, C, A> where C: BorrowMut, /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> OrganizationGetCall<'a, C, A> @@ -2916,6 +6125,284 @@ impl<'a, C, A> OrganizationGetCall<'a, C, A> where C: BorrowMut, } +/// Gets the effective `Policy` on a resource. This is the result of merging +/// `Policies` in the resource hierarchy. The returned `Policy` will not have +/// an `etag`set because it is a computed `Policy` across multiple resources. +/// +/// A builder for the *getEffectiveOrgPolicy* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::GetEffectiveOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = GetEffectiveOrgPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.organizations().get_effective_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationGetEffectiveOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: GetEffectiveOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationGetEffectiveOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> OrganizationGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrgPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.organizations.getEffectiveOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:getEffectiveOrgPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: GetEffectiveOrgPolicyRequest) -> OrganizationGetEffectiveOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// The name of the resource to start computing the effective `Policy`. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> OrganizationGetEffectiveOrgPolicyCall<'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) -> OrganizationGetEffectiveOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *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> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationGetEffectiveOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Searches Organization resources that are visible to the user and satisfy /// the specified filter. This method returns Organizations in an unspecified /// order. New Organizations do not necessarily appear at the end of the @@ -2994,7 +6481,7 @@ impl<'a, C, A> OrganizationSearchCall<'a, C, A> where C: BorrowMut OrganizationSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrganizationSearchCall<'a, C, A> @@ -3158,10 +6645,291 @@ impl<'a, C, A> OrganizationSearchCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = 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.organizations().get_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: GetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> OrganizationGetIamPolicyCall<'a, C, 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: "cloudresourcemanager.organizations.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 = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:getIamPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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) -> OrganizationGetIamPolicyCall<'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) -> OrganizationGetIamPolicyCall<'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) -> OrganizationGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns permissions that a caller has on the specified Organization. +/// The `resource` field should be the organization's resource name, +/// e.g. "organizations/123". +/// +/// A builder for the *testIamPermissions* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. /// /// # Example /// @@ -3190,11 +6958,11 @@ impl<'a, C, A> OrganizationSearchCall<'a, C, A> where C: BorrowMut +pub struct OrganizationTestIamPermissionCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudResourceManager, @@ -3205,13 +6973,14 @@ pub struct ProjectTestIamPermissionCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectTestIamPermissionCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrganizationTestIamPermissionCall<'a, C, A> {} -impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrganizationTestIamPermissionCall<'a, C, 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; @@ -3219,7 +6988,7 @@ impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.testIamPermissions", + dlg.begin(MethodInfo { id: "cloudresourcemanager.organizations.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())); @@ -3235,7 +7004,1573 @@ impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut = 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) -> OrganizationTestIamPermissionCall<'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) -> OrganizationTestIamPermissionCall<'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) -> OrganizationTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates the specified `Policy` on the resource. Creates a new `Policy` for +/// that `Constraint` on the resource if one does not exist. +/// +/// Not supplying an `etag` on the request `Policy` results in an unconditional +/// write of the `Policy`. +/// +/// A builder for the *setOrgPolicy* method supported by a *organization* resource. +/// It is not used directly, but through a `OrganizationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::SetOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SetOrgPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling 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().set_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct OrganizationSetOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: SetOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for OrganizationSetOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> OrganizationSetOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrgPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.organizations.setOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:setOrgPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: SetOrgPolicyRequest) -> OrganizationSetOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Resource name of the resource to attach the `Policy`. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> OrganizationSetOrgPolicyCall<'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) -> OrganizationSetOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> OrganizationSetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> OrganizationSetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Create a Lien which applies to the resource denoted by the `parent` field. +/// +/// Callers of this method will require permission on the `parent` resource. +/// For example, applying to `projects/1234` requires permission +/// `resourcemanager.projects.updateLiens`. +/// +/// NOTE: Some resources may limit the number of Liens which may be applied. +/// +/// A builder for the *create* method supported by a *lien* resource. +/// It is not used directly, but through a `LienMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::Lien; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Lien::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.liens().create(req) +/// .doit(); +/// # } +/// ``` +pub struct LienCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: Lien, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LienCreateCall<'a, C, A> {} + +impl<'a, C, A> LienCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Lien)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.liens.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/liens".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Lien) -> LienCreateCall<'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) -> LienCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *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> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LienCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Delete a Lien by `name`. +/// +/// Callers of this method will require permission on the `parent` resource. +/// For example, a Lien with a `parent` of `projects/1234` requires permission +/// `resourcemanager.projects.updateLiens`. +/// +/// A builder for the *delete* method supported by a *lien* resource. +/// It is not used directly, but through a `LienMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.liens().delete("name") +/// .doit(); +/// # } +/// ``` +pub struct LienDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LienDeleteCall<'a, C, A> {} + +impl<'a, C, A> LienDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.liens.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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/identifier of the Lien to delete. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> LienDeleteCall<'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) -> LienDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *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> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LienDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// List all Liens applied to the `parent` resource. +/// +/// Callers of this method will require permission on the `parent` resource. +/// For example, a Lien with a `parent` of `projects/1234` requires permission +/// `resourcemanager.projects.get`. +/// +/// A builder for the *list* method supported by a *lien* resource. +/// It is not used directly, but through a `LienMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.liens().list() +/// .parent("ipsum") +/// .page_token("Lorem") +/// .page_size(-21) +/// .doit(); +/// # } +/// ``` +pub struct LienListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _parent: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LienListCall<'a, C, A> {} + +impl<'a, C, A> LienListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListLiensResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.liens.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + if let Some(value) = self._parent { + params.push(("parent", value.to_string())); + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "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 = "https://cloudresourcemanager.googleapis.com/v1/liens".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 resource to list all attached Liens. + /// For example, `projects/1234`. + /// + /// Sets the *parent* query property to the given value. + pub fn parent(mut self, new_value: &str) -> LienListCall<'a, C, A> { + self._parent = 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) -> LienListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of items to return. This is a suggestion for the server. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> LienListCall<'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) -> LienListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *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> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LienListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Marks the Project identified by the specified +/// `project_id` (for example, `my-project-123`) for deletion. +/// This method will only affect the Project if the following criteria are met: +/// +/// + The Project does not have a billing account associated with it. +/// + The Project has a lifecycle state of +/// ACTIVE. +/// +/// This method changes the Project's lifecycle state from +/// ACTIVE +/// to DELETE_REQUESTED. +/// The deletion starts at an unspecified time, +/// at which point the Project is no longer accessible. +/// +/// Until the deletion completes, you can check the lifecycle state +/// checked by retrieving the Project with GetProject, +/// and the Project remains visible to ListProjects. +/// However, you cannot update the project. +/// +/// After the deletion completes, the Project is not retrievable by +/// the GetProject and +/// ListProjects methods. +/// +/// The caller must have modify permissions for this Project. +/// +/// A builder for the *delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().delete("projectId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _project_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + for &field in ["alt", "projectId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects/{projectId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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 Project ID (for example, `foo-bar-123`). + /// + /// Required. + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectDeleteCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns the IAM access control policy for the specified Project. +/// Permission is denied if the policy or the resource does not exist. +/// +/// A builder for the *getIamPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::GetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = 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().get_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: GetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.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 = "https://cloudresourcemanager.googleapis.com/v1/projects/{resource}:getIamPolicy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3358,19 +8693,18 @@ impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectTestIamPermissionCall<'a, C, A> { + pub fn request(mut self, new_value: GetIamPolicyRequest) -> ProjectGetIamPolicyCall<'a, C, A> { self._request = new_value; self } - /// REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// 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) -> ProjectTestIamPermissionCall<'a, C, A> { + pub fn resource(mut self, new_value: &str) -> ProjectGetIamPolicyCall<'a, C, A> { self._resource = new_value.to_string(); self } @@ -3380,7 +8714,7 @@ impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectTestIamPermissionCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGetIamPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3399,15 +8733,15 @@ impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTestIamPermissionCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectGetIamPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -3424,7 +8758,1090 @@ impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectTestIamPermissionCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Request that a new Project be created. The result is an Operation which +/// can be used to track the creation process. It is automatically deleted +/// after a few hours, so there is no need to call DeleteOperation. +/// +/// Our SLO permits Project creation to take up to 30 seconds at the 90th +/// percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile +/// latency. 95th percentile latency is around 11 seconds. We recommend +/// polling at the 5th second with an exponential backoff. +/// +/// A builder for the *create* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::Project; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Project::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().create(req) +/// .doit(); +/// # } +/// ``` +pub struct ProjectCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: Project, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectCreateCall<'a, C, A> {} + +impl<'a, C, A> ProjectCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, 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: "cloudresourcemanager.projects.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Project) -> ProjectCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a `Policy` on a resource. +/// +/// If no `Policy` is set on the resource, a `Policy` is returned with default +/// values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The +/// `etag` value can be used with `SetOrgPolicy()` to create or update a +/// `Policy` during read-modify-write. +/// +/// A builder for the *getOrgPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::GetOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = GetOrgPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling the 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_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectGetOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: GetOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectGetOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectGetOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrgPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.getOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:getOrgPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: GetOrgPolicyRequest) -> ProjectGetOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource the `Policy` is set on. + /// + /// 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) -> ProjectGetOrgPolicyCall<'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) -> ProjectGetOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectGetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectGetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates the specified `Policy` on the resource. Creates a new `Policy` for +/// that `Constraint` on the resource if one does not exist. +/// +/// Not supplying an `etag` on the request `Policy` results in an unconditional +/// write of the `Policy`. +/// +/// A builder for the *setOrgPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::SetOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SetOrgPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().set_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSetOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: SetOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSetOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectSetOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, OrgPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.setOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:setOrgPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: SetOrgPolicyRequest) -> ProjectSetOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Resource name of the resource to attach the `Policy`. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectSetOrgPolicyCall<'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) -> ProjectSetOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSetOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Clears a `Policy` from a resource. +/// +/// A builder for the *clearOrgPolicy* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::ClearOrgPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ClearOrgPolicyRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().clear_org_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectClearOrgPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: ClearOrgPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectClearOrgPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectClearOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Empty)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.clearOrgPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:clearOrgPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["resource"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ClearOrgPolicyRequest) -> ProjectClearOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource for the `Policy` to clear. + /// + /// Sets the *resource* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn resource(mut self, new_value: &str) -> ProjectClearOrgPolicyCall<'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) -> ProjectClearOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectClearOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectClearOrgPolicyCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -3515,7 +9932,7 @@ impl<'a, C, A> ProjectUndeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}:undelete"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects/{projectId}:undelete".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3679,12 +10096,12 @@ impl<'a, C, A> ProjectUndeleteCall<'a, C, A> where C: BorrowMut, /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectUndeleteCall<'a, C, A> @@ -3712,46 +10129,9 @@ impl<'a, C, A> ProjectUndeleteCall<'a, C, A> where C: BorrowMut, } -/// Sets the IAM access control policy for the specified Project. Replaces -/// any existing policy. -/// -/// The following constraints apply when using `setIamPolicy()`: -/// -/// + Project does not support `allUsers` and `allAuthenticatedUsers` as -/// `members` in a `Binding` of a `Policy`. -/// -/// + The owner role can be granted only to `user` and `serviceAccount`. -/// -/// + Service accounts can be made owners of a project directly -/// without any restrictions. However, to be added as an owner, a user must be -/// invited via Cloud Platform console and must accept the invitation. -/// -/// + A user cannot be granted the owner role using `setIamPolicy()`. The user -/// must be granted the owner role using the Cloud Platform Console and must -/// explicitly accept the invitation. -/// -/// + Invitations to grant the owner role cannot be sent using -/// `setIamPolicy()`; -/// they must be sent only using the Cloud Platform Console. -/// -/// + Membership changes that leave the project without any owners that have -/// accepted the Terms of Service (ToS) will be rejected. -/// -/// + There must be at least one owner who has accepted the Terms of -/// Service (ToS) agreement in the policy. Calling `setIamPolicy()` to -/// to remove the last ToS-accepted owner from the policy will fail. This -/// restriction also applies to legacy projects that no longer have owners -/// who have accepted the ToS. Edits to IAM policies will be rejected until -/// the lack of a ToS-accepting owner is rectified. -/// -/// + Calling this method requires enabling the App Engine Admin API. -/// -/// Note: Removing service accounts from policies or changing their roles -/// can render services completely inoperable. It is important to understand -/// how the service account is being used before removing or updating its -/// roles. +/// Lists all the `Policies` set for a particular resource. /// -/// A builder for the *setIamPolicy* method supported by a *project* resource. +/// A builder for the *listOrgPolicies* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -3762,7 +10142,7 @@ impl<'a, C, A> ProjectUndeleteCall<'a, C, A> where C: BorrowMut, /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; -/// use cloudresourcemanager1::SetIamPolicyRequest; +/// use cloudresourcemanager1::ListOrgPoliciesRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -3776,33 +10156,34 @@ impl<'a, C, A> ProjectUndeleteCall<'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 = SetIamPolicyRequest::default(); +/// let mut req = ListOrgPoliciesRequest::default(); /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().set_iam_policy(req, "resource") +/// let result = hub.projects().list_org_policies(req, "resource") /// .doit(); /// # } /// ``` -pub struct ProjectSetIamPolicyCall<'a, C, A> +pub struct ProjectListOrgPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudResourceManager, - _request: SetIamPolicyRequest, + _request: ListOrgPoliciesRequest, _resource: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectSetIamPolicyCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectListOrgPolicyCall<'a, C, A> {} -impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectListOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOrgPoliciesResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -3810,7 +10191,7 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.setIamPolicy", + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.listOrgPolicies", 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())); @@ -3826,7 +10207,282 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut = 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: ListOrgPoliciesRequest) -> ProjectListOrgPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource to list Policies for. + /// + /// 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) -> ProjectListOrgPolicyCall<'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) -> ProjectListOrgPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectListOrgPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectListOrgPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns permissions that a caller has on the specified Project. +/// +/// A builder for the *testIamPermissions* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::TestIamPermissionsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = 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().test_iam_permissions(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: TestIamPermissionsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.testIamPermissions", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects/{resource}:testIamPermissions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3949,19 +10605,18 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSetIamPolicyCall<'a, C, A> { + pub fn request(mut self, new_value: TestIamPermissionsRequest) -> ProjectTestIamPermissionCall<'a, C, A> { self._request = new_value; self } - /// REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// 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) -> ProjectSetIamPolicyCall<'a, C, A> { + pub fn resource(mut self, new_value: &str) -> ProjectTestIamPermissionCall<'a, C, A> { self._resource = new_value.to_string(); self } @@ -3971,7 +10626,7 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSetIamPolicyCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectTestIamPermissionCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3990,15 +10645,15 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSetIamPolicyCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectTestIamPermissionCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4015,7 +10670,283 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectSetIamPolicyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists `Constraints` that could be applied on the specified resource. +/// +/// A builder for the *listAvailableOrgPolicyConstraints* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::ListAvailableOrgPolicyConstraintsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ListAvailableOrgPolicyConstraintsRequest::default(); +/// +/// // You can configure optional parameters by calling the 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_available_org_policy_constraints(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectListAvailableOrgPolicyConstraintCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: ListAvailableOrgPolicyConstraintsRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectListAvailableOrgPolicyConstraintCall<'a, C, A> {} + +impl<'a, C, A> ProjectListAvailableOrgPolicyConstraintCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAvailableOrgPolicyConstraintsResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.listAvailableOrgPolicyConstraints", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+resource}:listAvailableOrgPolicyConstraints".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: ListAvailableOrgPolicyConstraintsRequest) -> ProjectListAvailableOrgPolicyConstraintCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the resource to list `Constraints` for. + /// + /// 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) -> ProjectListAvailableOrgPolicyConstraintCall<'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) -> ProjectListAvailableOrgPolicyConstraintCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *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> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectListAvailableOrgPolicyConstraintCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -4096,7 +11027,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects/{projectId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4236,12 +11167,12 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectGetCall<'a, C, A> @@ -4269,6 +11200,589 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa } +/// Lists Projects that are visible to the user and satisfy the +/// specified filter. This method returns Projects in an unspecified order. +/// New Projects do not necessarily appear at the end of the list. +/// +/// A builder for the *list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().list() +/// .page_token("amet") +/// .page_size(-60) +/// .filter("labore") +/// .doit(); +/// # } +/// ``` +pub struct ProjectListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _page_token: Option, + _page_size: Option, + _filter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectListCall<'a, C, A> {} + +impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListProjectsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "pageToken", "pageSize", "filter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// A pagination token returned from a previous call to ListProjects + /// that indicates from where listing should continue. + /// + /// Optional. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of Projects to return in the response. + /// The server can return fewer Projects than requested. + /// If unspecified, server picks an appropriate default. + /// + /// Optional. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// An expression for filtering the results of the request. Filter rules are + /// case insensitive. The fields eligible for filtering are: + /// + /// + `name` + /// + `id` + /// + labels.key where *key* is the name of a label + /// + /// Some examples of using labels as filters: + /// + /// |Filter|Description| + /// |------|-----------| + /// |name:how*|The project's name starts with "how".| + /// |name:Howl|The project's name is `Howl` or `howl`.| + /// |name:HOWL|Equivalent to above.| + /// |NAME:howl|Equivalent to above.| + /// |labels.color:*|The project has the label `color`.| + /// |labels.color:red|The project's label `color` has the value `red`.| + /// |labels.color:red labels.size:big|The project's label `color` has the + /// value `red` and its label `size` has the value `big`. + /// + /// Optional. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { + self._filter = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Sets the IAM access control policy for the specified Project. Replaces +/// any existing policy. +/// +/// The following constraints apply when using `setIamPolicy()`: +/// +/// + Project does not support `allUsers` and `allAuthenticatedUsers` as +/// `members` in a `Binding` of a `Policy`. +/// +/// + The owner role can be granted only to `user` and `serviceAccount`. +/// +/// + Service accounts can be made owners of a project directly +/// without any restrictions. However, to be added as an owner, a user must be +/// invited via Cloud Platform console and must accept the invitation. +/// +/// + A user cannot be granted the owner role using `setIamPolicy()`. The user +/// must be granted the owner role using the Cloud Platform Console and must +/// explicitly accept the invitation. +/// +/// + Invitations to grant the owner role cannot be sent using +/// `setIamPolicy()`; +/// they must be sent only using the Cloud Platform Console. +/// +/// + Membership changes that leave the project without any owners that have +/// accepted the Terms of Service (ToS) will be rejected. +/// +/// + There must be at least one owner who has accepted the Terms of +/// Service (ToS) agreement in the policy. Calling `setIamPolicy()` to +/// remove the last ToS-accepted owner from the policy will fail. This +/// restriction also applies to legacy projects that no longer have owners +/// who have accepted the ToS. Edits to IAM policies will be rejected until +/// the lack of a ToS-accepting owner is rectified. +/// +/// + Calling this method requires enabling the App Engine Admin API. +/// +/// Note: Removing service accounts from policies or changing their roles +/// can render services completely inoperable. It is important to understand +/// how the service account is being used before removing or updating its +/// roles. +/// +/// A builder for the *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 yup_oauth2 as oauth2; +/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; +/// use cloudresourcemanager1::SetIamPolicyRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use cloudresourcemanager1::CloudResourceManager; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = 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().set_iam_policy(req, "resource") +/// .doit(); +/// # } +/// ``` +pub struct ProjectSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a CloudResourceManager, + _request: SetIamPolicyRequest, + _resource: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.setIamPolicy", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("resource", self._resource.to_string())); + for &field in ["alt", "resource"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects/{resource}:setIamPolicy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{resource}", "resource")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + 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) -> ProjectSetIamPolicyCall<'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) -> ProjectSetIamPolicyCall<'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) -> ProjectSetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Gets a list of ancestors in the resource hierarchy for the Project /// identified by the specified `project_id` (for example, `my-project-123`). /// @@ -4349,7 +11863,7 @@ impl<'a, C, A> ProjectGetAncestryCall<'a, C, A> where C: BorrowMut ProjectGetAncestryCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGetAncestryCall<'a, C, A> @@ -4626,7 +12140,7 @@ impl<'a, C, A> ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1/projects/{projectId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4790,12 +12304,12 @@ impl<'a, C, A> ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectUpdateCall<'a, C, A> @@ -4823,10 +12337,11 @@ impl<'a, C, A> ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: } -/// Returns the IAM access control policy for the specified Project. -/// Permission is denied if the policy or the resource does not exist. +/// Gets the effective `Policy` on a resource. This is the result of merging +/// `Policies` in the resource hierarchy. The returned `Policy` will not have +/// an `etag`set because it is a computed `Policy` across multiple resources. /// -/// A builder for the *getIamPolicy* method supported by a *project* resource. +/// A builder for the *getEffectiveOrgPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -4837,7 +12352,7 @@ impl<'a, C, A> ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; -/// use cloudresourcemanager1::GetIamPolicyRequest; +/// use cloudresourcemanager1::GetEffectiveOrgPolicyRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -4851,33 +12366,34 @@ impl<'a, C, A> ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: /// // As the method needs a request, you would usually fill it with the desired information /// // into the respective structure. Some of the parts shown here might not be applicable ! /// // Values shown here are possibly random and not representative ! -/// let mut req = GetIamPolicyRequest::default(); +/// let mut req = GetEffectiveOrgPolicyRequest::default(); /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().get_iam_policy(req, "resource") +/// let result = hub.projects().get_effective_org_policy(req, "resource") /// .doit(); /// # } /// ``` -pub struct ProjectGetIamPolicyCall<'a, C, A> +pub struct ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudResourceManager, - _request: GetIamPolicyRequest, + _request: GetEffectiveOrgPolicyRequest, _resource: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectGetIamPolicyCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectGetEffectiveOrgPolicyCall<'a, C, A> {} -impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, OrgPolicy)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -4885,7 +12401,7 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.getIamPolicy", + dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.getEffectiveOrgPolicy", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("resource", self._resource.to_string())); @@ -4901,20 +12417,23 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut = None; + for &(find_this, param_name) in [("{+resource}", "resource")].iter() { + let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { - replace_with = Some(value); + replace_with = value.to_string(); break; } } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); } { let mut indices_for_removal: Vec = Vec::with_capacity(1); @@ -5024,19 +12543,17 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectGetIamPolicyCall<'a, C, A> { + pub fn request(mut self, new_value: GetEffectiveOrgPolicyRequest) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> { self._request = new_value; self } - /// REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// The name of the resource to start computing the effective `Policy`. /// /// Sets the *resource* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn resource(mut self, new_value: &str) -> ProjectGetIamPolicyCall<'a, C, A> { + pub fn resource(mut self, new_value: &str) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> { self._resource = new_value.to_string(); self } @@ -5046,7 +12563,7 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectGetIamPolicyCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5065,15 +12582,15 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectGetIamPolicyCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5090,7 +12607,7 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectGetIamPolicyCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectGetEffectiveOrgPolicyCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -5098,33 +12615,12 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut +pub struct OperationGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a CloudResourceManager, - _project_id: String, + _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OperationGetCall<'a, C, A> {} -impl<'a, C, A> ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +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, Empty)> { + 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; @@ -5175,11 +12672,11 @@ impl<'a, C, A> ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.delete", - http_method: hyper::method::Method::Delete }); + dlg.begin(MethodInfo { id: "cloudresourcemanager.operations.get", + http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - for &field in ["alt", "projectId"].iter() { + 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)); @@ -5191,24 +12688,27 @@ impl<'a, C, A> ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{projectId}", "projectId")].iter() { - let mut replace_with: Option<&str> = None; + 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 = Some(value); + replace_with = value.to_string(); break; } } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["projectId"].iter() { + for param_name in ["name"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -5225,489 +12725,6 @@ impl<'a, C, A> ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::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 Project ID (for example, `foo-bar-123`). - /// - /// Required. - /// - /// Sets the *project id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project_id(mut self, new_value: &str) -> ProjectDeleteCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Request that a new Project be created. The result is an Operation which -/// can be used to track the creation process. It is automatically deleted -/// after a few hours, so there is no need to call DeleteOperation. -/// -/// Our SLO permits Project creation to take up to 30 seconds at the 90th -/// percentile. As of 2016-08-29, we are observing 6 seconds 50th percentile -/// latency. 95th percentile latency is around 11 seconds. We recommend -/// polling at the 5th second with an exponential backoff. -/// -/// A builder for the *create* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; -/// use cloudresourcemanager1::Project; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use cloudresourcemanager1::CloudResourceManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = Project::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().create(req) -/// .doit(); -/// # } -/// ``` -pub struct ProjectCreateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudResourceManager, - _request: Project, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectCreateCall<'a, C, A> {} - -impl<'a, C, A> ProjectCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, 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: "cloudresourcemanager.projects.create", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - for &field in ["alt"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/projects"; - 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: Project) -> ProjectCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectCreateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectCreateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectCreateCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Lists Projects that are visible to the user and satisfy the -/// specified filter. This method returns Projects in an unspecified order. -/// New Projects do not necessarily appear at the end of the list. -/// -/// A builder for the *list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_cloudresourcemanager1 as cloudresourcemanager1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use cloudresourcemanager1::CloudResourceManager; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = CloudResourceManager::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().list() -/// .page_token("justo") -/// .page_size(-34) -/// .filter("et") -/// .doit(); -/// # } -/// ``` -pub struct ProjectListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a CloudResourceManager, - _page_token: Option, - _page_size: Option, - _filter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectListCall<'a, C, A> {} - -impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListProjectsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "cloudresourcemanager.projects.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._filter { - params.push(("filter", value.to_string())); - } - for &field in ["alt", "pageToken", "pageSize", "filter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/projects"; - 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, @@ -5777,52 +12794,14 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o } - /// A pagination token returned from a previous call to ListProjects - /// that indicates from where listing should continue. - /// - /// Optional. + /// The name of the operation resource. /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of Projects to return in the response. - /// The server can return fewer Projects than requested. - /// If unspecified, server picks an appropriate default. - /// - /// Optional. + /// Sets the *name* path property to the given value. /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// An expression for filtering the results of the request. Filter rules are - /// case insensitive. The fields eligible for filtering are: - /// - /// + `name` - /// + `id` - /// + labels.key where *key* is the name of a label - /// - /// Some examples of using labels as filters: - /// - /// |Filter|Description| - /// |------|-----------| - /// |name:*|The project has a name.| - /// |name:Howl|The project's name is `Howl` or `howl`.| - /// |name:HOWL|Equivalent to above.| - /// |NAME:howl|Equivalent to above.| - /// |labels.color:*|The project has the label `color`.| - /// |labels.color:red|The project's label `color` has the value `red`.| - /// |labels.color:red label.size:big|The project's label `color` has the - /// value `red` and its label `size` has the value `big`. - /// - /// Optional. - /// - /// Sets the *filter* query property to the given value. - pub fn filter(mut self, new_value: &str) -> ProjectListCall<'a, C, A> { - self._filter = Some(new_value.to_string()); + /// 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 @@ -5831,7 +12810,7 @@ impl<'a, C, A> ProjectListCall<'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) -> ProjectListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OperationGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5850,15 +12829,15 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectListCall<'a, C, A> + 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 @@ -5875,7 +12854,7 @@ impl<'a, C, A> ProjectListCall<'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) -> ProjectListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OperationGetCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -5883,3 +12862,4 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o } + diff --git a/gen/cloudresourcemanager1_beta1-cli/Cargo.toml b/gen/cloudresourcemanager1_beta1-cli/Cargo.toml index 3fcc4a1e10..459bb78707 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.4+20161212" +version = "1.0.4+20170517" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-cloudresourcemanager1_beta1] path = "../cloudresourcemanager1_beta1" -version = "1.0.4+20161212" +version = "1.0.4+20170517" diff --git a/gen/cloudresourcemanager1_beta1-cli/README.md b/gen/cloudresourcemanager1_beta1-cli/README.md index a3b8328147..61de787b2b 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 *20161212*. The CLI is at version *1.0.4*. +This documentation was generated from the *Cloud Resource Manager* API at revision *20170517*. The CLI is at version *1.0.4*. ```bash cloudresourcemanager1-beta1 [options] diff --git a/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml b/gen/cloudresourcemanager1_beta1-cli/mkdocs.yml index 8789eb1e8b..85e9cc2637 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.4+20161212 +site_name: Cloud Resource Manager v1.0.4+20170517 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 dfcdd6b834..cee16ab833 100644 --- a/gen/cloudresourcemanager1_beta1-cli/src/main.rs +++ b/gen/cloudresourcemanager1_beta1-cli/src/main.rs @@ -273,8 +273,9 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -537,9 +538,9 @@ impl<'n> Engine<'n> { "parent.id" => Some(("parent.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-number" => Some(("projectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "id", "labels", "lifecycle-state", "name", "parent", "project-id", "project-number", "type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -964,8 +965,9 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "policy.etag" => Some(("policy.etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "policy.version" => Some(("policy.version", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update-mask" => Some(("updateMask", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "policy", "update-mask", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1222,9 +1224,9 @@ impl<'n> Engine<'n> { "parent.id" => Some(("parent.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "project-number" => Some(("projectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lifecycle-state" => Some(("lifecycleState", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "id", "labels", "lifecycle-state", "name", "parent", "project-id", "project-number", "type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -1473,8 +1475,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1523,8 +1524,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being specified. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1555,8 +1555,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy detail is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1755,8 +1754,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1815,15 +1813,15 @@ fn main() { must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. - + Invitations to grant the owner role cannot be sent using `setIamPolicy()`; - they must be sent only using the Cloud Platform Console. + + Invitations to grant the owner role cannot be sent using + `setIamPolicy()`; they must be sent only using the Cloud Platform Console. + Membership changes that leave the project without any owners that have accepted the Terms of Service (ToS) will be rejected. + There must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to - to remove the last ToS-accepted owner from the policy will fail. This + remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. @@ -1832,14 +1830,14 @@ fn main() { Note: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand - how the service account is being used before removing or updating its roles."##), + how the service account is being used before removing or updating its + roles."##), "Details at http://byron.github.io/google-apis-rs/google_cloudresourcemanager1_beta1_cli/projects_set-iam-policy", vec![ (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being specified. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1868,8 +1866,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy detail is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1966,7 +1963,7 @@ fn main() { let mut app = App::new("cloudresourcemanager1-beta1") .author("Sebastian Thiel ") - .version("1.0.4+20161212") + .version("1.0.4+20170517") .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 b5f52a444a..ed7fd91dd2 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.4+20161212" +version = "1.0.4+20170517" 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.4+20161212" +documentation = "https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517" license = "MIT" keywords = ["cloudresourcemanager", "google", "protocol", "web", "api"] diff --git a/gen/cloudresourcemanager1_beta1/README.md b/gen/cloudresourcemanager1_beta1/README.md index ef69523f0a..be141c16da 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.4+20161212*, where *20161212* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Cloud Resource Manager* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161212/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html) ... -* [organizations](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.Organization.html) - * [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.OrganizationGetCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.OrganizationGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.OrganizationListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.OrganizationSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.OrganizationTestIamPermissionCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.OrganizationUpdateCall.html) -* [projects](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.Project.html) - * [*create*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.ProjectGetAncestryCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.ProjectGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.ProjectListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.ProjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/struct.ProjectUpdateCall.html) +* [organizations](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.Organization.html) + * [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationGetCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationTestIamPermissionCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.OrganizationUpdateCall.html) +* [projects](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.Project.html) + * [*create*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.ProjectCreateCall.html), [*delete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.ProjectDeleteCall.html), [*get*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.ProjectGetCall.html), [*get ancestry*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.ProjectGetAncestryCall.html), [*get iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.ProjectGetIamPolicyCall.html), [*list*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.ProjectListCall.html), [*set iam policy*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.ProjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.ProjectTestIamPermissionCall.html), [*undelete*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/struct.ProjectUndeleteCall.html) and [*update*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/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.4+20161212/google_cloudresourcemanager1_beta1/struct.CloudResourceManager.html)** +* **[Hub](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/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.4+20161212/google_cloudresourcemanager1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/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.4+20161212/google_cloudresourcemanager1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/google_cloudresourcemanager1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/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. @@ -129,17 +129,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/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.4+20170517/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.4+20161212/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.4+20170517/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.4+20161212/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.4+20170517/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.4+20161212/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.4+20170517/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")`. @@ -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-cloudresourcemanager1_beta1/1.0.4+20161212/google_cloudresourcemanager1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/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.4+20170517/google_cloudresourcemanager1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/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.4+20161212/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.4+20170517/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.4+20161212/google_cloudresourcemanager1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20161212/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.4+20170517/google_cloudresourcemanager1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/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.4+20161212/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.4+20170517/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.4+20161212/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.4+20170517/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.4+20161212/google_cloudresourcemanager1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-cloudresourcemanager1_beta1/1.0.4+20170517/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 aa943e8b67..3cc428f1e9 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.4+20161212*, where *20161212* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Cloud Resource Manager* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *cloudresourcemanager:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Cloud Resource Manager* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/resource-manager). @@ -184,7 +184,7 @@ // 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 +// 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)] @@ -316,8 +316,6 @@ pub struct CloudResourceManager { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for CloudResourceManager {} @@ -330,8 +328,6 @@ impl<'a, C, A> CloudResourceManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://cloudresourcemanager.googleapis.com/".to_string(), - _root_url: "https://cloudresourcemanager.googleapis.com/".to_string(), } } @@ -351,32 +347,49 @@ impl<'a, C, A> CloudResourceManager self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://cloudresourcemanager.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://cloudresourcemanager.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## +/// Provides the configuration for logging a type of permissions. +/// Example: +/// +/// { +/// "audit_log_configs": [ +/// { +/// "log_type": "DATA_READ", +/// "exempted_members": [ +/// "user:foo@gmail.com" +/// ] +/// }, +/// { +/// "log_type": "DATA_WRITE", +/// } +/// ] +/// } +/// +/// This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting +/// foo@gmail.com from DATA_READ logging. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AuditLogConfig { + /// Specifies the identities that do not cause logging for this type of + /// permission. + /// Follows the same format of Binding.members. + #[serde(rename="exemptedMembers")] + pub exempted_members: Option>, + /// The log type that this config enables. + #[serde(rename="logType")] + pub log_type: Option, +} + +impl Part for AuditLogConfig {} + + /// Request message for `GetIamPolicy` method. /// /// # Activities @@ -432,6 +445,13 @@ pub struct SetIamPolicyRequest { /// 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 {} @@ -458,7 +478,7 @@ impl ResponseResult for GetAncestryResponse {} /// A Project is a high-level Google Cloud Platform entity. It is a -/// container for ACLs, APIs, AppEngine Apps, VMs, and other +/// container for ACLs, APIs, App Engine Apps, VMs, and other /// Google Cloud Platform resources. /// /// # Activities @@ -485,7 +505,6 @@ pub struct Project { /// hyphen, single-quote, double-quote, space, and exclamation point. /// /// Example: My Project - /// /// Read-write. pub name: Option, /// An optional reference to a parent Resource. @@ -503,7 +522,6 @@ pub struct Project { /// Trailing hyphens are prohibited. /// /// Example: tokyo-rain-123 - /// /// Read-only after creation. #[serde(rename="projectId")] pub project_id: Option, @@ -521,21 +539,19 @@ pub struct Project { /// depend on specific characters being disallowed. /// /// Example: "environment" : "dev" - /// /// Read-write. pub labels: Option>, + /// The number uniquely identifying the project. + /// + /// Example: 415104041262 + /// Read-only. + #[serde(rename="projectNumber")] + pub project_number: Option, /// Creation time. /// /// Read-only. #[serde(rename="createTime")] pub create_time: Option, - /// The number uniquely identifying the project. - /// - /// Example: 415104041262 - /// - /// Read-only. - #[serde(rename="projectNumber")] - pub project_number: Option, /// The Project lifecycle state. /// /// Read-only. @@ -624,6 +640,9 @@ pub struct Policy { /// If no `etag` is provided in the call to `setIamPolicy`, then the existing /// policy is overwritten blindly. pub etag: Option, + /// Specifies cloud audit logging configuration for this policy. + #[serde(rename="auditConfigs")] + pub audit_configs: Option>, /// Version of the `Policy`. The default version is 0. pub version: Option, } @@ -653,8 +672,8 @@ pub struct Organization { /// This field is required. pub owner: Option, /// A friendly string to be used to refer to the Organization in the UI. - /// Assigned by the server, set to the firm name of the Google For Work - /// customer that owns this organization. + /// Assigned by the server, set to the primary domain of the G Suite + /// customer that owns the organization. /// @OutputOnly #[serde(rename="displayName")] pub display_name: Option, @@ -683,42 +702,18 @@ impl Resource for Organization {} impl ResponseResult for Organization {} -/// A page of the response received from the -/// ListProjects -/// method. +/// Identifying information for a single ancestor of a project. /// -/// 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 Ancestor { + /// Resource id of the ancestor. + #[serde(rename="resourceId")] + pub resource_id: Option, } -impl ResponseResult for ListProjectsResponse {} +impl Part for Ancestor {} /// A generic empty message that you can re-use to avoid defining duplicated @@ -806,23 +801,47 @@ pub struct TestIamPermissionsResponse { impl ResponseResult for TestIamPermissionsResponse {} -/// Identifying information for a single ancestor of a project. +/// 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 Ancestor { - /// Resource id of the ancestor. - #[serde(rename="resourceId")] - pub resource_id: 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 Ancestor {} +impl ResponseResult for ListProjectsResponse {} /// 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 AppEngine app, +/// interact with through one of our API's. Some examples are an App Engine app, /// a Compute Engine instance, a Cloud SQL database, and so on. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -870,6 +889,7 @@ pub struct Binding { /// * `group:{emailid}`: An email address that represents a Google group. /// For example, `admins@example.com`. /// + /// /// * `domain:{domain}`: A Google Apps domain name that represents all the /// users of that domain. For example, `google.com` or `example.com`. /// @@ -880,6 +900,75 @@ pub struct Binding { 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 { + /// 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 {} + + /// The entity that owns an Organization. The lifetime of the Organization and /// all of its descendants are bound to the `OrganizationOwner`. If the /// `OrganizationOwner` is deleted, the Organization and all its descendants will @@ -950,8 +1039,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> OrganizationSetIamPolicyCall<'a, C, A> { OrganizationSetIamPolicyCall { hub: self.hub, @@ -973,8 +1061,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> OrganizationGetIamPolicyCall<'a, C, A> { OrganizationGetIamPolicyCall { hub: self.hub, @@ -996,8 +1083,7 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> OrganizationTestIamPermissionCall<'a, C, A> { OrganizationTestIamPermissionCall { hub: self.hub, @@ -1114,8 +1200,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectTestIamPermissionCall<'a, C, A> { ProjectTestIamPermissionCall { hub: self.hub, @@ -1198,15 +1283,15 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// must be granted the owner role using the Cloud Platform Console and must /// explicitly accept the invitation. /// - /// + Invitations to grant the owner role cannot be sent using `setIamPolicy()`; - /// they must be sent only using the Cloud Platform Console. + /// + Invitations to grant the owner role cannot be sent using + /// `setIamPolicy()`; they must be sent only using the Cloud Platform Console. /// /// + Membership changes that leave the project without any owners that have /// accepted the Terms of Service (ToS) will be rejected. /// /// + There must be at least one owner who has accepted the Terms of /// Service (ToS) agreement in the policy. Calling `setIamPolicy()` to - /// to remove the last ToS-accepted owner from the policy will fail. This + /// remove the last ToS-accepted owner from the policy will fail. This /// restriction also applies to legacy projects that no longer have owners /// who have accepted the ToS. Edits to IAM policies will be rejected until /// the lack of a ToS-accepting owner is rectified. @@ -1215,14 +1300,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Note: Removing service accounts from policies or changing their roles /// can render services completely inoperable. It is important to understand - /// how the service account is being used before removing or updating its roles. + /// how the service account is being used before removing or updating its + /// roles. /// /// # Arguments /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSetIamPolicyCall<'a, C, A> { ProjectSetIamPolicyCall { hub: self.hub, @@ -1310,8 +1395,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectGetIamPolicyCall<'a, C, A> { ProjectGetIamPolicyCall { hub: self.hub, @@ -1470,7 +1554,7 @@ impl<'a, C, A> OrganizationSetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationSetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationGetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationGetIamPolicyCall<'a, C, A> where C: BorrowMut OrganizationTestIamPermissionCall<'a, C, A> where C: BorrowMut OrganizationTestIamPermissionCall<'a, C, A> where C: BorrowMut OrganizationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2566,7 +2647,7 @@ impl<'a, C, A> OrganizationUpdateCall<'a, C, A> where C: BorrowMut OrganizationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/organizations"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/organizations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3104,7 +3185,7 @@ impl<'a, C, A> ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectUndeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/projects/{projectId}:undelete"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}:undelete".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3668,7 +3748,7 @@ impl<'a, C, A> ProjectCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/projects"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3857,15 +3937,15 @@ impl<'a, C, A> ProjectCreateCall<'a, C, A> where C: BorrowMut, A: /// must be granted the owner role using the Cloud Platform Console and must /// explicitly accept the invitation. /// -/// + Invitations to grant the owner role cannot be sent using `setIamPolicy()`; -/// they must be sent only using the Cloud Platform Console. +/// + Invitations to grant the owner role cannot be sent using +/// `setIamPolicy()`; they must be sent only using the Cloud Platform Console. /// /// + Membership changes that leave the project without any owners that have /// accepted the Terms of Service (ToS) will be rejected. /// /// + There must be at least one owner who has accepted the Terms of /// Service (ToS) agreement in the policy. Calling `setIamPolicy()` to -/// to remove the last ToS-accepted owner from the policy will fail. This +/// remove the last ToS-accepted owner from the policy will fail. This /// restriction also applies to legacy projects that no longer have owners /// who have accepted the ToS. Edits to IAM policies will be rejected until /// the lack of a ToS-accepting owner is rectified. @@ -3874,7 +3954,8 @@ impl<'a, C, A> ProjectCreateCall<'a, C, A> where C: BorrowMut, A: /// /// Note: Removing service accounts from policies or changing their roles /// can render services completely inoperable. It is important to understand -/// how the service account is being used before removing or updating its roles. +/// how the service account is being used before removing or updating its +/// roles. /// /// A builder for the *setIamPolicy* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -3951,7 +4032,7 @@ impl<'a, C, A> ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/projects/{projectId}"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4474,7 +4554,7 @@ impl<'a, C, A> ProjectGetAncestryCall<'a, C, A> where C: BorrowMut ProjectUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/projects/{projectId}"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5026,7 +5106,7 @@ impl<'a, C, A> ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/projects/{projectId}"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects/{projectId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5574,7 +5653,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/projects"; + let mut url = "https://cloudresourcemanager.googleapis.com/v1beta1/projects".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5688,13 +5767,14 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o /// /// |Filter|Description| /// |------|-----------| - /// |name:*|The project has a name.| + /// |name:how*|The project's name starts with "how".| /// |name:Howl|The project's name is `Howl` or `howl`.| /// |name:HOWL|Equivalent to above.| /// |NAME:howl|Equivalent to above.| /// |labels.color:*|The project has the label `color`.| /// |labels.color:red|The project's label `color` has the value `red`.| - /// |labels.color:red label.size:big|The project's label `color` has the value `red` and its label `size` has the value `big`. + /// |labels.color:red labels.size:big|The project's label `color` has the + /// value `red` and its label `size` has the value `big`. /// /// Optional. /// @@ -5761,3 +5841,4 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o } + diff --git a/gen/clouduseraccountsvm_beta-cli/Cargo.toml b/gen/clouduseraccountsvm_beta-cli/Cargo.toml index f7f80ab914..5fcf5e2dee 100644 --- a/gen/clouduseraccountsvm_beta-cli/Cargo.toml +++ b/gen/clouduseraccountsvm_beta-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/clouduseraccountsvm_beta/src/lib.rs b/gen/clouduseraccountsvm_beta/src/lib.rs index ffe88a3a71..646c614a0b 100644 --- a/gen/clouduseraccountsvm_beta/src/lib.rs +++ b/gen/clouduseraccountsvm_beta/src/lib.rs @@ -190,7 +190,7 @@ // 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 +// 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)] @@ -333,8 +333,6 @@ pub struct CloudUserAccounts { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for CloudUserAccounts {} @@ -347,8 +345,6 @@ impl<'a, C, A> CloudUserAccounts client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -374,26 +370,6 @@ impl<'a, C, A> CloudUserAccounts self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/clouduseraccounts/vm_beta/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1487,7 +1463,7 @@ impl<'a, C, A> GlobalAccountsOperationDeleteCall<'a, C, A> where C: BorrowMut GlobalAccountsOperationListCall<'a, C, A> where C: BorrowMut GlobalAccountsOperationGetCall<'a, C, A> where C: BorrowMut UserAddPublicKeyCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/users/{user}/addPublicKey"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/users/{user}/addPublicKey".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2562,7 +2538,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/users"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/users".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudUseraccountReadonly.as_ref().to_string(), ()); } @@ -2844,7 +2820,7 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/users"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/users".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3105,7 +3081,7 @@ impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/users/{user}"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/users/{user}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudUseraccountReadonly.as_ref().to_string(), ()); } @@ -3354,7 +3330,7 @@ impl<'a, C, A> UserRemovePublicKeyCall<'a, C, A> where C: BorrowMut UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/users/{user}"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/users/{user}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3858,7 +3834,7 @@ impl<'a, C, A> GroupDeleteCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/groups/{groupName}"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups/{groupName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4105,7 +4081,7 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/groups/{groupName}"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups/{groupName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudUseraccountReadonly.as_ref().to_string(), ()); } @@ -4359,7 +4335,7 @@ impl<'a, C, A> GroupAddMemberCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/groups/{groupName}/addMember"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups/{groupName}/addMember".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4635,7 +4611,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/groups"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4914,7 +4890,7 @@ 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() + "{project}/global/groups"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudUseraccountReadonly.as_ref().to_string(), ()); } @@ -5198,7 +5174,7 @@ impl<'a, C, A> GroupRemoveMemberCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/groups/{groupName}/removeMember"; + let mut url = "https://www.googleapis.com/clouduseraccounts/vm_beta/projects/{project}/global/groups/{groupName}/removeMember".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5491,7 +5467,7 @@ impl<'a, C, A> LinuxGetLinuxAccountViewCall<'a, C, A> where C: BorrowMut LinuxGetAuthorizedKeysViewCall<'a, C, A> where C: BorrowMut LinuxGetAuthorizedKeysViewCall<'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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-container1] path = "../container1" -version = "1.0.4+20160421" +version = "1.0.4+20170430" diff --git a/gen/container1-cli/README.md b/gen/container1-cli/README.md index 4836eaeb00..b1e88166f6 100644 --- a/gen/container1-cli/README.md +++ b/gen/container1-cli/README.md @@ -25,21 +25,29 @@ 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 *20160421*. The CLI is at version *1.0.4*. +This documentation was generated from the *container* API at revision *20170430*. The CLI is at version *1.0.4*. ```bash container1 [options] projects + zones-clusters-complete-ip-rotation (-r )... [-p ]... [-o ] zones-clusters-create (-r )... [-p ]... [-o ] zones-clusters-delete [-p ]... [-o ] zones-clusters-get [-p ]... [-o ] + zones-clusters-legacy-abac (-r )... [-p ]... [-o ] zones-clusters-list [-p ]... [-o ] zones-clusters-node-pools-create (-r )... [-p ]... [-o ] zones-clusters-node-pools-delete [-p ]... [-o ] zones-clusters-node-pools-get [-p ]... [-o ] zones-clusters-node-pools-list [-p ]... [-o ] + zones-clusters-node-pools-rollback (-r )... [-p ]... [-o ] + zones-clusters-node-pools-set-management (-r )... [-p ]... [-o ] + zones-clusters-resource-labels (-r )... [-p ]... [-o ] + zones-clusters-set-master-auth (-r )... [-p ]... [-o ] + zones-clusters-start-ip-rotation (-r )... [-p ]... [-o ] zones-clusters-update (-r )... [-p ]... [-o ] zones-get-serverconfig [-p ]... [-o ] + zones-operations-cancel (-r )... [-p ]... [-o ] zones-operations-get [-p ]... [-o ] zones-operations-list [-p ]... [-o ] container1 --help diff --git a/gen/container1-cli/mkdocs.yml b/gen/container1-cli/mkdocs.yml index d5469b7222..2ba0649553 100644 --- a/gen/container1-cli/mkdocs.yml +++ b/gen/container1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: container v1.0.4+20160421 +site_name: container v1.0.4+20170430 site_url: http://byron.github.io/google-apis-rs/google-container1-cli site_description: A complete library to interact with container (protocol v1) @@ -9,16 +9,24 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['projects_zones-clusters-complete-ip-rotation.md', 'Projects', 'Zones Clusters Complete Ip Rotation'] - ['projects_zones-clusters-create.md', 'Projects', 'Zones Clusters Create'] - ['projects_zones-clusters-delete.md', 'Projects', 'Zones Clusters Delete'] - ['projects_zones-clusters-get.md', 'Projects', 'Zones Clusters Get'] +- ['projects_zones-clusters-legacy-abac.md', 'Projects', 'Zones Clusters Legacy Abac'] - ['projects_zones-clusters-list.md', 'Projects', 'Zones Clusters List'] - ['projects_zones-clusters-node-pools-create.md', 'Projects', 'Zones Clusters Node Pools Create'] - ['projects_zones-clusters-node-pools-delete.md', 'Projects', 'Zones Clusters Node Pools Delete'] - ['projects_zones-clusters-node-pools-get.md', 'Projects', 'Zones Clusters Node Pools Get'] - ['projects_zones-clusters-node-pools-list.md', 'Projects', 'Zones Clusters Node Pools List'] +- ['projects_zones-clusters-node-pools-rollback.md', 'Projects', 'Zones Clusters Node Pools Rollback'] +- ['projects_zones-clusters-node-pools-set-management.md', 'Projects', 'Zones Clusters Node Pools Set Management'] +- ['projects_zones-clusters-resource-labels.md', 'Projects', 'Zones Clusters Resource Labels'] +- ['projects_zones-clusters-set-master-auth.md', 'Projects', 'Zones Clusters Set Master Auth'] +- ['projects_zones-clusters-start-ip-rotation.md', 'Projects', 'Zones Clusters Start Ip Rotation'] - ['projects_zones-clusters-update.md', 'Projects', 'Zones Clusters Update'] - ['projects_zones-get-serverconfig.md', 'Projects', 'Zones Get Serverconfig'] +- ['projects_zones-operations-cancel.md', 'Projects', 'Zones Operations Cancel'] - ['projects_zones-operations-get.md', 'Projects', 'Zones Operations Get'] - ['projects_zones-operations-list.md', 'Projects', 'Zones Operations List'] diff --git a/gen/container1-cli/src/main.rs b/gen/container1-cli/src/main.rs index 0704633369..58f709f183 100644 --- a/gen/container1-cli/src/main.rs +++ b/gen/container1-cli/src/main.rs @@ -46,6 +46,90 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _projects_zones_clusters_complete_ip_rotation(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::CompleteIPRotationRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_complete_ip_rotation(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_zones_clusters_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -73,6 +157,7 @@ impl<'n> Engine<'n> { "cluster.addons-config.http-load-balancing.disabled" => Some(("cluster.addonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.addons-config.horizontal-pod-autoscaling.disabled" => Some(("cluster.addonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.locations" => Some(("cluster.locations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cluster.enable-kubernetes-alpha" => Some(("cluster.enableKubernetesAlpha", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.network" => Some(("cluster.network", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.logging-service" => Some(("cluster.loggingService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.instance-group-urls" => Some(("cluster.instanceGroupUrls", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -82,28 +167,38 @@ impl<'n> Engine<'n> { "cluster.status" => Some(("cluster.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.description" => Some(("cluster.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-node-version" => Some(("cluster.currentNodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.label-fingerprint" => Some(("cluster.labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-master-version" => Some(("cluster.currentMasterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-auth.username" => Some(("cluster.masterAuth.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-auth.password" => Some(("cluster.masterAuth.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-auth.client-key" => Some(("cluster.masterAuth.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-auth.client-certificate" => Some(("cluster.masterAuth.clientCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.master-auth.cluster-ca-certificate" => Some(("cluster.masterAuth.clusterCaCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.expire-time" => Some(("cluster.expireTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.initial-node-count" => Some(("cluster.initialNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.monitoring-service" => Some(("cluster.monitoringService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.create-time" => Some(("cluster.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.endpoint" => Some(("cluster.endpoint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.current-node-count" => Some(("cluster.currentNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "cluster.name" => Some(("cluster.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.legacy-abac.enabled" => Some(("cluster.legacyAbac.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "cluster.initial-cluster-version" => Some(("cluster.initialClusterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "cluster.node-config.disk-size-gb" => Some(("cluster.nodeConfig.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, 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 })), + "cluster.node-config.preemptible" => Some(("cluster.nodeConfig.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "cluster.node-config.labels" => Some(("cluster.nodeConfig.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "cluster.node-config.service-account" => Some(("cluster.nodeConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.oauth-scopes" => Some(("cluster.nodeConfig.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "cluster.node-config.disk-size-gb" => Some(("cluster.nodeConfig.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "cluster.node-config.local-ssd-count" => Some(("cluster.nodeConfig.localSsdCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "cluster.node-config.image-type" => Some(("cluster.nodeConfig.imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.node-config.metadata" => Some(("cluster.nodeConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "cluster.cluster-ipv4-cidr" => Some(("cluster.clusterIpv4Cidr", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "cluster.subnetwork" => Some(("cluster.subnetwork", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "cluster.resource-labels" => Some(("cluster.resourceLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "cluster.self-link" => Some(("cluster.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "client-certificate", "client-key", "cluster", "cluster-ca-certificate", "cluster-ipv4-cidr", "create-time", "current-master-version", "current-node-count", "current-node-version", "description", "disabled", "disk-size-gb", "endpoint", "horizontal-pod-autoscaling", "http-load-balancing", "initial-cluster-version", "initial-node-count", "instance-group-urls", "locations", "logging-service", "machine-type", "master-auth", "metadata", "monitoring-service", "name", "network", "node-config", "node-ipv4-cidr-size", "oauth-scopes", "password", "self-link", "services-ipv4-cidr", "status", "status-message", "subnetwork", "username", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["addons-config", "client-certificate", "client-key", "cluster", "cluster-ca-certificate", "cluster-ipv4-cidr", "create-time", "current-master-version", "current-node-count", "current-node-version", "description", "disabled", "disk-size-gb", "enable-kubernetes-alpha", "enabled", "endpoint", "expire-time", "horizontal-pod-autoscaling", "http-load-balancing", "image-type", "initial-cluster-version", "initial-node-count", "instance-group-urls", "label-fingerprint", "labels", "legacy-abac", "local-ssd-count", "locations", "logging-service", "machine-type", "master-auth", "metadata", "monitoring-service", "name", "network", "node-config", "node-ipv4-cidr-size", "oauth-scopes", "password", "preemptible", "resource-labels", "self-link", "service-account", "services-ipv4-cidr", "status", "status-message", "subnetwork", "tags", "username", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -267,6 +362,91 @@ impl<'n> Engine<'n> { } } + fn _projects_zones_clusters_legacy_abac(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "enabled" => Some(("enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["enabled"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SetLegacyAbacRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_legacy_abac(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_zones_clusters_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().zones_clusters_list(opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or("")); @@ -343,18 +523,31 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "node-pool.status" => Some(("nodePool.status", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "node-pool.status-message" => Some(("nodePool.statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.self-link" => Some(("nodePool.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.management.upgrade-options.description" => Some(("nodePool.management.upgradeOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.management.upgrade-options.auto-upgrade-start-time" => Some(("nodePool.management.upgradeOptions.autoUpgradeStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.management.auto-repair" => Some(("nodePool.management.autoRepair", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "node-pool.management.auto-upgrade" => Some(("nodePool.management.autoUpgrade", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "node-pool.name" => Some(("nodePool.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.instance-group-urls" => Some(("nodePool.instanceGroupUrls", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "node-pool.autoscaling.min-node-count" => Some(("nodePool.autoscaling.minNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "node-pool.autoscaling.enabled" => Some(("nodePool.autoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "node-pool.autoscaling.max-node-count" => Some(("nodePool.autoscaling.maxNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.version" => Some(("nodePool.version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.initial-node-count" => Some(("nodePool.initialNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "node-pool.config.disk-size-gb" => Some(("nodePool.config.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "node-pool.config.machine-type" => Some(("nodePool.config.machineType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.config.tags" => Some(("nodePool.config.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "node-pool.config.preemptible" => Some(("nodePool.config.preemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "node-pool.config.labels" => Some(("nodePool.config.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "node-pool.config.service-account" => Some(("nodePool.config.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.oauth-scopes" => Some(("nodePool.config.oauthScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "node-pool.config.disk-size-gb" => Some(("nodePool.config.diskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "node-pool.config.local-ssd-count" => Some(("nodePool.config.localSsdCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "node-pool.config.image-type" => Some(("nodePool.config.imageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "node-pool.config.metadata" => Some(("nodePool.config.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "node-pool.self-link" => Some(("nodePool.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "node-pool.status-message" => Some(("nodePool.statusMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["config", "disk-size-gb", "initial-node-count", "instance-group-urls", "machine-type", "metadata", "name", "node-pool", "oauth-scopes", "self-link", "status", "status-message", "version"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "autoscaling", "config", "description", "disk-size-gb", "enabled", "image-type", "initial-node-count", "instance-group-urls", "labels", "local-ssd-count", "machine-type", "management", "max-node-count", "metadata", "min-node-count", "name", "node-pool", "oauth-scopes", "preemptible", "self-link", "service-account", "status", "status-message", "tags", "upgrade-options", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -570,6 +763,438 @@ impl<'n> Engine<'n> { } } + fn _projects_zones_clusters_node_pools_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()[..] { + _ => { + 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::RollbackNodePoolUpgradeRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_node_pools_rollback(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or(""), opt.value_of("node-pool-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_zones_clusters_node_pools_set_management(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "management.upgrade-options.description" => Some(("management.upgradeOptions.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "management.upgrade-options.auto-upgrade-start-time" => Some(("management.upgradeOptions.autoUpgradeStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "management.auto-repair" => Some(("management.autoRepair", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "management.auto-upgrade" => Some(("management.autoUpgrade", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-repair", "auto-upgrade", "auto-upgrade-start-time", "description", "management", "upgrade-options"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SetNodePoolManagementRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_node_pools_set_management(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or(""), opt.value_of("node-pool-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_zones_clusters_resource_labels(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "label-fingerprint" => Some(("labelFingerprint", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resource-labels" => Some(("resourceLabels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["label-fingerprint", "resource-labels"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SetLabelsRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_resource_labels(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_zones_clusters_set_master_auth(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "action" => Some(("action", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.username" => Some(("update.username", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.password" => Some(("update.password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.client-key" => Some(("update.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.client-certificate" => Some(("update.clientCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.cluster-ca-certificate" => Some(("update.clusterCaCertificate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["action", "client-certificate", "client-key", "cluster-ca-certificate", "password", "update", "username"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SetMasterAuthRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_set_master_auth(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _projects_zones_clusters_start_ip_rotation(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + 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::StartIPRotationRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().zones_clusters_start_ip_rotation(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("cluster-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_zones_clusters_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -593,14 +1218,19 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "update.desired-master-version" => Some(("update.desiredMasterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-node-pool-id" => Some(("update.desiredNodePoolId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "update.desired-node-version" => Some(("update.desiredNodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "update.desired-monitoring-service" => Some(("update.desiredMonitoringService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.desired-addons-config.http-load-balancing.disabled" => Some(("update.desiredAddonsConfig.httpLoadBalancing.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "update.desired-addons-config.horizontal-pod-autoscaling.disabled" => Some(("update.desiredAddonsConfig.horizontalPodAutoscaling.disabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-master-version" => Some(("update.desiredMasterVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-locations" => Some(("update.desiredLocations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "update.desired-node-version" => Some(("update.desiredNodeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-monitoring-service" => Some(("update.desiredMonitoringService", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "update.desired-node-pool-autoscaling.min-node-count" => Some(("update.desiredNodePoolAutoscaling.minNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update.desired-node-pool-autoscaling.enabled" => Some(("update.desiredNodePoolAutoscaling.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "update.desired-node-pool-autoscaling.max-node-count" => Some(("update.desiredNodePoolAutoscaling.maxNodeCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "update.desired-image-type" => Some(("update.desiredImageType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["desired-addons-config", "desired-master-version", "desired-monitoring-service", "desired-node-pool-id", "desired-node-version", "disabled", "horizontal-pod-autoscaling", "http-load-balancing", "update"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["desired-addons-config", "desired-image-type", "desired-locations", "desired-master-version", "desired-monitoring-service", "desired-node-pool-autoscaling", "desired-node-pool-id", "desired-node-version", "disabled", "enabled", "horizontal-pod-autoscaling", "http-load-balancing", "max-node-count", "min-node-count", "update"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -712,6 +1342,90 @@ impl<'n> Engine<'n> { } } + fn _projects_zones_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.projects().zones_operations_cancel(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("operation-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_zones_operations_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.projects().zones_operations_get(opt.value_of("project-id").unwrap_or(""), opt.value_of("zone").unwrap_or(""), opt.value_of("operation-id").unwrap_or("")); @@ -823,6 +1537,9 @@ impl<'n> Engine<'n> { match self.opt.subcommand() { ("projects", Some(opt)) => { match opt.subcommand() { + ("zones-clusters-complete-ip-rotation", Some(opt)) => { + call_result = self._projects_zones_clusters_complete_ip_rotation(opt, dry_run, &mut err); + }, ("zones-clusters-create", Some(opt)) => { call_result = self._projects_zones_clusters_create(opt, dry_run, &mut err); }, @@ -832,6 +1549,9 @@ impl<'n> Engine<'n> { ("zones-clusters-get", Some(opt)) => { call_result = self._projects_zones_clusters_get(opt, dry_run, &mut err); }, + ("zones-clusters-legacy-abac", Some(opt)) => { + call_result = self._projects_zones_clusters_legacy_abac(opt, dry_run, &mut err); + }, ("zones-clusters-list", Some(opt)) => { call_result = self._projects_zones_clusters_list(opt, dry_run, &mut err); }, @@ -847,12 +1567,30 @@ impl<'n> Engine<'n> { ("zones-clusters-node-pools-list", Some(opt)) => { call_result = self._projects_zones_clusters_node_pools_list(opt, dry_run, &mut err); }, + ("zones-clusters-node-pools-rollback", Some(opt)) => { + call_result = self._projects_zones_clusters_node_pools_rollback(opt, dry_run, &mut err); + }, + ("zones-clusters-node-pools-set-management", Some(opt)) => { + call_result = self._projects_zones_clusters_node_pools_set_management(opt, dry_run, &mut err); + }, + ("zones-clusters-resource-labels", Some(opt)) => { + call_result = self._projects_zones_clusters_resource_labels(opt, dry_run, &mut err); + }, + ("zones-clusters-set-master-auth", Some(opt)) => { + call_result = self._projects_zones_clusters_set_master_auth(opt, dry_run, &mut err); + }, + ("zones-clusters-start-ip-rotation", Some(opt)) => { + call_result = self._projects_zones_clusters_start_ip_rotation(opt, dry_run, &mut err); + }, ("zones-clusters-update", Some(opt)) => { call_result = self._projects_zones_clusters_update(opt, dry_run, &mut err); }, ("zones-get-serverconfig", Some(opt)) => { call_result = self._projects_zones_get_serverconfig(opt, dry_run, &mut err); }, + ("zones-operations-cancel", Some(opt)) => { + call_result = self._projects_zones_operations_cancel(opt, dry_run, &mut err); + }, ("zones-operations-get", Some(opt)) => { call_result = self._projects_zones_operations_get(opt, dry_run, &mut err); }, @@ -951,20 +1689,78 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'zones-clusters-create', 'zones-clusters-delete', 'zones-clusters-get', 'zones-clusters-list', 'zones-clusters-node-pools-create', 'zones-clusters-node-pools-delete', 'zones-clusters-node-pools-get', 'zones-clusters-node-pools-list', 'zones-clusters-update', 'zones-get-serverconfig', 'zones-operations-get' and 'zones-operations-list'", vec![ - ("zones-clusters-create", - Some(r##"Creates a cluster, consisting of the specified number and type of Google Compute Engine instances. By default, the cluster is created in the project's [default network](/compute/docs/networks-and-firewalls#networks). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster."##), - "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-create", + ("projects", "methods: 'zones-clusters-complete-ip-rotation', 'zones-clusters-create', 'zones-clusters-delete', 'zones-clusters-get', 'zones-clusters-legacy-abac', 'zones-clusters-list', 'zones-clusters-node-pools-create', 'zones-clusters-node-pools-delete', 'zones-clusters-node-pools-get', 'zones-clusters-node-pools-list', 'zones-clusters-node-pools-rollback', 'zones-clusters-node-pools-set-management', 'zones-clusters-resource-labels', 'zones-clusters-set-master-auth', 'zones-clusters-start-ip-rotation', 'zones-clusters-update', 'zones-get-serverconfig', 'zones-operations-cancel', 'zones-operations-get' and 'zones-operations-list'", vec![ + ("zones-clusters-complete-ip-rotation", + Some(r##"Completes master IP rotation."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-complete-ip-rotation", vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://developers.google.com/console/help/new/#projectnumber)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."##), + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("zones-clusters-create", + Some(r##"Creates a cluster, consisting of the specified number and type of Google + Compute Engine instances. + + By default, the cluster is created in the project's + [default network](/compute/docs/networks-and-firewalls#networks). + + One firewall is added for the cluster. After cluster creation, + the cluster creates routes for each node to allow the containers + on that node to communicate with all other instances in the + cluster. + + Finally, an entry is added to the project's global metadata indicating + which CIDR range is being used by the cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-create", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), Some(true), Some(false)), @@ -987,18 +1783,29 @@ fn main() { Some(false)), ]), ("zones-clusters-delete", - Some(r##"Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted. Other Google Compute Engine resources that might be in use by the cluster (e.g. load balancer resources) will not be deleted if they weren't present at the initial create time."##), + Some(r##"Deletes the cluster, including the Kubernetes endpoint and all worker + nodes. + + Firewalls and routes that were configured during cluster creation + are also deleted. + + Other Google Compute Engine resources that might be in use by the cluster + (e.g. load balancer resources) will not be deleted if they weren't present + at the initial create time."##), "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-delete", vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."##), + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), Some(true), Some(false)), @@ -1026,13 +1833,16 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."##), + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), Some(true), Some(false)), @@ -1054,19 +1864,66 @@ fn main() { Some(false), Some(false)), ]), - ("zones-clusters-list", - Some(r##"Lists all clusters owned by a project in either the specified zone or all zones."##), - "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-list", + ("zones-clusters-legacy-abac", + Some(r##"Enables or disables the ABAC authorization mechanism on a cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-legacy-abac", vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones."##), + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to update."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("zones-clusters-list", + Some(r##"Lists all clusters owned by a project in either the specified zone or all + zones."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-list", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides, or "-" for all zones."##), Some(true), Some(false)), @@ -1088,13 +1945,16 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://developers.google.com/console/help/new/#projectnumber)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."##), + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), Some(true), Some(false)), @@ -1128,13 +1988,16 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://developers.google.com/console/help/new/#projectnumber)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."##), + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), Some(true), Some(false)), @@ -1168,13 +2031,16 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://developers.google.com/console/help/new/#projectnumber)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."##), + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), Some(true), Some(false)), @@ -1208,13 +2074,16 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://developers.google.com/console/help/new/#projectnumber)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."##), + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), Some(true), Some(false)), @@ -1230,6 +2099,236 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("zones-clusters-node-pools-rollback", + Some(r##"Roll back the previously Aborted or Failed NodePool upgrade. + This will be an no-op if the last upgrade successfully completed."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-node-pools-rollback", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to rollback."##), + Some(true), + Some(false)), + + (Some(r##"node-pool-id"##), + None, + Some(r##"The name of the node pool to rollback."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("zones-clusters-node-pools-set-management", + Some(r##"Sets the NodeManagement options for a node pool."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-node-pools-set-management", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to update."##), + Some(true), + Some(false)), + + (Some(r##"node-pool-id"##), + None, + Some(r##"The name of the node pool to update."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("zones-clusters-resource-labels", + Some(r##"Sets labels on a cluster."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-resource-labels", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://developers.google.com/console/help/new/#projectnumber)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("zones-clusters-set-master-auth", + Some(r##"Used to set master auth materials. Currently supports :- + Changing the admin password of a specific cluster. + This can be either via password generation or explicitly set the password."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-set-master-auth", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster to upgrade."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("zones-clusters-start-ip-rotation", + Some(r##"Start master IP rotation."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-clusters-start-ip-rotation", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://developers.google.com/console/help/new/#projectnumber)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), + Some(true), + Some(false)), + + (Some(r##"cluster-id"##), + None, + Some(r##"The name of the cluster."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1242,13 +2341,16 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."##), + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), Some(true), Some(false)), @@ -1282,13 +2384,15 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for."##), + Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) + to return operations for."##), Some(true), Some(false)), @@ -1298,6 +2402,48 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("zones-operations-cancel", + Some(r##"Cancels the specified operation."##), + "Details at http://byron.github.io/google-apis-rs/google_container1_cli/projects_zones-operations-cancel", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), + Some(true), + Some(false)), + + (Some(r##"zone"##), + None, + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the operation resides."##), + Some(true), + Some(false)), + + (Some(r##"operation-id"##), + None, + Some(r##"The server-assigned `name` of the operation."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1310,13 +2456,16 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides."##), + Some(r##"The name of the Google Compute Engine + [zone](/compute/docs/zones#available) in which the cluster + resides."##), Some(true), Some(false)), @@ -1344,13 +2493,15 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840)."##), + Some(r##"The Google Developers Console [project ID or project + number](https://support.google.com/cloud/answer/6158840)."##), Some(true), Some(false)), (Some(r##"zone"##), None, - Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones."##), + Some(r##"The name of the Google Compute Engine [zone](/compute/docs/zones#available) + to return operations for, or `-` for all zones."##), Some(true), Some(false)), @@ -1372,8 +2523,8 @@ fn main() { let mut app = App::new("container1") .author("Sebastian Thiel ") - .version("1.0.4+20160421") - .about("Builds and manages clusters that run container-based applications, powered by open source Kubernetes technology.") + .version("1.0.4+20170430") + .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") .long("scope") diff --git a/gen/container1/Cargo.toml b/gen/container1/Cargo.toml index 185fa6e1f8..a579b9d0c2 100644 --- a/gen/container1/Cargo.toml +++ b/gen/container1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-container1" -version = "1.0.4+20160421" +version = "1.0.4+20170430" 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.4+20160421" +documentation = "https://docs.rs/google-container1/1.0.4+20170430" license = "MIT" keywords = ["container", "google", "protocol", "web", "api"] diff --git a/gen/container1/README.md b/gen/container1/README.md index 0c2afac6fb..12ef95f258 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.4+20160421*, where *20160421* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *container* crate version *1.0.4+20170430*, where *20170430* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20160421/google_container1/struct.Container.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.Container.html) ... * projects - * [*zones clusters create*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneClusterGetCall.html), [*zones clusters list*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneClusterListCall.html), [*zones clusters node pools create*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters update*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneGetServerconfigCall.html), [*zones operations get*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/struct.ProjectZoneOperationListCall.html) + * [*zones clusters complete ip rotation*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterCompleteIpRotationCall.html), [*zones clusters create*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterGetCall.html), [*zones clusters legacy abac*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterLegacyAbacCall.html), [*zones clusters list*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterListCall.html), [*zones clusters node pools create*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters node pools rollback*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterNodePoolRollbackCall.html), [*zones clusters node pools set management*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterNodePoolSetManagementCall.html), [*zones clusters resource labels*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterResourceLabelCall.html), [*zones clusters set master auth*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterSetMasterAuthCall.html), [*zones clusters start ip rotation*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterStartIpRotationCall.html), [*zones clusters update*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneGetServerconfigCall.html), [*zones operations cancel*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneOperationCancelCall.html), [*zones operations get*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](https://docs.rs/google-container1/1.0.4+20170430/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.4+20160421/google_container1/struct.Container.html)** +* **[Hub](https://docs.rs/google-container1/1.0.4+20170430/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.4+20160421/google_container1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-container1/1.0.4+20160421/google_container1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-container1/1.0.4+20160421/google_container1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-container1/1.0.4+20170430/google_container1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-container1/1.0.4+20170430/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.4+20160421/google_container1/trait.Part.html)** + * **[Parts](https://docs.rs/google-container1/1.0.4+20170430/google_container1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-container1/1.0.4+20160421/google_container1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-container1/1.0.4+20170430/google_container1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -47,12 +47,19 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.projects().zones_clusters_node_pools_create(...).doit() +let r = hub.projects().zones_clusters_node_pools_rollback(...).doit() let r = hub.projects().zones_clusters_delete(...).doit() +let r = hub.projects().zones_clusters_node_pools_create(...).doit() +let r = hub.projects().zones_clusters_set_master_auth(...).doit() +let r = hub.projects().zones_clusters_complete_ip_rotation(...).doit() +let r = hub.projects().zones_clusters_node_pools_set_management(...).doit() +let r = hub.projects().zones_clusters_legacy_abac(...).doit() let r = hub.projects().zones_operations_get(...).doit() -let r = hub.projects().zones_clusters_node_pools_delete(...).doit() -let r = hub.projects().zones_clusters_update(...).doit() +let r = hub.projects().zones_clusters_resource_labels(...).doit() let r = hub.projects().zones_clusters_create(...).doit() +let r = hub.projects().zones_clusters_update(...).doit() +let r = hub.projects().zones_clusters_start_ip_rotation(...).doit() +let r = hub.projects().zones_clusters_node_pools_delete(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -77,7 +84,7 @@ google-container1 = "*" extern crate hyper; extern crate yup_oauth2 as oauth2; extern crate google_container1 as container1; -use container1::CreateNodePoolRequest; +use container1::RollbackNodePoolUpgradeRequest; use container1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -98,12 +105,12 @@ let mut hub = Container::new(hyper::Client::new(), auth); // As the method needs a request, you would usually fill it with the desired information // into the respective structure. Some of the parts shown here might not be applicable ! // Values shown here are possibly random and not representative ! -let mut req = CreateNodePoolRequest::default(); +let mut req = RollbackNodePoolUpgradeRequest::default(); // You can configure optional parameters by calling the respective setters at will, and // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! -let result = hub.projects().zones_clusters_node_pools_create(req, "projectId", "zone", "clusterId") +let result = hub.projects().zones_clusters_node_pools_rollback(req, "projectId", "zone", "clusterId", "nodePoolId") .doit(); match result { @@ -126,17 +133,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-container1/1.0.4+20160421/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.4+20170430/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.4+20160421/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.4+20170430/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.4+20160421/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.4+20170430/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.4+20160421/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.4+20170430/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")`. @@ -146,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-container1/1.0.4+20160421/google_container1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-container1/1.0.4+20160421/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.4+20170430/google_container1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-container1/1.0.4+20170430/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.4+20160421/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.4+20170430/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.4+20160421/google_container1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-container1/1.0.4+20160421/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.4+20170430/google_container1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-container1/1.0.4+20170430/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.4+20160421/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.4+20170430/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.4+20160421/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.4+20170430/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.4+20160421/google_container1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-container1/1.0.4+20170430/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 5c59f2b2a5..72cee2f3fb 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.4+20160421*, where *20160421* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *container* crate version *1.0.4+20170430*, where *20170430* is the exact revision of the *container:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *container* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/container-engine/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Container.html) ... //! //! * projects -//! * [*zones clusters create*](struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](struct.ProjectZoneClusterGetCall.html), [*zones clusters list*](struct.ProjectZoneClusterListCall.html), [*zones clusters node pools create*](struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters update*](struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](struct.ProjectZoneGetServerconfigCall.html), [*zones operations get*](struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](struct.ProjectZoneOperationListCall.html) +//! * [*zones clusters complete ip rotation*](struct.ProjectZoneClusterCompleteIpRotationCall.html), [*zones clusters create*](struct.ProjectZoneClusterCreateCall.html), [*zones clusters delete*](struct.ProjectZoneClusterDeleteCall.html), [*zones clusters get*](struct.ProjectZoneClusterGetCall.html), [*zones clusters legacy abac*](struct.ProjectZoneClusterLegacyAbacCall.html), [*zones clusters list*](struct.ProjectZoneClusterListCall.html), [*zones clusters node pools create*](struct.ProjectZoneClusterNodePoolCreateCall.html), [*zones clusters node pools delete*](struct.ProjectZoneClusterNodePoolDeleteCall.html), [*zones clusters node pools get*](struct.ProjectZoneClusterNodePoolGetCall.html), [*zones clusters node pools list*](struct.ProjectZoneClusterNodePoolListCall.html), [*zones clusters node pools rollback*](struct.ProjectZoneClusterNodePoolRollbackCall.html), [*zones clusters node pools set management*](struct.ProjectZoneClusterNodePoolSetManagementCall.html), [*zones clusters resource labels*](struct.ProjectZoneClusterResourceLabelCall.html), [*zones clusters set master auth*](struct.ProjectZoneClusterSetMasterAuthCall.html), [*zones clusters start ip rotation*](struct.ProjectZoneClusterStartIpRotationCall.html), [*zones clusters update*](struct.ProjectZoneClusterUpdateCall.html), [*zones get serverconfig*](struct.ProjectZoneGetServerconfigCall.html), [*zones operations cancel*](struct.ProjectZoneOperationCancelCall.html), [*zones operations get*](struct.ProjectZoneOperationGetCall.html) and [*zones operations list*](struct.ProjectZoneOperationListCall.html) //! //! //! @@ -47,12 +47,19 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.projects().zones_clusters_node_pools_create(...).doit() +//! let r = hub.projects().zones_clusters_node_pools_rollback(...).doit() //! let r = hub.projects().zones_clusters_delete(...).doit() +//! let r = hub.projects().zones_clusters_node_pools_create(...).doit() +//! let r = hub.projects().zones_clusters_set_master_auth(...).doit() +//! let r = hub.projects().zones_clusters_complete_ip_rotation(...).doit() +//! let r = hub.projects().zones_clusters_node_pools_set_management(...).doit() +//! let r = hub.projects().zones_clusters_legacy_abac(...).doit() //! let r = hub.projects().zones_operations_get(...).doit() -//! let r = hub.projects().zones_clusters_node_pools_delete(...).doit() -//! let r = hub.projects().zones_clusters_update(...).doit() +//! let r = hub.projects().zones_clusters_resource_labels(...).doit() //! let r = hub.projects().zones_clusters_create(...).doit() +//! let r = hub.projects().zones_clusters_update(...).doit() +//! let r = hub.projects().zones_clusters_start_ip_rotation(...).doit() +//! let r = hub.projects().zones_clusters_node_pools_delete(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -77,7 +84,7 @@ //! extern crate hyper; //! extern crate yup_oauth2 as oauth2; //! extern crate google_container1 as container1; -//! use container1::CreateNodePoolRequest; +//! use container1::RollbackNodePoolUpgradeRequest; //! use container1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -99,12 +106,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 = CreateNodePoolRequest::default(); +//! let mut req = RollbackNodePoolUpgradeRequest::default(); //! //! // You can configure optional parameters by calling the respective setters at will, and //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! -//! let result = hub.projects().zones_clusters_node_pools_create(req, "projectId", "zone", "clusterId") +//! let result = hub.projects().zones_clusters_node_pools_rollback(req, "projectId", "zone", "clusterId", "nodePoolId") //! .doit(); //! //! match result { @@ -181,7 +188,7 @@ // 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 +// 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)] @@ -260,7 +267,7 @@ impl Default for Scope { /// extern crate hyper; /// extern crate yup_oauth2 as oauth2; /// extern crate google_container1 as container1; -/// use container1::CreateNodePoolRequest; +/// use container1::RollbackNodePoolUpgradeRequest; /// use container1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -282,12 +289,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 = CreateNodePoolRequest::default(); +/// let mut req = RollbackNodePoolUpgradeRequest::default(); /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().zones_clusters_node_pools_create(req, "projectId", "zone", "clusterId") +/// let result = hub.projects().zones_clusters_node_pools_rollback(req, "projectId", "zone", "clusterId", "nodePoolId") /// .doit(); /// /// match result { @@ -312,8 +319,6 @@ pub struct Container { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Container {} @@ -326,8 +331,6 @@ impl<'a, C, A> Container client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://container.googleapis.com/".to_string(), - _root_url: "https://container.googleapis.com/".to_string(), } } @@ -344,53 +347,65 @@ impl<'a, C, A> Container self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://container.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://container.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// ClusterUpdate describes an update to the cluster. Exactly one update can be applied to a cluster with each request, so at most one field can be provided. +/// ClusterUpdate describes an update to the cluster. Exactly one update can +/// be applied to a cluster with each request, so at most one field can be +/// provided. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ClusterUpdate { - /// The Kubernetes version to change the master to. The only valid value is the latest supported version. Use "-" to have the server automatically select the latest version. - #[serde(rename="desiredMasterVersion")] - pub desired_master_version: Option, - /// The node pool to be upgraded. This field is mandatory if the "desired_node_version" or "desired_image_family" is specified and there is more than one node pool on the cluster. - #[serde(rename="desiredNodePoolId")] - pub desired_node_pool_id: Option, - /// The Kubernetes version to change the nodes to (typically an upgrade). Use `-` to upgrade to the latest version supported by the server. - #[serde(rename="desiredNodeVersion")] - pub desired_node_version: Option, - /// The monitoring service the cluster should use to write metrics. Currently available options: * "monitoring.googleapis.com" - the Google Cloud Monitoring service * "none" - no metrics will be exported from the cluster - #[serde(rename="desiredMonitoringService")] - pub desired_monitoring_service: Option, + /// The desired list of Google Compute Engine + /// [locations](/compute/docs/zones#available) in which the cluster's nodes + /// should be located. Changing the locations a cluster is in will result + /// in nodes being either created or removed from the cluster, depending on + /// whether locations are being added or removed. + /// + /// This list must always include the cluster's primary zone. + #[serde(rename="desiredLocations")] + pub desired_locations: Option>, /// Configurations for the various addons available to run in the cluster. #[serde(rename="desiredAddonsConfig")] pub desired_addons_config: Option, + /// The Kubernetes version to change the master to. The only valid value is the + /// latest supported version. Use "-" to have the server automatically select + /// the latest version. + #[serde(rename="desiredMasterVersion")] + pub desired_master_version: Option, + /// The node pool to be upgraded. This field is mandatory if + /// "desired_node_version", "desired_image_family" or + /// "desired_node_pool_autoscaling" is specified and there is more than one + /// node pool on the cluster. + #[serde(rename="desiredNodePoolId")] + pub desired_node_pool_id: Option, + /// The Kubernetes version to change the nodes to (typically an + /// upgrade). Use `-` to upgrade to the latest version supported by + /// the server. + #[serde(rename="desiredNodeVersion")] + pub desired_node_version: Option, + /// The monitoring service the cluster should use to write metrics. + /// Currently available options: + /// + /// * "monitoring.googleapis.com" - the Google Cloud Monitoring service + /// * "none" - no metrics will be exported from the cluster + #[serde(rename="desiredMonitoringService")] + pub desired_monitoring_service: Option, + /// Autoscaler configuration for the node pool specified in + /// desired_node_pool_id. If there is only one pool in the + /// cluster and desired_node_pool_id is not provided then + /// the change applies to that single node pool. + #[serde(rename="desiredNodePoolAutoscaling")] + pub desired_node_pool_autoscaling: Option, + /// The desired image type for the node pool. + /// NOTE: Set the "desired_node_pool" field as well. + #[serde(rename="desiredImageType")] + pub desired_image_type: Option, } impl Part for ClusterUpdate {} @@ -414,19 +429,44 @@ pub struct UpdateClusterRequest { impl RequestValue for UpdateClusterRequest {} -/// Configuration options for the HTTP (L7) load balancing controller addon, which makes it easy to set up HTTP load balancers for services in a cluster. +/// Configuration options for the HTTP (L7) load balancing controller addon, +/// which makes it easy to set up HTTP load balancers for services in a cluster. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct HttpLoadBalancing { - /// Whether the HTTP Load Balancing controller is enabled in the cluster. When enabled, it runs a small pod in the cluster that manages the load balancers. + /// Whether the HTTP Load Balancing controller is enabled in the cluster. + /// When enabled, it runs a small pod in the cluster that manages the load + /// balancers. pub disabled: Option, } impl Part for HttpLoadBalancing {} +/// ListOperationsResponse is the result of ListOperationsRequest. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [zones operations list projects](struct.ProjectZoneOperationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOperationsResponse { + /// A list of operations in the project in the specified zone. + pub operations: Option>, + /// If any zones are listed here, the list of operations returned + /// may be missing the operations from those zones. + #[serde(rename="missingZones")] + pub missing_zones: Option>, +} + +impl ResponseResult for ListOperationsResponse {} + + /// ListClustersResponse is the result of ListClustersRequest. /// /// # Activities @@ -438,9 +478,11 @@ impl Part for HttpLoadBalancing {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListClustersResponse { - /// A list of clusters in the project in the specified zone, or across all ones. + /// 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. + /// If any zones are listed here, the list of clusters returned + /// may be missing those zones. #[serde(rename="missingZones")] pub missing_zones: Option>, } @@ -448,41 +490,6 @@ pub struct ListClustersResponse { impl ResponseResult for ListClustersResponse {} -/// Configuration options for the horizontal pod autoscaling feature, which increases or decreases the number of replica pods a replication controller has based on the resource usage of the existing pods. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HorizontalPodAutoscaling { - /// Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. When enabled, it ensures that a Heapster pod is running in the cluster, which is also used by the Cloud Monitoring service. - pub disabled: Option, -} - -impl Part for HorizontalPodAutoscaling {} - - -/// Parameters that describe the nodes in a cluster. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct NodeConfig { - /// Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB. If unspecified, the default disk size is 100GB. - #[serde(rename="diskSizeGb")] - pub disk_size_gb: Option, - /// The name of a Google Compute Engine [machine type](/compute/docs/machine-types) (e.g. `n1-standard-1`). If unspecified, the default machine type is `n1-standard-1`. - #[serde(rename="machineType")] - pub machine_type: Option, - /// The set of Google API scopes to be made available on all of the node VMs under the "default" service account. The following scopes are recommended, but not required, and by default are not included: * `https://www.googleapis.com/auth/compute` is required for mounting persistent storage on your nodes. * `https://www.googleapis.com/auth/devstorage.read_only` is required for communicating with **gcr.io** (the [Google Container Registry](/container-registry/)). If unspecified, no scopes are added, unless Cloud Logging or Cloud Monitoring are enabled, in which case their required scopes will be added. - #[serde(rename="oauthScopes")] - pub oauth_scopes: Option>, - /// The metadata key/value pairs assigned to instances in the cluster. Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes in length. These are reflected as part of a URL in the metadata server. Additionally, to avoid ambiguity, keys must not conflict with any other metadata keys for the project or be one of the four reserved keys: "instance-template", "kube-env", "startup-script", and "user-data" Values are free-form strings, and only have meaning as interpreted by the image running in the instance. The only restriction placed on them is that each value's size must be less than or equal to 32 KB. The total size of all keys and values must be less than 512 KB. - pub metadata: Option>, -} - -impl Part for NodeConfig {} - - /// Container Engine service configuration. /// /// # Activities @@ -500,17 +507,338 @@ pub struct ServerConfig { /// List of valid node upgrade target versions. #[serde(rename="validNodeVersions")] pub valid_node_versions: Option>, - /// Default image family. - #[serde(rename="defaultImageFamily")] - pub default_image_family: Option, - /// List of valid image families. - #[serde(rename="validImageFamilies")] - pub valid_image_families: Option>, + /// List of valid image types. + #[serde(rename="validImageTypes")] + pub valid_image_types: Option>, + /// List of valid master versions. + #[serde(rename="validMasterVersions")] + pub valid_master_versions: Option>, + /// Default image type. + #[serde(rename="defaultImageType")] + pub default_image_type: Option, } impl ResponseResult for ServerConfig {} +/// A Google Container Engine cluster. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [zones clusters get projects](struct.ProjectZoneClusterGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Cluster { + /// [Output only] The size of the address space on each node for hosting + /// containers. This is provisioned from within the `container_ipv4_cidr` + /// range. + #[serde(rename="nodeIpv4CidrSize")] + pub node_ipv4_cidr_size: Option, + /// [Output only] The current status of this cluster. + pub status: Option, + /// [Output only] The current software version of the master endpoint. + #[serde(rename="currentMasterVersion")] + pub current_master_version: Option, + /// An optional description of this cluster. + pub description: Option, + /// [Output only] The current version of the node software components. + /// If they are currently at multiple versions because they're in the process + /// of being upgraded, this reflects the minimum version of all nodes. + #[serde(rename="currentNodeVersion")] + pub current_node_version: Option, + /// The fingerprint of the set of labels for this cluster. + #[serde(rename="labelFingerprint")] + pub label_fingerprint: Option, + /// Configurations for the various addons available to run in the cluster. + #[serde(rename="addonsConfig")] + pub addons_config: Option, + /// The list of Google Compute Engine + /// [locations](/compute/docs/zones#available) in which the cluster's nodes + /// should be located. + pub locations: Option>, + /// The authentication information for accessing the master endpoint. + #[serde(rename="masterAuth")] + pub master_auth: Option, + /// [Output only] The time the cluster will be automatically + /// deleted in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + #[serde(rename="expireTime")] + pub expire_time: Option, + /// Kubernetes alpha features are enabled on this cluster. This includes alpha + /// API groups (e.g. v1alpha1) and features that may not be production ready in + /// the kubernetes version of the master and nodes. + /// The cluster has no SLA for uptime and master/node upgrades are disabled. + /// Alpha enabled clusters are automatically deleted thirty days after + /// creation. + #[serde(rename="enableKubernetesAlpha")] + pub enable_kubernetes_alpha: Option, + /// The number of nodes to create in this cluster. You must ensure that your + /// Compute Engine resource quota + /// is sufficient for this number of instances. You must also have available + /// firewall and routes quota. + /// For requests, this field should only be used in lieu of a + /// "node_pool" object, since this configuration (along with the + /// "node_config") will be used to create a "NodePool" object with an + /// auto-generated name. Do not use this and a node_pool at the same time. + #[serde(rename="initialNodeCount")] + pub initial_node_count: Option, + /// The node pools associated with this cluster. + /// This field should not be set if "node_config" or "initial_node_count" are + /// specified. + #[serde(rename="nodePools")] + pub node_pools: Option>, + /// The monitoring service the cluster should use to write metrics. + /// Currently available options: + /// + /// * `monitoring.googleapis.com` - the Google Cloud Monitoring service. + /// * `none` - no metrics will be exported from the cluster. + /// * if left as an empty string, `monitoring.googleapis.com` will be used. + #[serde(rename="monitoringService")] + pub monitoring_service: Option, + /// [Output only] The time the cluster was created, in + /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + #[serde(rename="createTime")] + pub create_time: Option, + /// The name of this cluster. The name must be unique within this project + /// and zone, and can be up to 40 characters with the following restrictions: + /// + /// * Lowercase letters, numbers, and hyphens only. + /// * Must start with a letter. + /// * Must end with a number or a letter. + pub name: Option, + /// [Output only] The IP address of this cluster's master endpoint. + /// The endpoint can be accessed from the internet at + /// `https://username:password@endpoint/`. + /// + /// See the `masterAuth` property of this resource for username and + /// password information. + pub endpoint: Option, + /// [Output only] The number of nodes currently in the cluster. + #[serde(rename="currentNodeCount")] + pub current_node_count: Option, + /// The name of the Google Compute Engine + /// [network](/compute/docs/networks-and-firewalls#networks) to which the + /// cluster is connected. If left unspecified, the `default` network + /// will be used. + pub network: Option, + /// The logging service the cluster should use to write logs. + /// Currently available options: + /// + /// * `logging.googleapis.com` - the Google Cloud Logging service. + /// * `none` - no logs will be exported from the cluster. + /// * if left as an empty string,`logging.googleapis.com` will be used. + #[serde(rename="loggingService")] + pub logging_service: Option, + /// [Output only] The resource URLs of [instance + /// groups](/compute/docs/instance-groups/) associated with this + /// cluster. + #[serde(rename="instanceGroupUrls")] + pub instance_group_urls: Option>, + /// Configuration for the legacy ABAC authorization mode. + #[serde(rename="legacyAbac")] + pub legacy_abac: Option, + /// The initial Kubernetes version for this cluster. Valid versions are those + /// found in validMasterVersions returned by getServerConfig. The version can + /// be upgraded over time; such upgrades are reflected in + /// currentMasterVersion and currentNodeVersion. + #[serde(rename="initialClusterVersion")] + pub initial_cluster_version: Option, + /// Parameters used in creating the cluster's nodes. + /// See `nodeConfig` for the description of its properties. + /// For requests, this field should only be used in lieu of a + /// "node_pool" object, since this configuration (along with the + /// "initial_node_count") will be used to create a "NodePool" object with an + /// auto-generated name. Do not use this and a node_pool at the same time. + /// For responses, this field will be populated with the node configuration of + /// the first node pool. + /// + /// If unspecified, the defaults are used. + #[serde(rename="nodeConfig")] + pub node_config: Option, + /// [Output only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, + /// The IP address range of the container pods in this cluster, in + /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + /// notation (e.g. `10.96.0.0/14`). Leave blank to have + /// one automatically chosen or specify a `/14` block in `10.0.0.0/8`. + #[serde(rename="clusterIpv4Cidr")] + pub cluster_ipv4_cidr: Option, + /// The name of the Google Compute Engine + /// [subnetwork](/compute/docs/subnetworks) to which the + /// cluster is connected. + pub subnetwork: Option, + /// [Output only] The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + pub zone: Option, + /// [Output only] The IP address range of the Kubernetes services in + /// this cluster, in + /// [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) + /// notation (e.g. `1.2.3.4/29`). Service addresses are + /// typically put in the last `/16` from the container CIDR. + #[serde(rename="servicesIpv4Cidr")] + pub services_ipv4_cidr: Option, + /// [Output only] Additional information about the current status of this + /// cluster, if available. + #[serde(rename="statusMessage")] + pub status_message: Option, + /// The resource labels for the cluster to use to annotate any related GCE + /// resources. + #[serde(rename="resourceLabels")] + pub resource_labels: Option>, +} + +impl ResponseResult for Cluster {} + + +/// CreateClusterRequest creates a cluster. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [zones clusters create projects](struct.ProjectZoneClusterCreateCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateClusterRequest { + /// A [cluster + /// resource](/container-engine/reference/rest/v1/projects.zones.clusters) + pub cluster: Option, +} + +impl RequestValue for CreateClusterRequest {} + + +/// Parameters that describe the nodes in a cluster. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeConfig { + /// The name of a Google Compute Engine [machine + /// type](/compute/docs/machine-types) (e.g. + /// `n1-standard-1`). + /// + /// If unspecified, the default machine type is + /// `n1-standard-1`. + #[serde(rename="machineType")] + pub machine_type: Option, + /// The list of instance tags applied to all nodes. Tags are used to identify + /// valid sources or targets for network firewalls and are specified by + /// the client during cluster or node pool creation. Each tag within the list + /// must comply with RFC1035. + pub tags: Option>, + /// Whether the nodes are created as preemptible VM instances. See: + /// https://cloud.google.com/compute/docs/instances/preemptible for more + /// inforamtion about preemptible VM instances. + pub preemptible: Option, + /// The map of Kubernetes labels (key/value pairs) to be applied to each node. + /// These will added in addition to any default label(s) that + /// Kubernetes may apply to the node. + /// In case of conflict in label keys, the applied set may differ depending on + /// the Kubernetes version -- it's best to assume the behavior is undefined + /// and conflicts should be avoided. + /// For more information, including usage and the valid values, see: + /// http://kubernetes.io/v1.1/docs/user-guide/labels.html + pub labels: Option>, + /// The Google Cloud Platform Service Account to be used by the node VMs. If + /// no Service Account is specified, the "default" service account is used. + #[serde(rename="serviceAccount")] + pub service_account: Option, + /// The set of Google API scopes to be made available on all of the + /// node VMs under the "default" service account. + /// + /// The following scopes are recommended, but not required, and by default are + /// not included: + /// + /// * `https://www.googleapis.com/auth/compute` is required for mounting + /// persistent storage on your nodes. + /// * `https://www.googleapis.com/auth/devstorage.read_only` is required for + /// communicating with **gcr.io** + /// (the [Google Container Registry](/container-registry/)). + /// + /// If unspecified, no scopes are added, unless Cloud Logging or Cloud + /// Monitoring are enabled, in which case their required scopes will be added. + #[serde(rename="oauthScopes")] + pub oauth_scopes: Option>, + /// Size of the disk attached to each node, specified in GB. + /// The smallest allowed disk size is 10GB. + /// + /// If unspecified, the default disk size is 100GB. + #[serde(rename="diskSizeGb")] + pub disk_size_gb: Option, + /// The metadata key/value pairs assigned to instances in the cluster. + /// + /// Keys must conform to the regexp [a-zA-Z0-9-_]+ and be less than 128 bytes + /// in length. These are reflected as part of a URL in the metadata server. + /// Additionally, to avoid ambiguity, keys must not conflict with any other + /// metadata keys for the project or be one of the four reserved keys: + /// "instance-template", "kube-env", "startup-script", and "user-data" + /// + /// Values are free-form strings, and only have meaning as interpreted by + /// the image running in the instance. The only restriction placed on them is + /// that each value's size must be less than or equal to 32 KB. + /// + /// The total size of all keys and values must be less than 512 KB. + pub metadata: Option>, + /// The image type to use for this node. Note that for a given image type, + /// the latest version of it will be used. + #[serde(rename="imageType")] + pub image_type: Option, + /// The number of local SSD disks to be attached to the node. + /// + /// The limit for this value is dependant upon the maximum number of + /// disks available on a machine per zone. See: + /// https://cloud.google.com/compute/docs/disks/local-ssd#local_ssd_limits + /// for more information. + #[serde(rename="localSsdCount")] + pub local_ssd_count: Option, +} + +impl Part for NodeConfig {} + + +/// AutoUpgradeOptions defines the set of options for the user to control how +/// the Auto Upgrades will proceed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AutoUpgradeOptions { + /// [Output only] This field is set when upgrades are about to commence + /// with the description of the upgrade. + pub description: Option, + /// [Output only] This field is set when upgrades are about to commence + /// with the approximate start time for the upgrades, in + /// [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. + #[serde(rename="autoUpgradeStartTime")] + pub auto_upgrade_start_time: Option, +} + +impl Part for AutoUpgradeOptions {} + + +/// Configuration options for the horizontal pod autoscaling feature, which +/// increases or decreases the number of replica pods a replication controller +/// has based on the resource usage of the existing pods. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HorizontalPodAutoscaling { + /// Whether the Horizontal Pod Autoscaling feature is enabled in the cluster. + /// When enabled, it ensures that a Heapster pod is running in the cluster, + /// which is also used by the Cloud Monitoring service. + pub disabled: Option, +} + +impl Part for HorizontalPodAutoscaling {} + + /// ListNodePoolsResponse is the result of ListNodePoolsRequest. /// /// # Activities @@ -530,7 +858,274 @@ pub struct ListNodePoolsResponse { impl ResponseResult for ListNodePoolsResponse {} -/// NodePool contains the name and configuration for a cluster's node pool. Node pools are a set of nodes (i.e. VM's), with a common configuration and specification, under the control of the cluster master. They may have a set of Kubernetes labels applied to them, which may be used to reference them during pod scheduling. They may also be resized up or down, to accommodate the workload. +/// 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*). +/// +/// * [zones operations cancel projects](struct.ProjectZoneOperationCancelCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// RollbackNodePoolUpgradeRequest rollbacks the previously Aborted or Failed +/// NodePool upgrade. This will be an no-op if the last upgrade successfully +/// completed. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RollbackNodePoolUpgradeRequest { _never_set: Option } + +impl RequestValue for RollbackNodePoolUpgradeRequest {} + + +/// CompleteIPRotationRequest moves the cluster master back into single-IP mode. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [zones clusters complete ip rotation projects](struct.ProjectZoneClusterCompleteIpRotationCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CompleteIPRotationRequest { _never_set: Option } + +impl RequestValue for CompleteIPRotationRequest {} + + +/// SetNodePoolManagementRequest sets the node management properties of a node +/// pool. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [zones clusters node pools set management projects](struct.ProjectZoneClusterNodePoolSetManagementCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetNodePoolManagementRequest { + /// NodeManagement configuration for the node pool. + pub management: Option, +} + +impl RequestValue for SetNodePoolManagementRequest {} + + +/// SetLegacyAbacRequest enables or disables the ABAC authorization mechanism for +/// a cluster. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [zones clusters legacy abac projects](struct.ProjectZoneClusterLegacyAbacCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetLegacyAbacRequest { + /// Whether ABAC authorization will be enabled in the cluster. + pub enabled: Option, +} + +impl RequestValue for SetLegacyAbacRequest {} + + +/// Configuration for the addons that can be automatically spun up in the +/// cluster, enabling additional functionality. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AddonsConfig { + /// Configuration for the HTTP (L7) load balancing controller addon, which + /// makes it easy to set up HTTP load balancers for services in a cluster. + #[serde(rename="httpLoadBalancing")] + pub http_load_balancing: Option, + /// Configuration for the horizontal pod autoscaling feature, which + /// increases or decreases the number of replica pods a replication controller + /// has based on the resource usage of the existing pods. + #[serde(rename="horizontalPodAutoscaling")] + pub horizontal_pod_autoscaling: Option, +} + +impl Part for AddonsConfig {} + + +/// NodePoolAutoscaling contains information required by cluster autoscaler to +/// adjust the size of the node pool to the current cluster usage. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodePoolAutoscaling { + /// Minimum number of nodes in the NodePool. Must be >= 1 and <= + /// max_node_count. + #[serde(rename="minNodeCount")] + pub min_node_count: Option, + /// Is autoscaling enabled for this node pool. + pub enabled: Option, + /// Maximum number of nodes in the NodePool. Must be >= min_node_count. There + /// has to enough quota to scale up the cluster. + #[serde(rename="maxNodeCount")] + pub max_node_count: Option, +} + +impl Part for NodePoolAutoscaling {} + + +/// The authentication information for accessing the master endpoint. +/// Authentication can be done using HTTP basic auth or using client +/// certificates. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MasterAuth { + /// The username to use for HTTP basic authentication to the master endpoint. + /// For clusters v1.6.0 and later, you can disable basic authentication by + /// providing an empty username. + pub username: Option, + /// The password to use for HTTP basic authentication to the master endpoint. + /// Because the master endpoint is open to the Internet, you should create a + /// strong password. If a password is provided for cluster creation, username + /// must be non-empty. + pub password: Option, + /// [Output only] Base64-encoded private key used by clients to authenticate + /// to the cluster endpoint. + #[serde(rename="clientKey")] + pub client_key: Option, + /// [Output only] Base64-encoded public certificate used by clients to + /// authenticate to the cluster endpoint. + #[serde(rename="clientCertificate")] + pub client_certificate: Option, + /// [Output only] Base64-encoded public certificate that is the root of + /// trust for the cluster. + #[serde(rename="clusterCaCertificate")] + pub cluster_ca_certificate: Option, +} + +impl Part for MasterAuth {} + + +/// SetMasterAuthRequest updates the admin password of a cluster. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [zones clusters set master auth projects](struct.ProjectZoneClusterSetMasterAuthCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SetMasterAuthRequest { + /// The exact form of action to be taken on the master auth + pub action: Option, + /// A description of the update. + pub update: Option, +} + +impl RequestValue for SetMasterAuthRequest {} + + +/// 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 +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 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 RequestValue for SetLabelsRequest {} + + +/// Configuration for the legacy Attribute Based Access Control authorization +/// mode. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LegacyAbac { + /// Whether the ABAC authorizer is enabled for this cluster. When enabled, + /// identities in the system, including service accounts, nodes, and + /// controllers, will have statically granted permissions beyond those + /// provided by the RBAC configuration or IAM. + pub enabled: Option, +} + +impl Part for LegacyAbac {} + + +/// NodeManagement defines the set of node management services turned on for the +/// node pool. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NodeManagement { + /// Specifies the Auto Upgrade knobs for the node pool. + #[serde(rename="upgradeOptions")] + pub upgrade_options: Option, + /// A flag that specifies whether the node auto-repair is enabled for the node + /// pool. If enabled, the nodes in this node pool will be monitored and, if + /// they fail health checks too many times, an automatic repair action will be + /// triggered. + #[serde(rename="autoRepair")] + pub auto_repair: Option, + /// A flag that specifies whether node auto-upgrade is enabled for the node + /// pool. If enabled, node auto-upgrade helps keep the nodes in your node pool + /// up to date with the latest release version of Kubernetes. + #[serde(rename="autoUpgrade")] + pub auto_upgrade: Option, +} + +impl Part for NodeManagement {} + + +/// NodePool contains the name and configuration for a cluster's node pool. +/// Node pools are a set of nodes (i.e. VM's), with a common configuration and +/// specification, under the control of the cluster master. They may have a set +/// of Kubernetes labels applied to them, which may be used to reference them +/// during pod scheduling. They may also be resized up or down, to accommodate +/// the workload. /// /// # Activities /// @@ -541,195 +1136,55 @@ impl ResponseResult for ListNodePoolsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct NodePool { - /// The status of the nodes in this pool instance. + /// [Output only] The status of the nodes in this pool instance. pub status: Option, - /// Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, + /// NodeManagement configuration for this 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 [instance + /// groups](/compute/docs/instance-groups/) associated with this + /// node pool. #[serde(rename="instanceGroupUrls")] pub instance_group_urls: Option>, - /// The version of the Kubernetes of this node. + /// 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. pub version: Option, - /// The initial node count for the pool. You must ensure that your Compute Engine resource quota is sufficient for this number of instances. You must also have available firewall and routes quota. + /// The initial node count for the pool. You must ensure that your + /// Compute Engine resource quota + /// is sufficient for this number of instances. You must also have available + /// firewall and routes quota. #[serde(rename="initialNodeCount")] pub initial_node_count: Option, - /// The node configuration of the pool. - pub config: Option, - /// [Output only] Additional information about the current status of this node pool instance, if available. + /// [Output only] Additional information about the current status of this + /// node pool instance, if available. #[serde(rename="statusMessage")] pub status_message: Option, + /// The node configuration of the pool. + pub config: Option, + /// [Output only] Server-defined URL for the resource. + #[serde(rename="selfLink")] + pub self_link: Option, } impl ResponseResult for NodePool {} -/// CreateClusterRequest creates a cluster. +/// CancelOperationRequest cancels a single 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*). /// -/// * [zones clusters create projects](struct.ProjectZoneClusterCreateCall.html) (request) +/// * [zones operations cancel projects](struct.ProjectZoneOperationCancelCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CreateClusterRequest { - /// A [cluster resource](/container-engine/reference/rest/v1/projects.zones.clusters) - pub cluster: Option, -} +pub struct CancelOperationRequest { _never_set: Option } -impl RequestValue for CreateClusterRequest {} - - -/// ListOperationsResponse is the result of ListOperationsRequest. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [zones operations list projects](struct.ProjectZoneOperationListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListOperationsResponse { - /// A list of operations in the project in the specified zone. - pub operations: Option>, - /// If any zones are listed here, the list of operations returned may be missing the operations from those zones. - #[serde(rename="missingZones")] - pub missing_zones: Option>, -} - -impl ResponseResult for ListOperationsResponse {} - - -/// Configuration for the addons that can be automatically spun up in the cluster, enabling additional functionality. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AddonsConfig { - /// Configuration for the HTTP (L7) load balancing controller addon, which makes it easy to set up HTTP load balancers for services in a cluster. - #[serde(rename="httpLoadBalancing")] - pub http_load_balancing: Option, - /// Configuration for the horizontal pod autoscaling feature, which increases or decreases the number of replica pods a replication controller has based on the resource usage of the existing pods. - #[serde(rename="horizontalPodAutoscaling")] - pub horizontal_pod_autoscaling: Option, -} - -impl Part for AddonsConfig {} - - -/// The authentication information for accessing the master endpoint. Authentication can be done using HTTP basic auth or using client certificates. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct MasterAuth { - /// The username to use for HTTP basic authentication to the master endpoint. - pub username: Option, - /// The password to use for HTTP basic authentication to the master endpoint. Because the master endpoint is open to the Internet, you should create a strong password. - pub password: Option, - /// [Output only] Base64-encoded private key used by clients to authenticate to the cluster endpoint. - #[serde(rename="clientKey")] - pub client_key: Option, - /// [Output only] Base64-encoded public certificate used by clients to authenticate to the cluster endpoint. - #[serde(rename="clientCertificate")] - pub client_certificate: Option, - /// [Output only] Base64-encoded public certificate that is the root of trust for the cluster. - #[serde(rename="clusterCaCertificate")] - pub cluster_ca_certificate: Option, -} - -impl Part for MasterAuth {} - - -/// A Google Container Engine cluster. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [zones clusters get projects](struct.ProjectZoneClusterGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Cluster { - /// [Output only] The size of the address space on each node for hosting containers. This is provisioned from within the `container_ipv4_cidr` range. - #[serde(rename="nodeIpv4CidrSize")] - pub node_ipv4_cidr_size: Option, - /// [Output only] The current status of this cluster. - pub status: Option, - /// [Output only] The current software version of the master endpoint. - #[serde(rename="currentMasterVersion")] - pub current_master_version: Option, - /// An optional description of this cluster. - pub description: Option, - /// [Output only] The current version of the node software components. If they are currently at multiple versions because they're in the process of being upgraded, this reflects the minimum version of all nodes. - #[serde(rename="currentNodeVersion")] - pub current_node_version: Option, - /// Configurations for the various addons available to run in the cluster. - #[serde(rename="addonsConfig")] - pub addons_config: Option, - /// The list of Google Compute Engine [locations](/compute/docs/zones#available) in which the cluster's nodes should be located. - pub locations: Option>, - /// The authentication information for accessing the master endpoint. - #[serde(rename="masterAuth")] - pub master_auth: Option, - /// The number of nodes to create in this cluster. You must ensure that your Compute Engine resource quota is sufficient for this number of instances. You must also have available firewall and routes quota. For requests, this field should only be used in lieu of a "node_pool" object, since this configuration (along with the "node_config") will be used to create a "NodePool" object with an auto-generated name. Do not use this and a node_pool at the same time. - #[serde(rename="initialNodeCount")] - pub initial_node_count: Option, - /// The node pools associated with this cluster. When creating a new cluster, only a single node pool should be specified. This field should not be set if "node_config" or "initial_node_count" are specified. - #[serde(rename="nodePools")] - pub node_pools: Option>, - /// The monitoring service the cluster should use to write metrics. Currently available options: * `monitoring.googleapis.com` - the Google Cloud Monitoring service. * `none` - no metrics will be exported from the cluster. * if left as an empty string, `monitoring.googleapis.com` will be used. - #[serde(rename="monitoringService")] - pub monitoring_service: Option, - /// [Output only] The time the cluster was created, in [RFC3339](https://www.ietf.org/rfc/rfc3339.txt) text format. - #[serde(rename="createTime")] - pub create_time: Option, - /// The name of this cluster. The name must be unique within this project and zone, and can be up to 40 characters with the following restrictions: * Lowercase letters, numbers, and hyphens only. * Must start with a letter. * Must end with a number or a letter. - pub name: Option, - /// [Output only] The IP address of this cluster's master endpoint. The endpoint can be accessed from the internet at `https://username:password@endpoint/`. See the `masterAuth` property of this resource for username and password information. - pub endpoint: Option, - /// [Output only] The number of nodes currently in the cluster. - #[serde(rename="currentNodeCount")] - pub current_node_count: Option, - /// The name of the Google Compute Engine [network](/compute/docs/networks-and-firewalls#networks) to which the cluster is connected. If left unspecified, the `default` network will be used. - pub network: Option, - /// The logging service the cluster should use to write logs. Currently available options: * `logging.googleapis.com` - the Google Cloud Logging service. * `none` - no logs will be exported from the cluster. * if left as an empty string,`logging.googleapis.com` will be used. - #[serde(rename="loggingService")] - pub logging_service: Option, - /// [Output only] The resource URLs of [instance groups](/compute/docs/instance-groups/) associated with this cluster. - #[serde(rename="instanceGroupUrls")] - pub instance_group_urls: Option>, - /// [Output only] The software version of the master endpoint and kubelets used in the cluster when it was first created. The version can be upgraded over time. - #[serde(rename="initialClusterVersion")] - pub initial_cluster_version: Option, - /// Parameters used in creating the cluster's nodes. See `nodeConfig` for the description of its properties. For requests, this field should only be used in lieu of a "node_pool" object, since this configuration (along with the "initial_node_count") will be used to create a "NodePool" object with an auto-generated name. Do not use this and a node_pool at the same time. For responses, this field will be populated with the node configuration of the first node pool. If unspecified, the defaults are used. - #[serde(rename="nodeConfig")] - pub node_config: Option, - /// [Output only] Server-defined URL for the resource. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The IP address range of the container pods in this cluster, in [CIDR](http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) notation (e.g. `10.96.0.0/14`). Leave blank to have one automatically chosen or specify a `/14` block in `10.0.0.0/8`. - #[serde(rename="clusterIpv4Cidr")] - pub cluster_ipv4_cidr: Option, - /// The name of the Google Compute Engine [subnetwork](/compute/docs/subnetworks) to which the cluster is connected. - pub subnetwork: Option, - /// [Output only] The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. - pub zone: Option, - /// [Output only] Additional information about the current status of this cluster, if available. - #[serde(rename="statusMessage")] - pub status_message: 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, -} - -impl ResponseResult for Cluster {} +impl RequestValue for CancelOperationRequest {} /// CreateNodePoolRequest creates a node pool for a cluster. @@ -751,19 +1206,27 @@ pub struct CreateNodePoolRequest { impl RequestValue for CreateNodePoolRequest {} -/// This operation resource represents operations that may have happened or are happening on the cluster. All fields are output only. +/// 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 create projects](struct.ProjectZoneClusterNodePoolCreateCall.html) (response) +/// * [zones clusters node pools rollback projects](struct.ProjectZoneClusterNodePoolRollbackCall.html) (response) /// * [zones clusters delete projects](struct.ProjectZoneClusterDeleteCall.html) (response) +/// * [zones clusters node pools create projects](struct.ProjectZoneClusterNodePoolCreateCall.html) (response) +/// * [zones clusters set master auth projects](struct.ProjectZoneClusterSetMasterAuthCall.html) (response) +/// * [zones clusters complete ip rotation projects](struct.ProjectZoneClusterCompleteIpRotationCall.html) (response) +/// * [zones clusters node pools set management projects](struct.ProjectZoneClusterNodePoolSetManagementCall.html) (response) +/// * [zones clusters legacy abac projects](struct.ProjectZoneClusterLegacyAbacCall.html) (response) /// * [zones operations get projects](struct.ProjectZoneOperationGetCall.html) (response) -/// * [zones clusters node pools delete projects](struct.ProjectZoneClusterNodePoolDeleteCall.html) (response) -/// * [zones clusters update projects](struct.ProjectZoneClusterUpdateCall.html) (response) +/// * [zones clusters resource labels projects](struct.ProjectZoneClusterResourceLabelCall.html) (response) /// * [zones clusters create projects](struct.ProjectZoneClusterCreateCall.html) (response) +/// * [zones clusters update projects](struct.ProjectZoneClusterUpdateCall.html) (response) +/// * [zones clusters start ip rotation projects](struct.ProjectZoneClusterStartIpRotationCall.html) (response) +/// * [zones clusters node pools delete projects](struct.ProjectZoneClusterNodePoolDeleteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Operation { @@ -771,19 +1234,21 @@ pub struct Operation { pub status: Option, /// The server-assigned ID for the operation. pub name: Option, - /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the operation is taking place. + /// 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, - /// If an error has occurred, a textual description of the error. - #[serde(rename="statusMessage")] - pub status_message: Option, - /// The operation type. - #[serde(rename="operationType")] - pub operation_type: Option, /// Server-defined URL for the resource. #[serde(rename="selfLink")] pub self_link: Option, + /// The operation type. + #[serde(rename="operationType")] + pub operation_type: Option, + /// If an error has occurred, a textual description of the error. + #[serde(rename="statusMessage")] + pub status_message: Option, /// Server-defined URL for the target of the operation. #[serde(rename="targetLink")] pub target_link: Option, @@ -792,6 +1257,22 @@ pub struct Operation { impl ResponseResult for Operation {} +/// StartIPRotationRequest creates a new IP for the cluster and then performs +/// a node upgrade on each node pool to point to the new IP. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [zones clusters start ip rotation projects](struct.ProjectZoneClusterStartIpRotationCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StartIPRotationRequest { _never_set: Option } + +impl RequestValue for StartIPRotationRequest {} + + // ################### // MethodBuilders ### @@ -820,7 +1301,7 @@ impl ResponseResult for Operation {} /// ::default(), None); /// let mut hub = Container::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `zones_clusters_create(...)`, `zones_clusters_delete(...)`, `zones_clusters_get(...)`, `zones_clusters_list(...)`, `zones_clusters_node_pools_create(...)`, `zones_clusters_node_pools_delete(...)`, `zones_clusters_node_pools_get(...)`, `zones_clusters_node_pools_list(...)`, `zones_clusters_update(...)`, `zones_get_serverconfig(...)`, `zones_operations_get(...)` and `zones_operations_list(...)` +/// // like `zones_clusters_complete_ip_rotation(...)`, `zones_clusters_create(...)`, `zones_clusters_delete(...)`, `zones_clusters_get(...)`, `zones_clusters_legacy_abac(...)`, `zones_clusters_list(...)`, `zones_clusters_node_pools_create(...)`, `zones_clusters_node_pools_delete(...)`, `zones_clusters_node_pools_get(...)`, `zones_clusters_node_pools_list(...)`, `zones_clusters_node_pools_rollback(...)`, `zones_clusters_node_pools_set_management(...)`, `zones_clusters_resource_labels(...)`, `zones_clusters_set_master_auth(...)`, `zones_clusters_start_ip_rotation(...)`, `zones_clusters_update(...)`, `zones_get_serverconfig(...)`, `zones_operations_cancel(...)`, `zones_operations_get(...)` and `zones_operations_list(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -841,8 +1322,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. /// * `clusterId` - The name of the cluster to retrieve. pub fn zones_clusters_get(&self, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterGetCall<'a, C, A> { ProjectZoneClusterGetCall { @@ -856,6 +1340,136 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Returns configuration info about the Container Engine service. + /// + /// # Arguments + /// + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) + /// to return operations for. + pub fn zones_get_serverconfig(&self, project_id: &str, zone: &str) -> ProjectZoneGetServerconfigCall<'a, C, A> { + ProjectZoneGetServerconfigCall { + hub: self.hub, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Cancels the specified operation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the operation resides. + /// * `operationId` - The server-assigned `name` of the operation. + pub fn zones_operations_cancel(&self, request: CancelOperationRequest, project_id: &str, zone: &str, operation_id: &str) -> ProjectZoneOperationCancelCall<'a, C, A> { + ProjectZoneOperationCancelCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _operation_id: operation_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the node pools for a cluster. + /// + /// # Arguments + /// + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster. + pub fn zones_clusters_node_pools_list(&self, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { + ProjectZoneClusterNodePoolListCall { + hub: self.hub, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Used to set master auth materials. Currently supports :- + /// Changing the admin password of a specific cluster. + /// This can be either via password generation or explicitly set the password. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to upgrade. + pub fn zones_clusters_set_master_auth(&self, request: SetMasterAuthRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + ProjectZoneClusterSetMasterAuthCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes the cluster, including the Kubernetes endpoint and all worker + /// nodes. + /// + /// Firewalls and routes that were configured during cluster creation + /// are also deleted. + /// + /// Other Google Compute Engine resources that might be in use by the cluster + /// (e.g. load balancer resources) will not be deleted if they weren't present + /// at the initial create time. + /// + /// # Arguments + /// + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to delete. + pub fn zones_clusters_delete(&self, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { + ProjectZoneClusterDeleteCall { + hub: self.hub, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a node pool for a cluster. @@ -863,8 +1477,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. /// * `clusterId` - The name of the cluster. pub fn zones_clusters_node_pools_create(&self, request: CreateNodePoolRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterNodePoolCreateCall<'a, C, A> { ProjectZoneClusterNodePoolCreateCall { @@ -885,8 +1502,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. /// * `clusterId` - The name of the cluster. /// * `nodePoolId` - The name of the node pool. pub fn zones_clusters_node_pools_get(&self, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolGetCall<'a, C, A> { @@ -904,16 +1524,50 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the cluster, including the Kubernetes endpoint and all worker nodes. Firewalls and routes that were configured during cluster creation are also deleted. Other Google Compute Engine resources that might be in use by the cluster (e.g. load balancer resources) will not be deleted if they weren't present at the initial create time. + /// Roll back the previously Aborted or Failed NodePool upgrade. + /// This will be an no-op if the last upgrade successfully completed. /// /// # Arguments /// - /// * `projectId` - The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. - /// * `clusterId` - The name of the cluster to delete. - pub fn zones_clusters_delete(&self, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { - ProjectZoneClusterDeleteCall { + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to rollback. + /// * `nodePoolId` - The name of the node pool to rollback. + pub fn zones_clusters_node_pools_rollback(&self, request: RollbackNodePoolUpgradeRequest, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> { + ProjectZoneClusterNodePoolRollbackCall { hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _node_pool_id: node_pool_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Start master IP rotation. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster. + pub fn zones_clusters_start_ip_rotation(&self, request: StartIPRotationRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterStartIpRotationCall<'a, C, A> { + ProjectZoneClusterStartIpRotationCall { + hub: self.hub, + _request: request, _project_id: project_id.to_string(), _zone: zone.to_string(), _cluster_id: cluster_id.to_string(), @@ -925,17 +1579,24 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns configuration info about the Container Engine service. + /// Completes master IP rotation. /// /// # Arguments /// - /// * `projectId` - The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for. - pub fn zones_get_serverconfig(&self, project_id: &str, zone: &str) -> ProjectZoneGetServerconfigCall<'a, C, A> { - ProjectZoneGetServerconfigCall { + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster. + pub fn zones_clusters_complete_ip_rotation(&self, request: CompleteIPRotationRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + ProjectZoneClusterCompleteIpRotationCall { hub: self.hub, + _request: request, _project_id: project_id.to_string(), _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -944,16 +1605,49 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the node pools for a cluster. + /// Sets the NodeManagement options for a node pool. /// /// # Arguments /// - /// * `projectId` - The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. - /// * `clusterId` - The name of the cluster. - pub fn zones_clusters_node_pools_list(&self, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { - ProjectZoneClusterNodePoolListCall { + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to update. + /// * `nodePoolId` - The name of the node pool to update. + pub fn zones_clusters_node_pools_set_management(&self, request: SetNodePoolManagementRequest, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> { + ProjectZoneClusterNodePoolSetManagementCall { hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _node_pool_id: node_pool_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Enables or disables the ABAC authorization mechanism on a cluster. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster to update. + pub fn zones_clusters_legacy_abac(&self, request: SetLegacyAbacRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + ProjectZoneClusterLegacyAbacCall { + hub: self.hub, + _request: request, _project_id: project_id.to_string(), _zone: zone.to_string(), _cluster_id: cluster_id.to_string(), @@ -969,8 +1663,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. /// * `operationId` - The server-assigned `name` of the operation. pub fn zones_operations_get(&self, project_id: &str, zone: &str, operation_id: &str) -> ProjectZoneOperationGetCall<'a, C, A> { ProjectZoneOperationGetCall { @@ -984,14 +1681,42 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Sets labels on a cluster. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// * `clusterId` - The name of the cluster. + pub fn zones_clusters_resource_labels(&self, request: SetLabelsRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + ProjectZoneClusterResourceLabelCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _zone: zone.to_string(), + _cluster_id: cluster_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Lists all operations in a project in a specific zone or all zones. /// /// # Arguments /// - /// * `projectId` - The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for, or `-` for all zones. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) + /// to return operations for, or `-` for all zones. pub fn zones_operations_list(&self, project_id: &str, zone: &str) -> ProjectZoneOperationListCall<'a, C, A> { ProjectZoneOperationListCall { hub: self.hub, @@ -1005,13 +1730,28 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a cluster, consisting of the specified number and type of Google Compute Engine instances. By default, the cluster is created in the project's [default network](/compute/docs/networks-and-firewalls#networks). One firewall is added for the cluster. After cluster creation, the cluster creates routes for each node to allow the containers on that node to communicate with all other instances in the cluster. Finally, an entry is added to the project's global metadata indicating which CIDR range is being used by the cluster. + /// Creates a cluster, consisting of the specified number and type of Google + /// Compute Engine instances. + /// + /// By default, the cluster is created in the project's + /// [default network](/compute/docs/networks-and-firewalls#networks). + /// + /// One firewall is added for the cluster. After cluster creation, + /// the cluster creates routes for each node to allow the containers + /// on that node to communicate with all other instances in the + /// cluster. + /// + /// Finally, an entry is added to the project's global metadata indicating + /// which CIDR range is being used by the cluster. /// /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. pub fn zones_clusters_create(&self, request: CreateClusterRequest, project_id: &str, zone: &str) -> ProjectZoneClusterCreateCall<'a, C, A> { ProjectZoneClusterCreateCall { hub: self.hub, @@ -1031,8 +1771,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. /// * `clusterId` - The name of the cluster to upgrade. pub fn zones_clusters_update(&self, request: UpdateClusterRequest, project_id: &str, zone: &str, cluster_id: &str) -> ProjectZoneClusterUpdateCall<'a, C, A> { ProjectZoneClusterUpdateCall { @@ -1049,12 +1792,16 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all clusters owned by a project in either the specified zone or all zones. + /// Lists all clusters owned by a project in either the specified zone or all + /// zones. /// /// # Arguments /// - /// * `projectId` - The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides, or "-" for all zones. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides, or "-" for all zones. pub fn zones_clusters_list(&self, project_id: &str, zone: &str) -> ProjectZoneClusterListCall<'a, C, A> { ProjectZoneClusterListCall { hub: self.hub, @@ -1072,8 +1819,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). - /// * `zone` - The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// * `projectId` - The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// * `zone` - The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. /// * `clusterId` - The name of the cluster. /// * `nodePoolId` - The name of the node pool to delete. pub fn zones_clusters_node_pools_delete(&self, project_id: &str, zone: &str, cluster_id: &str, node_pool_id: &str) -> ProjectZoneClusterNodePoolDeleteCall<'a, C, A> { @@ -1172,7 +1922,7 @@ impl<'a, C, A> ProjectZoneClusterGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Container::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().zones_get_serverconfig("projectId", "zone") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneGetServerconfigCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _project_id: String, + _zone: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneGetServerconfigCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneGetServerconfigCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ServerConfig)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "container.projects.zones.getServerconfig", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + for &field in ["alt", "projectId", "zone"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/serverconfig".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["zone", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectZoneGetServerconfigCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) + /// to return operations for. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ProjectZoneGetServerconfigCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneGetServerconfigCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneGetServerconfigCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectZoneGetServerconfigCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Cancels the specified operation. +/// +/// A builder for the *zones.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 yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::CancelOperationRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CancelOperationRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().zones_operations_cancel(req, "projectId", "zone", "operationId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneOperationCancelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: CancelOperationRequest, + _project_id: String, + _zone: String, + _operation_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneOperationCancelCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneOperationCancelCall<'a, C, 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: "container.projects.zones.operations.cancel", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("operationId", self._operation_id.to_string())); + for &field in ["alt", "projectId", "zone", "operationId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/operations/{operationId}:cancel".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{operationId}", "operationId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["operationId", "zone", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CancelOperationRequest) -> ProjectZoneOperationCancelCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectZoneOperationCancelCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the operation resides. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ProjectZoneOperationCancelCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The server-assigned `name` of the operation. + /// + /// Sets the *operation id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn operation_id(mut self, new_value: &str) -> ProjectZoneOperationCancelCall<'a, C, A> { + self._operation_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneOperationCancelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectZoneOperationCancelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectZoneOperationCancelCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists the node pools for a cluster. +/// +/// A builder for the *zones.clusters.nodePools.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().zones_clusters_node_pools_list("projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterNodePoolListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolListCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListNodePoolsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.nodePools.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["clusterId", "zone", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster. + /// + /// Sets the *cluster id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterNodePoolListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Used to set master auth materials. Currently supports :- +/// Changing the admin password of a specific cluster. +/// This can be either via password generation or explicitly set the password. +/// +/// A builder for the *zones.clusters.setMasterAuth* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetMasterAuthRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SetMasterAuthRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().zones_clusters_set_master_auth(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterSetMasterAuthCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetMasterAuthRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterSetMasterAuthCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterSetMasterAuthCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.setMasterAuth", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:setMasterAuth".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["clusterId", "zone", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetMasterAuthRequest) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to upgrade. + /// + /// Sets the *cluster id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterSetMasterAuthCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Deletes the cluster, including the Kubernetes endpoint and all worker +/// nodes. +/// +/// Firewalls and routes that were configured during cluster creation +/// are also deleted. +/// +/// Other Google Compute Engine resources that might be in use by the cluster +/// (e.g. load balancer resources) will not be deleted if they weren't present +/// at the initial create time. +/// +/// A builder for the *zones.clusters.delete* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().zones_clusters_delete("projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterDeleteCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["clusterId", "zone", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to delete. + /// + /// Sets the *cluster id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Creates a node pool for a cluster. /// /// A builder for the *zones.clusters.nodePools.create* method supported by a *project* resource. @@ -1444,7 +3595,7 @@ impl<'a, C, A> ProjectZoneClusterNodePoolCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools"; + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1571,7 +3722,8 @@ impl<'a, C, A> ProjectZoneClusterNodePoolCreateCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). + /// The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). /// /// Sets the *project id* path property to the given value. /// @@ -1581,7 +3733,9 @@ impl<'a, C, A> ProjectZoneClusterNodePoolCreateCall<'a, C, A> where C: BorrowMut self._project_id = new_value.to_string(); self } - /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. /// /// Sets the *zone* path property to the given value. /// @@ -1621,10 +3775,10 @@ impl<'a, C, A> ProjectZoneClusterNodePoolCreateCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -1735,7 +3889,7 @@ impl<'a, C, A> ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolGetCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Container::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = RollbackNodePoolUpgradeRequest::default(); +/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().zones_clusters_delete("projectId", "zone", "clusterId") +/// let result = hub.projects().zones_clusters_node_pools_rollback(req, "projectId", "zone", "clusterId", "nodePoolId") /// .doit(); /// # } /// ``` -pub struct ProjectZoneClusterDeleteCall<'a, C, A> +pub struct ProjectZoneClusterNodePoolRollbackCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Container, + _request: RollbackNodePoolUpgradeRequest, _project_id: String, _zone: String, _cluster_id: String, + _node_pool_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectZoneClusterDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolRollbackCall<'a, C, A> {} -impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -1992,13 +4158,14 @@ impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "container.projects.zones.clusters.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.nodePools.rollback", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("projectId", self._project_id.to_string())); params.push(("zone", self._zone.to_string())); params.push(("clusterId", self._cluster_id.to_string())); - for &field in ["alt", "projectId", "zone", "clusterId"].iter() { + params.push(("nodePoolId", self._node_pool_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId", "nodePoolId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2010,12 +4177,12 @@ impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -2026,8 +4193,8 @@ impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(3); - for param_name in ["clusterId", "zone", "projectId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(4); + for param_name in ["nodePoolId", "clusterId", "zone", "projectId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -2042,6 +4209,17 @@ impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolRollbackCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). /// /// Sets the *project id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> { self._project_id = new_value.to_string(); self } - /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. /// /// Sets the *zone* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> { self._zone = new_value.to_string(); self } - /// The name of the cluster to delete. + /// The name of the cluster to rollback. /// /// Sets the *cluster id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterDeleteCall<'a, C, A> { + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> { self._cluster_id = new_value.to_string(); self } + /// The name of the node pool to rollback. + /// + /// Sets the *node pool id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn node_pool_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> { + self._node_pool_id = new_value.to_string(); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2163,10 +4367,10 @@ impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectZoneClusterDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2193,7 +4397,7 @@ impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectZoneClusterDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterNodePoolRollbackCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -2201,9 +4405,9 @@ impl<'a, C, A> ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectZoneClusterDeleteCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Container::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. +/// // As the method needs a request, you would usually fill it with the desired information +/// // 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().zones_get_serverconfig("projectId", "zone") -/// .doit(); -/// # } -/// ``` -pub struct ProjectZoneGetServerconfigCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Container, - _project_id: String, - _zone: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ProjectZoneGetServerconfigCall<'a, C, A> {} - -impl<'a, C, A> ProjectZoneGetServerconfigCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ServerConfig)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "container.projects.zones.getServerconfig", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("projectId", self._project_id.to_string())); - params.push(("zone", self._zone.to_string())); - for &field in ["alt", "projectId", "zone"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/serverconfig"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["zone", "projectId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The Google Developers Console [project ID or project number](https://support.google.com/cloud/answer/6158840). - /// - /// Sets the *project id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn project_id(mut self, new_value: &str) -> ProjectZoneGetServerconfigCall<'a, C, A> { - self._project_id = new_value.to_string(); - self - } - /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) to return operations for. - /// - /// Sets the *zone* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> ProjectZoneGetServerconfigCall<'a, C, A> { - self._zone = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneGetServerconfigCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> ProjectZoneGetServerconfigCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ProjectZoneGetServerconfigCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Lists the node pools for a cluster. -/// -/// A builder for the *zones.clusters.nodePools.list* method supported by a *project* resource. -/// It is not used directly, but through a `ProjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_container1 as container1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use container1::Container; +/// let mut req = StartIPRotationRequest::default(); /// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Container::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().zones_clusters_node_pools_list("projectId", "zone", "clusterId") +/// let result = hub.projects().zones_clusters_start_ip_rotation(req, "projectId", "zone", "clusterId") /// .doit(); /// # } /// ``` -pub struct ProjectZoneClusterNodePoolListCall<'a, C, A> +pub struct ProjectZoneClusterStartIpRotationCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Container, + _request: StartIPRotationRequest, _project_id: String, _zone: String, _cluster_id: String, @@ -2496,13 +4454,13 @@ pub struct ProjectZoneClusterNodePoolListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectZoneClusterStartIpRotationCall<'a, C, A> {} -impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectZoneClusterStartIpRotationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListNodePoolsResponse)> { + 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; @@ -2510,9 +4468,9 @@ impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "container.projects.zones.clusters.nodePools.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.startIpRotation", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); params.push(("projectId", self._project_id.to_string())); params.push(("zone", self._zone.to_string())); params.push(("clusterId", self._cluster_id.to_string())); @@ -2528,7 +4486,7 @@ impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterStartIpRotationCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). /// /// Sets the *project id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterStartIpRotationCall<'a, C, A> { self._project_id = new_value.to_string(); self } - /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. /// /// Sets the *zone* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterNodePoolListCall<'a, C, A> { + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterStartIpRotationCall<'a, C, A> { self._zone = new_value.to_string(); self } @@ -2657,7 +4642,7 @@ impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolListCall<'a, C, A> { + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterStartIpRotationCall<'a, C, A> { self._cluster_id = new_value.to_string(); self } @@ -2667,7 +4652,7 @@ impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterStartIpRotationCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2681,10 +4666,10 @@ impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectZoneClusterNodePoolListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectZoneClusterStartIpRotationCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2711,7 +4696,916 @@ impl<'a, C, A> ProjectZoneClusterNodePoolListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectZoneClusterNodePoolListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterStartIpRotationCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Completes master IP rotation. +/// +/// A builder for the *zones.clusters.completeIpRotation* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::CompleteIPRotationRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CompleteIPRotationRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().zones_clusters_complete_ip_rotation(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterCompleteIpRotationCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: CompleteIPRotationRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterCompleteIpRotationCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.completeIpRotation", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}:completeIpRotation".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["clusterId", "zone", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CompleteIPRotationRequest) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster. + /// + /// Sets the *cluster id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterCompleteIpRotationCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Sets the NodeManagement options for a node pool. +/// +/// A builder for the *zones.clusters.nodePools.setManagement* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetNodePoolManagementRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SetNodePoolManagementRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().zones_clusters_node_pools_set_management(req, "projectId", "zone", "clusterId", "nodePoolId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetNodePoolManagementRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _node_pool_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.nodePools.setManagement", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + params.push(("nodePoolId", self._node_pool_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId", "nodePoolId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}/setManagement".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId"), ("{nodePoolId}", "nodePoolId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(4); + for param_name in ["nodePoolId", "clusterId", "zone", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetNodePoolManagementRequest) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to update. + /// + /// Sets the *cluster id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The name of the node pool to update. + /// + /// Sets the *node pool id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn node_pool_id(mut self, new_value: &str) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> { + self._node_pool_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterNodePoolSetManagementCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Enables or disables the ABAC authorization mechanism on a cluster. +/// +/// A builder for the *zones.clusters.legacyAbac* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_container1 as container1; +/// use container1::SetLegacyAbacRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use container1::Container; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Container::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SetLegacyAbacRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().zones_clusters_legacy_abac(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterLegacyAbacCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetLegacyAbacRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterLegacyAbacCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterLegacyAbacCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.legacyAbac", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/legacyAbac".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["clusterId", "zone", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetLegacyAbacRequest) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://support.google.com/cloud/answer/6158840). + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster to update. + /// + /// Sets the *cluster id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterLegacyAbacCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -2793,7 +5687,7 @@ impl<'a, C, A> ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut ProjectZoneOperationGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Container::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SetLabelsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().zones_clusters_resource_labels(req, "projectId", "zone", "clusterId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectZoneClusterResourceLabelCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Container, + _request: SetLabelsRequest, + _project_id: String, + _zone: String, + _cluster_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectZoneClusterResourceLabelCall<'a, C, A> {} + +impl<'a, C, A> ProjectZoneClusterResourceLabelCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "container.projects.zones.clusters.resourceLabels", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("zone", self._zone.to_string())); + params.push(("clusterId", self._cluster_id.to_string())); + for &field in ["alt", "projectId", "zone", "clusterId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/resourceLabels".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{zone}", "zone"), ("{clusterId}", "clusterId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["clusterId", "zone", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SetLabelsRequest) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + self._request = new_value; + self + } + /// The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). + /// + /// Sets the *project id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn project_id(mut self, new_value: &str) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. + /// + /// Sets the *zone* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn zone(mut self, new_value: &str) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + self._zone = new_value.to_string(); + self + } + /// The name of the cluster. + /// + /// Sets the *cluster id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn cluster_id(mut self, new_value: &str) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + self._cluster_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectZoneClusterResourceLabelCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *access_token* (query-string) - OAuth access token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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) -> ProjectZoneClusterResourceLabelCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectZoneClusterResourceLabelCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Lists all operations in a project in a specific zone or all zones. /// /// A builder for the *zones.operations.list* method supported by a *project* resource. @@ -3056,7 +6252,7 @@ impl<'a, C, A> ProjectZoneOperationListCall<'a, C, A> where C: BorrowMut ProjectZoneOperationListCall<'a, C, A> where C: BorrowMut ProjectZoneOperationListCall<'a, C, A> where C: BorrowMut ProjectZoneOperationListCall<'a, C, A> where C: BorrowMut ProjectZoneOperationListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterCreateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterCreateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterCreateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterCreateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterUpdateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterUpdateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterUpdateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterUpdateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterUpdateCall<'a, C, A> where C: BorrowMut ProjectZoneClusterListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterListCall<'a, C, A> where C: BorrowMut ProjectZoneClusterNodePoolDeleteCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}"; + let mut url = "https://container.googleapis.com/v1/projects/{projectId}/zones/{zone}/clusters/{clusterId}/nodePools/{nodePoolId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4249,7 +7469,8 @@ impl<'a, C, A> ProjectZoneClusterNodePoolDeleteCall<'a, C, A> where C: BorrowMut } - /// The Google Developers Console [project ID or project number](https://developers.google.com/console/help/new/#projectnumber). + /// The Google Developers Console [project ID or project + /// number](https://developers.google.com/console/help/new/#projectnumber). /// /// Sets the *project id* path property to the given value. /// @@ -4259,7 +7480,9 @@ impl<'a, C, A> ProjectZoneClusterNodePoolDeleteCall<'a, C, A> where C: BorrowMut self._project_id = new_value.to_string(); self } - /// The name of the Google Compute Engine [zone](/compute/docs/zones#available) in which the cluster resides. + /// The name of the Google Compute Engine + /// [zone](/compute/docs/zones#available) in which the cluster + /// resides. /// /// Sets the *zone* path property to the given value. /// @@ -4309,10 +7532,10 @@ impl<'a, C, A> ProjectZoneClusterNodePoolDeleteCall<'a, C, A> where C: BorrowMut /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4347,3 +7570,4 @@ impl<'a, C, A> ProjectZoneClusterNodePoolDeleteCall<'a, C, A> where C: BorrowMut } + diff --git a/gen/content2-cli/Cargo.toml b/gen/content2-cli/Cargo.toml index 19fee71fe2..9104942537 100644 --- a/gen/content2-cli/Cargo.toml +++ b/gen/content2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-content2-cli" -version = "1.0.4+20161205" +version = "1.0.4+20170519" authors = ["Sebastian Thiel "] description = "A complete library to interact with Shopping Content (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/content2-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-content2] path = "../content2" -version = "1.0.4+20161205" +version = "1.0.4+20170519" diff --git a/gen/content2-cli/README.md b/gen/content2-cli/README.md index f94e79f21c..914a272897 100644 --- a/gen/content2-cli/README.md +++ b/gen/content2-cli/README.md @@ -25,12 +25,13 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Shopping Content* API at revision *20161205*. The CLI is at version *1.0.4*. +This documentation was generated from the *Shopping Content* API at revision *20170519*. The CLI is at version *1.0.4*. ```bash content2 [options] accounts authinfo [-p ]... [-o ] + claimwebsite [-p ]... [-o ] custombatch (-r )... [-p ]... [-o ] delete [-p ]... get [-p ]... [-o ] @@ -38,12 +39,6 @@ content2 [options] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] - accountshipping - custombatch (-r )... [-p ]... [-o ] - get [-p ]... [-o ] - list [-p ]... [-o ] - patch (-r )... [-p ]... [-o ] - update (-r )... [-p ]... [-o ] accountstatuses custombatch (-r )... [-p ]... [-o ] get [-p ]... [-o ] diff --git a/gen/content2-cli/mkdocs.yml b/gen/content2-cli/mkdocs.yml index 090c2aee87..1df6cfb3c9 100644 --- a/gen/content2-cli/mkdocs.yml +++ b/gen/content2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Shopping Content v1.0.4+20161205 +site_name: Shopping Content v1.0.4+20170519 site_url: http://byron.github.io/google-apis-rs/google-content2-cli site_description: A complete library to interact with Shopping Content (protocol v2) @@ -10,6 +10,7 @@ site_dir: build_html pages: - ['index.md', 'Home'] - ['accounts_authinfo.md', 'Accounts', 'Authinfo'] +- ['accounts_claimwebsite.md', 'Accounts', 'Claimwebsite'] - ['accounts_custombatch.md', 'Accounts', 'Custombatch'] - ['accounts_delete.md', 'Accounts', 'Delete'] - ['accounts_get.md', 'Accounts', 'Get'] @@ -17,11 +18,6 @@ pages: - ['accounts_list.md', 'Accounts', 'List'] - ['accounts_patch.md', 'Accounts', 'Patch'] - ['accounts_update.md', 'Accounts', 'Update'] -- ['accountshipping_custombatch.md', 'Accountshipping', 'Custombatch'] -- ['accountshipping_get.md', 'Accountshipping', 'Get'] -- ['accountshipping_list.md', 'Accountshipping', 'List'] -- ['accountshipping_patch.md', 'Accountshipping', 'Patch'] -- ['accountshipping_update.md', 'Accountshipping', 'Update'] - ['accountstatuses_custombatch.md', 'Accountstatuses', 'Custombatch'] - ['accountstatuses_get.md', 'Accountstatuses', 'Get'] - ['accountstatuses_list.md', 'Accountstatuses', 'List'] diff --git a/gen/content2-cli/src/main.rs b/gen/content2-cli/src/main.rs index 533455d6a1..933827a750 100644 --- a/gen/content2-cli/src/main.rs +++ b/gen/content2-cli/src/main.rs @@ -98,6 +98,62 @@ impl<'n> Engine<'n> { } } + fn _accounts_claimwebsite(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.accounts().claimwebsite(opt.value_of("merchant-id").unwrap_or(""), opt.value_of("account-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "overwrite" => { + call = call.overwrite(arg_from_str(value.unwrap_or("false"), err, "overwrite", "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(["overwrite"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_custombatch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -630,385 +686,6 @@ impl<'n> Engine<'n> { } } - fn _accountshipping_custombatch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - 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::AccountshippingCustomBatchRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.accountshipping().custombatch(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 { - "dry-run" => { - call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "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(["dry-run"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _accountshipping_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.accountshipping().get(opt.value_of("merchant-id").unwrap_or(""), opt.value_of("account-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _accountshipping_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.accountshipping().list(opt.value_of("merchant-id").unwrap_or("")); - for parg in 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 _accountshipping_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 })), - "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-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::AccountShipping = json::value::from_value(object).unwrap(); - let mut call = self.hub.accountshipping().patch(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("account-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "dry-run" => { - call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "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(["dry-run"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _accountshipping_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 })), - "account-id" => Some(("accountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["account-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::AccountShipping = json::value::from_value(object).unwrap(); - let mut call = self.hub.accountshipping().update(request, opt.value_of("merchant-id").unwrap_or(""), opt.value_of("account-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "dry-run" => { - call = call.dry_run(arg_from_str(value.unwrap_or("false"), err, "dry-run", "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(["dry-run"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _accountstatuses_custombatch(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -4164,6 +3841,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 { + "include-attributes" => { + call = call.include_attributes(arg_from_str(value.unwrap_or("false"), err, "include-attributes", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -4177,6 +3857,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(["include-attributes"].iter().map(|v|*v)); v } )); } } @@ -4216,6 +3897,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 { + "include-attributes" => { + call = call.include_attributes(arg_from_str(value.unwrap_or("false"), err, "include-attributes", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -4229,6 +3913,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(["include-attributes"].iter().map(|v|*v)); v } )); } } @@ -4277,6 +3962,9 @@ impl<'n> Engine<'n> { "include-invalid-inserted-items" => { call = call.include_invalid_inserted_items(arg_from_str(value.unwrap_or("false"), err, "include-invalid-inserted-items", "boolean")); }, + "include-attributes" => { + call = call.include_attributes(arg_from_str(value.unwrap_or("false"), err, "include-attributes", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -4290,7 +3978,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(["include-invalid-inserted-items", "page-token", "max-results"].iter().map(|v|*v)); + v.extend(["include-invalid-inserted-items", "page-token", "include-attributes", "max-results"].iter().map(|v|*v)); v } )); } } @@ -4763,6 +4451,9 @@ impl<'n> Engine<'n> { ("authinfo", Some(opt)) => { call_result = self._accounts_authinfo(opt, dry_run, &mut err); }, + ("claimwebsite", Some(opt)) => { + call_result = self._accounts_claimwebsite(opt, dry_run, &mut err); + }, ("custombatch", Some(opt)) => { call_result = self._accounts_custombatch(opt, dry_run, &mut err); }, @@ -4790,29 +4481,6 @@ impl<'n> Engine<'n> { } } }, - ("accountshipping", Some(opt)) => { - match opt.subcommand() { - ("custombatch", Some(opt)) => { - call_result = self._accountshipping_custombatch(opt, dry_run, &mut err); - }, - ("get", Some(opt)) => { - call_result = self._accountshipping_get(opt, dry_run, &mut err); - }, - ("list", Some(opt)) => { - call_result = self._accountshipping_list(opt, dry_run, &mut err); - }, - ("patch", Some(opt)) => { - call_result = self._accountshipping_patch(opt, dry_run, &mut err); - }, - ("update", Some(opt)) => { - call_result = self._accountshipping_update(opt, dry_run, &mut err); - }, - _ => { - err.issues.push(CLIError::MissingMethodError("accountshipping".to_string())); - writeln!(io::stderr(), "{}\n", opt.usage()).ok(); - } - } - }, ("accountstatuses", Some(opt)) => { match opt.subcommand() { ("custombatch", Some(opt)) => { @@ -5114,7 +4782,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("accounts", "methods: 'authinfo', 'custombatch', 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("accounts", "methods: 'authinfo', 'claimwebsite', 'custombatch', 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ ("authinfo", Some(r##"Returns information about the authenticated user."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_authinfo", @@ -5125,6 +4793,34 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("claimwebsite", + Some(r##"Claims the website of a Merchant Center sub-account. This method can only be called for multi-client accounts."##), + "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(true), + Some(false)), + + (Some(r##"account-id"##), + None, + Some(r##"The ID of the account whose website is claimed."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -5254,7 +4950,7 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates a Merchant Center account. This method can only be called for multi-client accounts. This method supports patch semantics."##), + Some(r##"Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_patch", vec![ (Some(r##"merchant-id"##), @@ -5288,7 +4984,7 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates a Merchant Center account. This method can only be called for multi-client accounts."##), + Some(r##"Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accounts_update", vec![ (Some(r##"merchant-id"##), @@ -5323,149 +5019,6 @@ fn main() { ]), ]), - ("accountshipping", "methods: 'custombatch', 'get', 'list', 'patch' and 'update'", vec![ - ("custombatch", - Some(r##"Retrieves and updates the shipping settings of multiple accounts in a single request."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accountshipping_custombatch", - 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)), - ]), - ("get", - Some(r##"Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accountshipping_get", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the managing account."##), - Some(true), - Some(false)), - - (Some(r##"account-id"##), - None, - Some(r##"The ID of the account for which to get/update account shipping settings."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(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 shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accountshipping_list", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the managing account."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(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 shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accountshipping_patch", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the managing account."##), - Some(true), - Some(false)), - - (Some(r##"account-id"##), - None, - Some(r##"The ID of the account for which to get/update account shipping settings."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(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 shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account."##), - "Details at http://byron.github.io/google-apis-rs/google_content2_cli/accountshipping_update", - vec![ - (Some(r##"merchant-id"##), - None, - Some(r##"The ID of the managing account."##), - Some(true), - Some(false)), - - (Some(r##"account-id"##), - None, - Some(r##"The ID of the account for which to get/update account shipping settings."##), - Some(true), - Some(false)), - - (Some(r##"kv"##), - Some(r##"r"##), - Some(r##"Set various fields of the request structure, matching the key=value form"##), - Some(true), - Some(true)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ]), - ("accountstatuses", "methods: 'custombatch', 'get' and 'list'", vec![ ("custombatch", None, @@ -6081,7 +5634,7 @@ fn main() { Some(false)), ]), ("cancel", - Some(r##"Cancels all line items in an order. This method can only be called for non-multi-client accounts."##), + Some(r##"Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_cancel", vec![ (Some(r##"merchant-id"##), @@ -6115,7 +5668,7 @@ fn main() { Some(false)), ]), ("cancellineitem", - Some(r##"Cancels a line item. This method can only be called for non-multi-client accounts."##), + Some(r##"Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts."##), "Details at http://byron.github.io/google-apis-rs/google_content2_cli/orders_cancellineitem", vec![ (Some(r##"merchant-id"##), @@ -6845,7 +6398,7 @@ fn main() { let mut app = App::new("content2") .author("Sebastian Thiel ") - .version("1.0.4+20161205") + .version("1.0.4+20170519") .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 ee0912a3c9..2e8b2095d9 100644 --- a/gen/content2/Cargo.toml +++ b/gen/content2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-content2" -version = "1.0.4+20161205" +version = "1.0.4+20170519" 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.4+20161205" +documentation = "https://docs.rs/google-content2/1.0.4+20170519" license = "MIT" keywords = ["content", "google", "protocol", "web", "api"] diff --git a/gen/content2/README.md b/gen/content2/README.md index a2fbf46bea..d0ffe18d94 100644 --- a/gen/content2/README.md +++ b/gen/content2/README.md @@ -5,36 +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.4+20161205*, where *20161205* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Shopping Content* crate version *1.0.4+20170519*, where *20170519* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161205/google_content2/struct.ShoppingContent.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ShoppingContent.html) ... -* [accounts](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.Account.html) - * [*authinfo*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountAuthinfoCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountListCall.html), [*patch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountUpdateCall.html) -* accountshipping - * [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountshippingCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountshippingGetCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountshippingListCall.html), [*patch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountshippingPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountshippingUpdateCall.html) +* [accounts](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.Account.html) + * [*authinfo*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountAuthinfoCall.html), [*claimwebsite*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountClaimwebsiteCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountListCall.html), [*patch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountUpdateCall.html) * accountstatuses - * [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccountstatuseListCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccountstatuseListCall.html) * accounttax - * [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccounttaxCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccounttaxGetCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccounttaxListCall.html), [*patch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccounttaxPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.AccounttaxUpdateCall.html) -* [datafeeds](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.Datafeed.html) - * [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.DatafeedCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.DatafeedDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.DatafeedGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.DatafeedInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.DatafeedListCall.html), [*patch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.DatafeedPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.DatafeedUpdateCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccounttaxCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccounttaxGetCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccounttaxListCall.html), [*patch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccounttaxPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.AccounttaxUpdateCall.html) +* [datafeeds](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.Datafeed.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.DatafeedCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.DatafeedDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.DatafeedGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.DatafeedInsertCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.DatafeedListCall.html), [*patch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.DatafeedPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.DatafeedUpdateCall.html) * datafeedstatuses - * [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.DatafeedstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.DatafeedstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.DatafeedstatuseListCall.html) -* [inventory](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.Inventory.html) - * [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.InventoryCustombatchCall.html) and [*set*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.InventorySetCall.html) -* [orders](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.Order.html) - * [*acknowledge*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderCancellineitemCall.html), [*createtestorder*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderCreatetestorderCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderGettestordertemplateCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderRefundCall.html), [*returnlineitem*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderReturnlineitemCall.html), [*shiplineitems*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderShiplineitemCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.OrderUpdateshipmentCall.html) -* [products](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.Product.html) - * [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ProductCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ProductDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ProductGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ProductInsertCall.html) and [*list*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ProductListCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.DatafeedstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.DatafeedstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.DatafeedstatuseListCall.html) +* [inventory](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.Inventory.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.InventoryCustombatchCall.html) and [*set*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.InventorySetCall.html) +* [orders](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.Order.html) + * [*acknowledge*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderCancellineitemCall.html), [*createtestorder*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderCreatetestorderCall.html), [*custombatch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderGettestordertemplateCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderRefundCall.html), [*returnlineitem*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderReturnlineitemCall.html), [*shiplineitems*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderShiplineitemCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.OrderUpdateshipmentCall.html) +* [products](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.Product.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ProductCustombatchCall.html), [*delete*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ProductDeleteCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ProductGetCall.html), [*insert*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ProductInsertCall.html) and [*list*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ProductListCall.html) * productstatuses - * [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ProductstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ProductstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ProductstatuseListCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ProductstatuseCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ProductstatuseGetCall.html) and [*list*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ProductstatuseListCall.html) * shippingsettings - * [*custombatch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ShippingsettingCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ShippingsettingGetCall.html), [*getsupportedcarriers*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ShippingsettingGetsupportedcarrierCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ShippingsettingListCall.html), [*patch*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ShippingsettingPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/struct.ShippingsettingUpdateCall.html) + * [*custombatch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ShippingsettingCustombatchCall.html), [*get*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ShippingsettingGetCall.html), [*getsupportedcarriers*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ShippingsettingGetsupportedcarrierCall.html), [*list*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ShippingsettingListCall.html), [*patch*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ShippingsettingPatchCall.html) and [*update*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/struct.ShippingsettingUpdateCall.html) @@ -43,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.4+20161205/google_content2/struct.ShoppingContent.html)** +* **[Hub](https://docs.rs/google-content2/1.0.4+20170519/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.4+20161205/google_content2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-content2/1.0.4+20161205/google_content2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-content2/1.0.4+20161205/google_content2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-content2/1.0.4+20170519/google_content2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-content2/1.0.4+20170519/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.4+20161205/google_content2/trait.Part.html)** + * **[Parts](https://docs.rs/google-content2/1.0.4+20170519/google_content2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-content2/1.0.4+20161205/google_content2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-content2/1.0.4+20170519/google_content2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -156,17 +154,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-content2/1.0.4+20161205/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.4+20170519/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.4+20161205/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.4+20170519/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.4+20161205/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.4+20170519/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.4+20161205/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.4+20170519/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")`. @@ -176,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-content2/1.0.4+20161205/google_content2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-content2/1.0.4+20161205/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.4+20170519/google_content2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-content2/1.0.4+20170519/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.4+20161205/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.4+20170519/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.4+20161205/google_content2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-content2/1.0.4+20161205/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.4+20170519/google_content2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-content2/1.0.4+20170519/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.4+20161205/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.4+20170519/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.4+20161205/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.4+20170519/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.4+20161205/google_content2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-content2/1.0.4+20170519/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 78dde74bff..5626b2d62f 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.4+20161205*, where *20161205* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Shopping Content* crate version *1.0.4+20170519*, where *20170519* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Shopping Content* *v2* API can be found at the //! [official documentation site](https://developers.google.com/shopping-content). @@ -12,9 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.ShoppingContent.html) ... //! //! * [accounts](struct.Account.html) -//! * [*authinfo*](struct.AccountAuthinfoCall.html), [*custombatch*](struct.AccountCustombatchCall.html), [*delete*](struct.AccountDeleteCall.html), [*get*](struct.AccountGetCall.html), [*insert*](struct.AccountInsertCall.html), [*list*](struct.AccountListCall.html), [*patch*](struct.AccountPatchCall.html) and [*update*](struct.AccountUpdateCall.html) -//! * accountshipping -//! * [*custombatch*](struct.AccountshippingCustombatchCall.html), [*get*](struct.AccountshippingGetCall.html), [*list*](struct.AccountshippingListCall.html), [*patch*](struct.AccountshippingPatchCall.html) and [*update*](struct.AccountshippingUpdateCall.html) +//! * [*authinfo*](struct.AccountAuthinfoCall.html), [*claimwebsite*](struct.AccountClaimwebsiteCall.html), [*custombatch*](struct.AccountCustombatchCall.html), [*delete*](struct.AccountDeleteCall.html), [*get*](struct.AccountGetCall.html), [*insert*](struct.AccountInsertCall.html), [*list*](struct.AccountListCall.html), [*patch*](struct.AccountPatchCall.html) and [*update*](struct.AccountUpdateCall.html) //! * accountstatuses //! * [*custombatch*](struct.AccountstatuseCustombatchCall.html), [*get*](struct.AccountstatuseGetCall.html) and [*list*](struct.AccountstatuseListCall.html) //! * accounttax @@ -211,7 +209,7 @@ // 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 +// 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)] @@ -343,8 +341,6 @@ pub struct ShoppingContent { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for ShoppingContent {} @@ -357,17 +353,12 @@ impl<'a, C, A> ShoppingContent client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/content/v2/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } pub fn accounts(&'a self) -> AccountMethods<'a, C, A> { AccountMethods { hub: &self } } - pub fn accountshipping(&'a self) -> AccountshippingMethods<'a, C, A> { - AccountshippingMethods { hub: &self } - } pub fn accountstatuses(&'a self) -> AccountstatuseMethods<'a, C, A> { AccountstatuseMethods { hub: &self } } @@ -405,26 +396,6 @@ impl<'a, C, A> ShoppingContent self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/content/v2/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -573,19 +544,22 @@ impl Part for ProductsCustomBatchResponseEntry {} /// 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*). +/// +/// * [custombatch accounttax](struct.AccounttaxCustombatchCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct DeliveryTime { - /// Maximum number of business days that is spent in transit. 0 means same day delivery, 1 means next day delivery. Must be greater than or equal to minTransitTimeInDays. Required. - #[serde(rename="maxTransitTimeInDays")] - pub max_transit_time_in_days: Option, - /// Minimum number of business days that is spent in transit. 0 means same day delivery, 1 means next day delivery. Required. - #[serde(rename="minTransitTimeInDays")] - pub min_transit_time_in_days: Option, +pub struct AccounttaxCustomBatchResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#accounttaxCustomBatchResponse". + pub kind: Option, + /// The result of the execution of the batch requests. + pub entries: Option>, } -impl Part for DeliveryTime {} +impl ResponseResult for AccounttaxCustomBatchResponse {} /// There is no detailed description. @@ -667,50 +641,20 @@ 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. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 accountstatuses](struct.AccountstatuseCustombatchCall.html) (request) /// #[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, +pub struct AccountstatusesCustomBatchRequest { + /// The request entries to be processed in the batch. + pub entries: Option>, } -impl Part for OrderLineItemProduct {} +impl RequestValue for AccountstatusesCustomBatchRequest {} /// An example occurrence for a particular error. @@ -732,28 +676,6 @@ pub struct DatafeedStatusExample { impl Part for DatafeedStatusExample {} -/// Building block of the cost calculation decision tree. -/// - The tree root should have no condition and no calculation method. -/// - All the children must have a condition on the same dimension. The first child matching a condition is entered, therefore, price and weight conditions form contiguous intervals. -/// - The last child of an element must have no condition and matches all elements not previously matched. -/// - Children and calculation method are mutually exclusive, and exactly one of them must be defined; the root must only have children. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountShippingShippingServiceCostRule { - /// Final calculation method to be used only in leaf nodes. - #[serde(rename="calculationMethod")] - pub calculation_method: Option, - /// Condition for this rule to be applicable. If no condition is specified, the rule acts as a catch-all. - pub condition: Option, - /// Subsequent rules to be applied, only for inner nodes. The last child must not specify a condition and acts as a catch-all. - pub children: Option>, -} - -impl Part for AccountShippingShippingServiceCostRule {} - - /// Account data. /// /// # Activities @@ -767,6 +689,7 @@ impl Part for AccountShippingShippingServiceCostRule {} /// * [update accounts](struct.AccountUpdateCall.html) (request|response) /// * [list accounts](struct.AccountListCall.html) (none) /// * [authinfo accounts](struct.AccountAuthinfoCall.html) (none) +/// * [claimwebsite accounts](struct.AccountClaimwebsiteCall.html) (none) /// * [delete accounts](struct.AccountDeleteCall.html) (none) /// * [insert accounts](struct.AccountInsertCall.html) (request|response) /// @@ -782,7 +705,7 @@ pub struct Account { /// Indicates whether the merchant sells adult content. #[serde(rename="adultContent")] pub adult_content: Option, - /// List of linked AdWords accounts, active or pending approval. To create a new link request, add a new link with status active to the list. It will remain is state pending until approved or rejected in the AdWords interface. To delete an active link or to cancel a link request, remove it from the list. + /// List of linked AdWords accounts that are active or pending approval. To create a new link request, add a new link with status active to the list. It will remain in a pending state until approved or rejected either in the AdWords interface or through the AdWords API. To delete an active link, or to cancel a link request, remove it from the list. #[serde(rename="adwordsLinks")] pub adwords_links: Option>, /// The merchant's website. @@ -1104,23 +1027,6 @@ pub struct ProductstatusesCustomBatchResponse { impl ResponseResult for ProductstatusesCustomBatchResponse {} -/// A postal code range, that can be either: -/// - A range of postal codes (e.g., start=12340, end=12359) -/// - A range of postal codes prefixes (e.g., start=1234* end=1235*). Prefixes must be of the same length (e.g., start=12* end=2* is invalid). -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountShippingPostalCodeRange { - /// The first (inclusive) postal code or prefix of the range. - pub start: Option, - /// The last (inclusive) postal code or prefix of the range. - pub end: Option, -} - -impl Part for AccountShippingPostalCodeRange {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1237,22 +1143,22 @@ impl Part for ProductTax {} /// 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 datafeedstatuses](struct.DatafeedstatuseCustombatchCall.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 DatafeedstatusesCustomBatchResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#datafeedstatusesCustomBatchResponse". - pub kind: Option, - /// The result of the execution of the batch requests. - pub entries: Option>, +pub struct DatafeedFormat { + /// Character encoding scheme of the data feed. If not specified, the encoding will be auto-detected. + #[serde(rename="fileEncoding")] + pub file_encoding: Option, + /// Specifies how double quotes are interpreted. If not specified, the mode will be auto-detected. Ignored for non-DSV data feeds. + #[serde(rename="quotingMode")] + pub quoting_mode: Option, + /// Delimiter for the separation of values in a delimiter-separated values feed. If not specified, the delimiter will be auto-detected. Ignored for non-DSV data feeds. + #[serde(rename="columnDelimiter")] + pub column_delimiter: Option, } -impl ResponseResult for DatafeedstatusesCustomBatchResponse {} +impl Part for DatafeedFormat {} /// A batch entry encoding a single non-batch accounts request. @@ -1266,12 +1172,14 @@ pub struct AccountsCustomBatchRequestEntry { pub batch_id: Option, /// The account to create or update. Only defined if the method is insert or update. pub account: Option, - /// The ID of the account to get or delete. Only defined if the method is get or delete. + /// The ID of the targeted account. Only defined if the method is get, delete or claimwebsite. #[serde(rename="accountId")] pub account_id: Option, /// The ID of the managing account. #[serde(rename="merchantId")] pub merchant_id: Option, + /// Only applicable if the method is claimwebsite. Indicates whether or not to take the claim from another account in case there is a conflict. + pub overwrite: Option, /// no description provided pub method: Option, } @@ -1424,24 +1332,6 @@ pub struct OrdersShipLineItemsRequest { impl RequestValue for OrdersShipLineItemsRequest {} -/// A single or bi-dimensional table of shipping rates. Each dimension is defined in terms of consecutive price/weight ranges, delivery locations, or shipping labels. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountShippingRateTable { - /// One-dimensional table cells define one condition along the same dimension. Bi-dimensional table cells use two dimensions with respectively M and N distinct values and must contain exactly M * N cells with distinct conditions (for each possible value pairs). - pub content: Option>, - /// The sale country for which this table is valid, represented as a CLDR territory code. - #[serde(rename="saleCountry")] - pub sale_country: Option, - /// The name of the rate table. - pub name: Option, -} - -impl Part for AccountShippingRateTable {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1725,38 +1615,6 @@ pub struct ProductCustomAttribute { impl Part for ProductCustomAttribute {} -/// 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 AccountShippingCondition { - /// Maximum shipping weight. Forms an interval between the maximum of smaller weight (exclusive) and this weight (inclusive). - #[serde(rename="weightMax")] - pub weight_max: Option, - /// Delivery location in terms of a location ID. Can be used to represent administrative areas, smaller country subdivisions, or cities. - #[serde(rename="deliveryLocationId")] - pub delivery_location_id: Option, - /// Shipping label of the product. The products with the label are matched. - #[serde(rename="shippingLabel")] - pub shipping_label: Option, - /// Delivery location in terms of a location group name. A location group with this name must be specified among location groups. - #[serde(rename="deliveryLocationGroup")] - pub delivery_location_group: Option, - /// Delivery location in terms of a postal code. - #[serde(rename="deliveryPostalCode")] - pub delivery_postal_code: Option, - /// Maximum shipping price. Forms an interval between the maximum of smaller prices (exclusive) and this price (inclusive). - #[serde(rename="priceMax")] - pub price_max: Option, - /// Delivery location in terms of a postal code range. - #[serde(rename="deliveryPostalCodeRange")] - pub delivery_postal_code_range: Option, -} - -impl Part for AccountShippingCondition {} - - /// There is no detailed description. /// /// # Activities @@ -1836,57 +1694,6 @@ pub struct ProductStatusDataQualityIssue { impl Part for ProductStatusDataQualityIssue {} -/// Shipping services provided in a country. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountShippingShippingService { - /// The minimum number of days in transit. Must be a value between 0 and maxDaysIntransit included. A value of 0 means same day delivery. - #[serde(rename="minDaysInTransit")] - pub min_days_in_transit: Option, - /// The name of this shipping service. - pub name: Option, - /// The maximum number of days in transit. Must be a value between 0 and 250 included. A value of 0 means same day delivery. - #[serde(rename="maxDaysInTransit")] - pub max_days_in_transit: Option, - /// Whether the shipping service is available. - pub active: Option, - /// Decision tree for "complicated" shipping cost calculation. - #[serde(rename="costRuleTree")] - pub cost_rule_tree: Option, - /// The CLDR territory code of the sale country for which this service can be used. - #[serde(rename="saleCountry")] - pub sale_country: Option, - /// Calculation method for the "simple" case that needs no rules. - #[serde(rename="calculationMethod")] - pub calculation_method: Option, -} - -impl Part for AccountShippingShippingService {} - - -/// A batch entry encoding a single non-batch accountshipping 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 AccountshippingCustomBatchResponseEntry { - /// The ID of the request entry this entry responds to. - #[serde(rename="batchId")] - pub batch_id: Option, - /// Identifies what kind of resource this is. Value: the fixed string "content#accountshippingCustomBatchResponseEntry". - pub kind: Option, - /// A list of errors defined if and only if the request failed. - pub errors: Option, - /// The retrieved or updated account shipping settings. - #[serde(rename="accountShipping")] - pub account_shipping: Option, -} - -impl Part for AccountshippingCustomBatchResponseEntry {} - - /// There is no detailed description. /// /// # Activities @@ -2058,24 +1865,6 @@ pub struct DatafeedFetchSchedule { impl Part for DatafeedFetchSchedule {} -/// 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 accountshipping](struct.AccountshippingCustombatchCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountshippingCustomBatchRequest { - /// The request entries to be processed in the batch. - pub entries: Option>, -} - -impl RequestValue for AccountshippingCustomBatchRequest {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2156,42 +1945,19 @@ impl Part for ProductAspect {} /// 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 accounttax](struct.AccounttaxCustombatchCall.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 AccounttaxCustomBatchResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#accounttaxCustomBatchResponse". - pub kind: Option, - /// The result of the execution of the batch requests. - pub entries: Option>, +pub struct DeliveryTime { + /// Maximum number of business days that is spent in transit. 0 means same day delivery, 1 means next day delivery. Must be greater than or equal to minTransitTimeInDays. Required. + #[serde(rename="maxTransitTimeInDays")] + pub max_transit_time_in_days: Option, + /// Minimum number of business days that is spent in transit. 0 means same day delivery, 1 means next day delivery. Required. + #[serde(rename="minTransitTimeInDays")] + pub min_transit_time_in_days: Option, } -impl ResponseResult for AccounttaxCustomBatchResponse {} - - -/// 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 accountshipping](struct.AccountshippingCustombatchCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountshippingCustomBatchResponse { - /// Identifies what kind of resource this is. Value: the fixed string "content#accountshippingCustomBatchResponse". - pub kind: Option, - /// The result of the execution of the batch requests. - pub entries: Option>, -} - -impl ResponseResult for AccountshippingCustomBatchResponse {} +impl Part for DeliveryTime {} /// A batch entry encoding a single non-batch accountstatuses request. @@ -2216,36 +1982,46 @@ pub struct AccountstatusesCustomBatchRequestEntry { impl Part for AccountstatusesCustomBatchRequestEntry {} -/// There is no detailed description. +/// A batch entry encoding a single non-batch productstatuses 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 AccountIdentifier { - /// The aggregator ID, set for aggregators and subaccounts (in that case, it represents the aggregator of the subaccount). - #[serde(rename="aggregatorId")] - pub aggregator_id: Option, - /// The merchant account ID, set for individual accounts and subaccounts. +pub struct ProductstatusesCustomBatchRequestEntry { + /// An entry ID, unique within the batch request. + #[serde(rename="batchId")] + pub batch_id: Option, + /// The ID of the managing account. #[serde(rename="merchantId")] pub merchant_id: Option, + /// no description provided + pub method: Option, + /// The ID of the product whose status to get. + #[serde(rename="productId")] + pub product_id: Option, } -impl Part for AccountIdentifier {} +impl Part for ProductstatusesCustomBatchRequestEntry {} /// 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*). +/// +/// * [custombatch datafeedstatuses](struct.DatafeedstatuseCustombatchCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountShippingRateTableCell { - /// The rate applicable if the cell conditions are matched. - pub rate: Option, - /// Conditions for which the cell is valid. All cells in a table must use the same dimension or pair of dimensions among price, weight, shipping label or delivery location. If no condition is specified, the cell acts as a catch-all and matches all the elements that are not matched by other cells in this dimension. - pub condition: Option, +pub struct DatafeedstatusesCustomBatchResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#datafeedstatusesCustomBatchResponse". + pub kind: Option, + /// The result of the execution of the batch requests. + pub entries: Option>, } -impl Part for AccountShippingRateTableCell {} +impl ResponseResult for DatafeedstatusesCustomBatchResponse {} /// There is no detailed description. @@ -2310,52 +2086,21 @@ pub struct OrderRefund { impl Part for OrderRefund {} -/// A user-defined locations group in a given country. All the locations of the group must be of the same type. +/// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountShippingLocationGroup { - /// A postal code range representing a city or a set of cities. - #[serde(rename="postalCodeRanges")] - pub postal_code_ranges: Option>, - /// The CLDR territory code of the country in which this location group is. - pub country: Option, - /// A location ID (also called criteria ID) representing administrative areas, smaller country subdivisions (counties), or cities. - #[serde(rename="locationIds")] - pub location_ids: Option>, - /// The name of the location group. - pub name: Option, - /// A postal code representing a city or a set of cities. - /// - A single postal code (e.g., 12345) - /// - A postal code prefix followed by a star (e.g., 1234*) - #[serde(rename="postalCodes")] - pub postal_codes: Option>, -} - -impl Part for AccountShippingLocationGroup {} - - -/// A batch entry encoding a single non-batch productstatuses 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 ProductstatusesCustomBatchRequestEntry { - /// An entry ID, unique within the batch request. - #[serde(rename="batchId")] - pub batch_id: Option, - /// The ID of the managing account. +pub struct AccountIdentifier { + /// The aggregator ID, set for aggregators and subaccounts (in that case, it represents the aggregator of the subaccount). + #[serde(rename="aggregatorId")] + pub aggregator_id: Option, + /// The merchant account ID, set for individual accounts and subaccounts. #[serde(rename="merchantId")] pub merchant_id: Option, - /// no description provided - pub method: Option, - /// The ID of the product whose status to get. - #[serde(rename="productId")] - pub product_id: Option, } -impl Part for ProductstatusesCustomBatchRequestEntry {} +impl Part for AccountIdentifier {} /// There is no detailed description. @@ -2614,6 +2359,9 @@ impl Part for AccountstatusesCustomBatchResponseEntry {} pub struct AccountStatus { /// Identifies what kind of resource this is. Value: the fixed string "content#accountStatus". pub kind: Option, + /// Whether the account's website is claimed or not. + #[serde(rename="websiteClaimed")] + pub website_claimed: Option, /// A list of data quality issues. #[serde(rename="dataQualityIssues")] pub data_quality_issues: Option>, @@ -2687,31 +2435,6 @@ pub struct DatafeedsCustomBatchResponseEntry { impl Part for DatafeedsCustomBatchResponseEntry {} -/// A batch entry encoding a single non-batch accountshipping 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 AccountshippingCustomBatchRequestEntry { - /// An entry ID, unique within the batch request. - #[serde(rename="batchId")] - pub batch_id: Option, - /// The ID of the account for which to get/update account shipping settings. - #[serde(rename="accountId")] - pub account_id: Option, - /// The account shipping settings to update. Only defined if the method is update. - #[serde(rename="accountShipping")] - pub account_shipping: Option, - /// no description provided - pub method: Option, - /// The ID of the managing account. - #[serde(rename="merchantId")] - pub merchant_id: Option, -} - -impl Part for AccountshippingCustomBatchRequestEntry {} - - /// There is no detailed description. /// /// # Activities @@ -2883,7 +2606,7 @@ pub struct AccountsCustomBatchResponseEntry { /// The ID of the request entry this entry responds to. #[serde(rename="batchId")] pub batch_id: Option, - /// The retrieved, created, or updated account. Not defined if the method was delete. + /// The retrieved, created, or updated account. Not defined if the method was delete or claimwebsite. pub account: Option, /// A list of errors defined if and only if the request failed. pub errors: Option, @@ -2896,50 +2619,50 @@ impl Part for AccountsCustomBatchResponseEntry {} /// 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 accountstatuses](struct.AccountstatuseCustombatchCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountstatusesCustomBatchRequest { - /// The request entries to be processed in the batch. - pub entries: Option>, -} - -impl RequestValue for AccountstatusesCustomBatchRequest {} - - -/// A carrier-calculated shipping rate. -/// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountShippingCarrierRate { - /// Shipping origin represented as a postal code. - #[serde(rename="shippingOrigin")] - pub shipping_origin: Option, - /// The carrier that is responsible for the shipping, such as "UPS", "FedEx", or "USPS". - pub carrier: Option, - /// The name of the carrier rate. - pub name: Option, - /// The sale country for which this carrier rate is valid, represented as a CLDR territory code. - #[serde(rename="saleCountry")] - pub sale_country: Option, - /// The carrier service, such as "Ground" or "2Day". - #[serde(rename="carrierService")] - pub carrier_service: Option, - /// Additive shipping rate modifier. - #[serde(rename="modifierFlatRate")] - pub modifier_flat_rate: Option, - /// Multiplicative shipping rate modifier in percent. Represented as a floating point number without the percentage character. - #[serde(rename="modifierPercent")] - pub modifier_percent: Option, +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 AccountShippingCarrierRate {} +impl Part for OrderLineItemProduct {} /// Datafeed data. @@ -2961,7 +2684,7 @@ impl Part for AccountShippingCarrierRate {} pub struct Datafeed { /// Identifies what kind of resource this is. Value: the fixed string "content#datafeed". pub kind: Option, - /// The type of data feed. + /// The type of data feed. For product inventory feeds, only feeds for local stores, not online stores, are supported. #[serde(rename="contentType")] pub content_type: Option, /// A descriptive name of the data feed. @@ -3160,29 +2883,22 @@ pub struct OrdersCustomBatchRequest { impl RequestValue for OrdersCustomBatchRequest {} -/// Shipping cost calculation method. Exactly one of the field is set. +/// 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*). +/// +/// * [claimwebsite accounts](struct.AccountClaimwebsiteCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountShippingShippingServiceCalculationMethod { - /// Percentage of the price, represented as a floating point number without the percentage character. - #[serde(rename="percentageRate")] - pub percentage_rate: Option, - /// Name of the carrier rate to use for the calculation. - #[serde(rename="carrierRate")] - pub carrier_rate: Option, - /// Name of the rate table to use for the calculation. - #[serde(rename="rateTable")] - pub rate_table: Option, - /// Delivery is excluded. Valid only within cost rules tree. - pub excluded: Option, - /// Fixed price shipping, represented as a floating point number associated with a currency. - #[serde(rename="flatRate")] - pub flat_rate: Option, +pub struct AccountsClaimWebsiteResponse { + /// Identifies what kind of resource this is. Value: the fixed string "content#accountsClaimWebsiteResponse". + pub kind: Option, } -impl Part for AccountShippingShippingServiceCalculationMethod {} +impl ResponseResult for AccountsClaimWebsiteResponse {} /// A batch entry encoding a single non-batch inventory request. @@ -3289,29 +3005,6 @@ pub struct AccounttaxCustomBatchRequestEntry { impl Part for AccounttaxCustomBatchRequestEntry {} -/// 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 accountshipping](struct.AccountshippingListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountshippingListResponse { - /// The token for the retrieval of the next page of account shipping settings. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Identifies what kind of resource this is. Value: the fixed string "content#accountshippingListResponse". - pub kind: Option, - /// no description provided - pub resources: Option>, -} - -impl ResponseResult for AccountshippingListResponse {} - - /// An example of an item that has poor data quality. An item value on the landing page differs from what is submitted, or conflicts with a policy. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3579,41 +3272,6 @@ pub struct ProductShippingWeight { impl Part for ProductShippingWeight {} -/// The shipping settings of a merchant 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 accountshipping](struct.AccountshippingUpdateCall.html) (request|response) -/// * [patch accountshipping](struct.AccountshippingPatchCall.html) (request|response) -/// * [get accountshipping](struct.AccountshippingGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AccountShipping { - /// Carrier-based shipping calculations. - #[serde(rename="carrierRates")] - pub carrier_rates: Option>, - /// Identifies what kind of resource this is. Value: the fixed string "content#accountShipping". - pub kind: Option, - /// Location groups for shipping. - #[serde(rename="locationGroups")] - pub location_groups: Option>, - /// Shipping services describing shipping fees calculation. - pub services: Option>, - /// The ID of the account to which these account shipping settings belong. - #[serde(rename="accountId")] - pub account_id: Option, - /// Rate tables definitions. - #[serde(rename="rateTables")] - pub rate_tables: Option>, -} - -impl RequestValue for AccountShipping {} -impl ResponseResult for AccountShipping {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3654,7 +3312,7 @@ pub struct AccountTaxTaxRule { impl Part for AccountTaxTaxRule {} -/// A batch entry encoding a single non-batch accountshipping request. +/// A batch entry encoding a single non-batch shippingsettings request. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -4241,17 +3899,21 @@ pub struct AccountStatusDataQualityIssue { pub last_checked: Option, /// Country for which this issue is reported. pub country: Option, - /// Example items featuring the issue. - #[serde(rename="exampleItems")] - pub example_items: Option>, + /// A more detailed description of the issue. + pub detail: Option, /// Submitted value that causes the issue. #[serde(rename="submittedValue")] pub submitted_value: Option, /// Number of items in the account found to have the said issue. #[serde(rename="numItems")] pub num_items: Option, + /// The attribute name that is relevant for the issue. + pub location: Option, /// Issue identifier. pub id: Option, + /// Example items featuring the issue. + #[serde(rename="exampleItems")] + pub example_items: Option>, } impl Part for AccountStatusDataQualityIssue {} @@ -4423,26 +4085,6 @@ pub struct OrdersUpdateShipmentRequest { impl RequestValue for OrdersUpdateShipmentRequest {} -/// 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 DatafeedFormat { - /// Character encoding scheme of the data feed. If not specified, the encoding will be auto-detected. - #[serde(rename="fileEncoding")] - pub file_encoding: Option, - /// Specifies how double quotes are interpreted. If not specified, the mode will be auto-detected. Ignored for non-DSV data feeds. - #[serde(rename="quotingMode")] - pub quoting_mode: Option, - /// Delimiter for the separation of values in a delimiter-separated values feed. If not specified, the delimiter will be auto-detected. Ignored for non-DSV data feeds. - #[serde(rename="columnDelimiter")] - pub column_delimiter: Option, -} - -impl Part for DatafeedFormat {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4667,99 +4309,6 @@ impl<'a, C, A> AccounttaxMethods<'a, C, A> { -/// A builder providing access to all methods supported on *datafeedstatuse* resources. -/// It is not used directly, but through the `ShoppingContent` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// extern crate yup_oauth2 as oauth2; -/// extern crate google_content2 as content2; -/// -/// # #[test] fn egal() { -/// use std::default::Default; -/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use content2::ShoppingContent; -/// -/// let secret: ApplicationSecret = Default::default(); -/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// hyper::Client::new(), -/// ::default(), None); -/// let mut hub = ShoppingContent::new(hyper::Client::new(), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `custombatch(...)`, `get(...)` and `list(...)` -/// // to build up your call. -/// let rb = hub.datafeedstatuses(); -/// # } -/// ``` -pub struct DatafeedstatuseMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, -} - -impl<'a, C, A> MethodsBuilder for DatafeedstatuseMethods<'a, C, A> {} - -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. - /// - /// # Arguments - /// - /// * `merchantId` - No description provided. - /// * `datafeedId` - No description provided. - pub fn get(&self, merchant_id: &str, datafeed_id: &str) -> DatafeedstatuseGetCall<'a, C, A> { - DatafeedstatuseGetCall { - hub: self.hub, - _merchant_id: merchant_id.to_string(), - _datafeed_id: datafeed_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. - /// - /// # Arguments - /// - /// * `merchantId` - The ID of the managing account. - pub fn list(&self, merchant_id: &str) -> DatafeedstatuseListCall<'a, C, A> { - DatafeedstatuseListCall { - hub: self.hub, - _merchant_id: merchant_id.to_string(), - _page_token: Default::default(), - _max_results: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn custombatch(&self, request: DatafeedstatusesCustomBatchRequest) -> DatafeedstatuseCustombatchCall<'a, C, A> { - DatafeedstatuseCustombatchCall { - hub: self.hub, - _request: request, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - /// A builder providing access to all methods supported on *shippingsetting* resources. /// It is not used directly, but through the `ShoppingContent` hub. /// @@ -5212,7 +4761,7 @@ impl<'a, C, A> AccountstatuseMethods<'a, C, A> { /// ::default(), None); /// let mut hub = ShoppingContent::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `authinfo(...)`, `custombatch(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `authinfo(...)`, `claimwebsite(...)`, `custombatch(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` /// // to build up your call. /// let rb = hub.accounts(); /// # } @@ -5229,7 +4778,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a Merchant Center account. This method can only be called for multi-client accounts. + /// Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. /// /// # Arguments /// @@ -5263,7 +4812,7 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a Merchant Center account. This method can only be called for multi-client accounts. This method supports patch semantics. + /// Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics. /// /// # Arguments /// @@ -5283,6 +4832,26 @@ impl<'a, C, A> AccountMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Claims the website of a Merchant Center sub-account. This method can only be called for multi-client accounts. + /// + /// # Arguments + /// + /// * `merchantId` - The ID of the managing 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 { + hub: self.hub, + _merchant_id: merchant_id.to_string(), + _account_id: account_id.to_string(), + _overwrite: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// 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. @@ -5516,6 +5085,7 @@ impl<'a, C, A> ProductstatuseMethods<'a, C, A> { hub: self.hub, _merchant_id: merchant_id.to_string(), _product_id: product_id.to_string(), + _include_attributes: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5536,6 +5106,7 @@ impl<'a, C, A> ProductstatuseMethods<'a, C, A> { _page_token: Default::default(), _max_results: Default::default(), _include_invalid_inserted_items: Default::default(), + _include_attributes: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5553,6 +5124,7 @@ impl<'a, C, A> ProductstatuseMethods<'a, C, A> { ProductstatuseCustombatchCall { hub: self.hub, _request: request, + _include_attributes: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -5700,7 +5272,7 @@ impl<'a, C, A> ProductMethods<'a, C, A> { -/// A builder providing access to all methods supported on *accountshipping* resources. +/// A builder providing access to all methods supported on *datafeedstatuse* resources. /// It is not used directly, but through the `ShoppingContent` hub. /// /// # Example @@ -5723,30 +5295,49 @@ impl<'a, C, A> ProductMethods<'a, C, A> { /// ::default(), None); /// let mut hub = ShoppingContent::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `custombatch(...)`, `get(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `custombatch(...)`, `get(...)` and `list(...)` /// // to build up your call. -/// let rb = hub.accountshipping(); +/// let rb = hub.datafeedstatuses(); /// # } /// ``` -pub struct AccountshippingMethods<'a, C, A> +pub struct DatafeedstatuseMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, } -impl<'a, C, A> MethodsBuilder for AccountshippingMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for DatafeedstatuseMethods<'a, C, A> {} -impl<'a, C, A> AccountshippingMethods<'a, C, A> { +impl<'a, C, A> DatafeedstatuseMethods<'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. + /// Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. + /// + /// # Arguments + /// + /// * `merchantId` - No description provided. + /// * `datafeedId` - No description provided. + pub fn get(&self, merchant_id: &str, datafeed_id: &str) -> DatafeedstatuseGetCall<'a, C, A> { + DatafeedstatuseGetCall { + hub: self.hub, + _merchant_id: merchant_id.to_string(), + _datafeed_id: datafeed_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. /// /// # Arguments /// /// * `merchantId` - The ID of the managing account. - pub fn list(&self, merchant_id: &str) -> AccountshippingListCall<'a, C, A> { - AccountshippingListCall { + pub fn list(&self, merchant_id: &str) -> DatafeedstatuseListCall<'a, C, A> { + DatafeedstatuseListCall { hub: self.hub, _merchant_id: merchant_id.to_string(), _page_token: Default::default(), @@ -5757,81 +5348,14 @@ impl<'a, C, A> AccountshippingMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. - /// * `accountId` - The ID of the account for which to get/update account shipping settings. - pub fn patch(&self, request: AccountShipping, merchant_id: &str, account_id: &str) -> AccountshippingPatchCall<'a, C, A> { - AccountshippingPatchCall { + pub fn custombatch(&self, request: DatafeedstatusesCustomBatchRequest) -> DatafeedstatuseCustombatchCall<'a, C, A> { + DatafeedstatuseCustombatchCall { hub: self.hub, _request: request, - _merchant_id: merchant_id.to_string(), - _account_id: account_id.to_string(), - _dry_run: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `merchantId` - The ID of the managing account. - /// * `accountId` - The ID of the account for which to get/update account shipping settings. - pub fn update(&self, request: AccountShipping, merchant_id: &str, account_id: &str) -> AccountshippingUpdateCall<'a, C, A> { - AccountshippingUpdateCall { - hub: self.hub, - _request: request, - _merchant_id: merchant_id.to_string(), - _account_id: account_id.to_string(), - _dry_run: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves and updates the shipping settings of multiple accounts in a single request. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn custombatch(&self, request: AccountshippingCustomBatchRequest) -> AccountshippingCustombatchCall<'a, C, A> { - AccountshippingCustombatchCall { - hub: self.hub, - _request: request, - _dry_run: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. - /// - /// # Arguments - /// - /// * `merchantId` - The ID of the managing account. - /// * `accountId` - The ID of the account for which to get/update account shipping settings. - pub fn get(&self, merchant_id: &str, account_id: &str) -> AccountshippingGetCall<'a, C, A> { - AccountshippingGetCall { - hub: self.hub, - _merchant_id: merchant_id.to_string(), - _account_id: account_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -6006,17 +5530,17 @@ 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. + /// 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. - /// * `orderId` - The ID of the test order to modify. - pub fn advancetestorder(&self, merchant_id: &str, order_id: &str) -> OrderAdvancetestorderCall<'a, C, A> { - OrderAdvancetestorderCall { + /// * `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 { hub: self.hub, _merchant_id: merchant_id.to_string(), - _order_id: order_id.to_string(), + _merchant_order_id: merchant_order_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -6063,25 +5587,6 @@ 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. - /// - /// # Arguments - /// - /// * `merchantId` - The ID of the managing 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 { - hub: self.hub, - _merchant_id: merchant_id.to_string(), - _merchant_order_id: merchant_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. This method can only be called for non-multi-client accounts. @@ -6099,6 +5604,27 @@ 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. + /// + /// # 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: /// /// Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. @@ -6143,17 +5669,15 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Cancels a line item. This method can only be called for non-multi-client accounts. + /// Sandbox only. Moves a test order from state "inProgress" to state "pendingShipment". This method can only be called for non-multi-client accounts. /// /// # 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 { + /// * `orderId` - The ID of the test order to modify. + pub fn advancetestorder(&self, merchant_id: &str, order_id: &str) -> OrderAdvancetestorderCall<'a, C, A> { + OrderAdvancetestorderCall { hub: self.hub, - _request: request, _merchant_id: merchant_id.to_string(), _order_id: order_id.to_string(), _delegate: Default::default(), @@ -6164,7 +5688,7 @@ 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. This method can only be called for non-multi-client accounts. + /// Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. /// /// # Arguments /// @@ -6272,7 +5796,7 @@ impl<'a, C, A> AccounttaxCustombatchCall<'a, C, A> where C: BorrowMut AccounttaxPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/accounttax/{accountId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounttax/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6807,7 +6331,7 @@ impl<'a, C, A> AccounttaxListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/accounttax"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounttax".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7070,7 +6594,7 @@ impl<'a, C, A> AccounttaxUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/accounttax/{accountId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounttax/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7348,7 +6872,7 @@ impl<'a, C, A> AccounttaxGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/accounttax/{accountId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounttax/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7523,741 +7047,6 @@ impl<'a, C, A> AccounttaxGetCall<'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. -/// -/// A builder for the *get* method supported by a *datafeedstatuse* resource. -/// It is not used directly, but through a `DatafeedstatuseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.datafeedstatuses().get("merchantId", "datafeedId") -/// .doit(); -/// # } -/// ``` -pub struct DatafeedstatuseGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _merchant_id: String, - _datafeed_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DatafeedstatuseGetCall<'a, C, A> {} - -impl<'a, C, A> DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DatafeedStatus)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.datafeedstatuses.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(("datafeedId", self._datafeed_id.to_string())); - for &field in ["alt", "merchantId", "datafeedId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/datafeedstatuses/{datafeedId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{datafeedId}", "datafeedId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["datafeedId", "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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// 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) -> DatafeedstatuseGetCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// - /// Sets the *datafeed id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn datafeed_id(mut self, new_value: &str) -> DatafeedstatuseGetCall<'a, C, A> { - self._datafeed_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatafeedstatuseGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DatafeedstatuseGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DatafeedstatuseGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. -/// -/// A builder for the *list* method supported by a *datafeedstatuse* resource. -/// It is not used directly, but through a `DatafeedstatuseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.datafeedstatuses().list("merchantId") -/// .page_token("amet") -/// .max_results(41) -/// .doit(); -/// # } -/// ``` -pub struct DatafeedstatuseListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _merchant_id: String, - _page_token: Option, - _max_results: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DatafeedstatuseListCall<'a, C, A> {} - -impl<'a, C, A> DatafeedstatuseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DatafeedstatusesListResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.datafeedstatuses.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("merchantId", self._merchant_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", "merchantId", "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() + "{merchantId}/datafeedstatuses"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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 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) -> DatafeedstatuseListCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The token returned by the previous request. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> DatafeedstatuseListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// The maximum number of products to return in the response, used for paging. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> DatafeedstatuseListCall<'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) -> DatafeedstatuseListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DatafeedstatuseListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DatafeedstatuseListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// A builder for the *custombatch* method supported by a *datafeedstatuse* resource. -/// It is not used directly, but through a `DatafeedstatuseMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::DatafeedstatusesCustomBatchRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = DatafeedstatusesCustomBatchRequest::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.datafeedstatuses().custombatch(req) -/// .doit(); -/// # } -/// ``` -pub struct DatafeedstatuseCustombatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: DatafeedstatusesCustomBatchRequest, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DatafeedstatuseCustombatchCall<'a, C, A> {} - -impl<'a, C, A> DatafeedstatuseCustombatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, DatafeedstatusesCustomBatchResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.datafeedstatuses.custombatch", - 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() + "datafeedstatuses/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: DatafeedstatusesCustomBatchRequest) -> DatafeedstatuseCustombatchCall<'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) -> DatafeedstatuseCustombatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DatafeedstatuseCustombatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DatafeedstatuseCustombatchCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *shippingsetting* resource. @@ -8342,7 +7131,7 @@ impl<'a, C, A> ShippingsettingPatchCall<'a, C, A> where C: BorrowMut ShippingsettingGetsupportedcarrierCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/supportedCarriers"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/supportedCarriers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8810,8 +7599,8 @@ impl<'a, C, A> ShippingsettingGetsupportedcarrierCall<'a, C, A> where C: BorrowM /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.shippingsettings().list("merchantId") -/// .page_token("accusam") -/// .max_results(45) +/// .page_token("labore") +/// .max_results(62) /// .doit(); /// # } /// ``` @@ -8863,7 +7652,7 @@ impl<'a, C, A> ShippingsettingListCall<'a, C, A> where C: BorrowMut ShippingsettingCustombatchCall<'a, C, A> where C: BorrowMut ShippingsettingCustombatchCall<'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 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds/{datafeedId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10396,7 +9185,7 @@ impl<'a, C, A> DatafeedPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds/{datafeedId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10676,7 +9465,7 @@ impl<'a, C, A> DatafeedDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds/{datafeedId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10928,7 +9717,7 @@ impl<'a, C, A> DatafeedInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11150,8 +9939,8 @@ impl<'a, C, A> DatafeedInsertCall<'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.datafeeds().list("merchantId") -/// .page_token("amet.") -/// .max_results(74) +/// .page_token("dolor") +/// .max_results(53) /// .doit(); /// # } /// ``` @@ -11203,7 +9992,7 @@ impl<'a, C, A> DatafeedListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11415,7 +10204,7 @@ impl<'a, C, A> DatafeedListCall<'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.datafeeds().update(req, "merchantId", "datafeedId") -/// .dry_run(true) +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -11466,7 +10255,7 @@ impl<'a, C, A> DatafeedUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/datafeeds/{datafeedId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeeds/{datafeedId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11742,7 +10531,7 @@ impl<'a, C, A> AccountstatuseGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/accountstatuses/{accountId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accountstatuses/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11990,7 +10779,7 @@ impl<'a, C, A> AccountstatuseCustombatchCall<'a, C, A> where C: BorrowMut AccountstatuseCustombatchCall<'a, C, A> where C: BorrowMut AccountstatuseListCall<'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: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/accounts/{accountId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12765,7 +11554,7 @@ impl<'a, C, A> AccountAuthinfoCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/authinfo"; + let mut url = "https://www.googleapis.com/content/v2/accounts/authinfo".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12899,7 +11688,7 @@ impl<'a, C, A> AccountAuthinfoCall<'a, C, A> where C: BorrowMut, } -/// Updates a Merchant Center account. This method can only be called for multi-client accounts. This method supports patch semantics. +/// Updates a Merchant Center account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. This method supports patch semantics. /// /// A builder for the *patch* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -12932,7 +11721,7 @@ impl<'a, C, A> AccountAuthinfoCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.accounts().patch(req, "merchantId", "accountId") -/// .dry_run(false) +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -12983,7 +11772,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/accounts/{accountId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13189,6 +11978,265 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: } +/// Claims the website of a Merchant Center sub-account. This method can only be called for multi-client accounts. +/// +/// A builder for the *claimwebsite* 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 yup_oauth2 as oauth2; +/// # extern crate google_content2 as content2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.accounts().claimwebsite("merchantId", "accountId") +/// .overwrite(false) +/// .doit(); +/// # } +/// ``` +pub struct AccountClaimwebsiteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _merchant_id: String, + _account_id: String, + _overwrite: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AccountClaimwebsiteCall<'a, C, A> {} + +impl<'a, C, A> AccountClaimwebsiteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, AccountsClaimWebsiteResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.accounts.claimwebsite", + 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(("accountId", self._account_id.to_string())); + if let Some(value) = self._overwrite { + params.push(("overwrite", value.to_string())); + } + for &field in ["alt", "merchantId", "accountId", "overwrite"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts/{accountId}/claimwebsite".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{accountId}", "accountId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["accountId", "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)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The ID of the 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) -> AccountClaimwebsiteCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// The ID of the account whose website is claimed. + /// + /// Sets the *account id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn account_id(mut self, new_value: &str) -> AccountClaimwebsiteCall<'a, C, A> { + self._account_id = new_value.to_string(); + self + } + /// Flag to remove any existing claim on the requested website by another account and replace it with a claim from this account. + /// + /// Sets the *overwrite* query property to the given value. + pub fn overwrite(mut self, new_value: bool) -> AccountClaimwebsiteCall<'a, C, A> { + self._overwrite = 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) -> AccountClaimwebsiteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AccountClaimwebsiteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AccountClaimwebsiteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Lists the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. /// /// A builder for the *list* method supported by a *account* resource. @@ -13216,8 +12264,8 @@ impl<'a, C, A> AccountPatchCall<'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.accounts().list("merchantId") -/// .page_token("aliquyam") -/// .max_results(96) +/// .page_token("dolore") +/// .max_results(82) /// .doit(); /// # } /// ``` @@ -13269,7 +12317,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/accounts"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13524,7 +12572,7 @@ impl<'a, C, A> AccountDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "{merchantId}/accounts/{accountId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13729,7 +12777,7 @@ impl<'a, C, A> AccountDeleteCall<'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.accounts().custombatch(req) -/// .dry_run(false) +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -13776,7 +12824,7 @@ impl<'a, C, A> AccountCustombatchCall<'a, C, A> where C: BorrowMut AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/accounts/{accountId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14221,7 +13269,7 @@ impl<'a, C, A> AccountGetCall<'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.accounts().insert(req, "merchantId") -/// .dry_run(false) +/// .dry_run(true) /// .doit(); /// # } /// ``` @@ -14270,7 +13318,7 @@ impl<'a, C, A> AccountInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/accounts"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14546,7 +13594,7 @@ impl<'a, C, A> InventoryCustombatchCall<'a, C, A> where C: BorrowMut InventoryCustombatchCall<'a, C, A> where C: BorrowMut InventorySetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/inventory/{storeCode}/products/{productId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/inventory/{storeCode}/products/{productId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15040,6 +14088,7 @@ impl<'a, C, A> InventorySetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.productstatuses().get("merchantId", "productId") +/// .include_attributes(false) /// .doit(); /// # } /// ``` @@ -15049,6 +14098,7 @@ pub struct ProductstatuseGetCall<'a, C, A> hub: &'a ShoppingContent, _merchant_id: String, _product_id: String, + _include_attributes: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -15070,10 +14120,13 @@ impl<'a, C, A> ProductstatuseGetCall<'a, C, A> where C: BorrowMut }; dlg.begin(MethodInfo { id: "content.productstatuses.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); params.push(("productId", self._product_id.to_string())); - for &field in ["alt", "merchantId", "productId"].iter() { + if let Some(value) = self._include_attributes { + params.push(("includeAttributes", value.to_string())); + } + for &field in ["alt", "merchantId", "productId", "includeAttributes"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15085,7 +14138,7 @@ impl<'a, C, A> ProductstatuseGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/productstatuses/{productId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/productstatuses/{productId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15208,6 +14261,13 @@ impl<'a, C, A> ProductstatuseGetCall<'a, C, A> where C: BorrowMut self._product_id = new_value.to_string(); self } + /// Flag to include full product data in the result of this get request. The default value is false. + /// + /// Sets the *include attributes* query property to the given value. + pub fn include_attributes(mut self, new_value: bool) -> ProductstatuseGetCall<'a, C, A> { + self._include_attributes = 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. /// @@ -15287,9 +14347,10 @@ impl<'a, C, A> ProductstatuseGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.productstatuses().list("merchantId") -/// .page_token("sed") -/// .max_results(19) +/// .page_token("nonumy") +/// .max_results(72) /// .include_invalid_inserted_items(false) +/// .include_attributes(false) /// .doit(); /// # } /// ``` @@ -15301,6 +14362,7 @@ pub struct ProductstatuseListCall<'a, C, A> _page_token: Option, _max_results: Option, _include_invalid_inserted_items: Option, + _include_attributes: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -15322,7 +14384,7 @@ impl<'a, C, A> ProductstatuseListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -15333,7 +14395,10 @@ impl<'a, C, A> ProductstatuseListCall<'a, C, A> where C: BorrowMut ProductstatuseListCall<'a, C, A> where C: BorrowMut ProductstatuseListCall<'a, C, A> where C: BorrowMut ProductstatuseListCall<'a, C, A> { + self._include_attributes = 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. /// @@ -15564,6 +14636,7 @@ impl<'a, C, A> ProductstatuseListCall<'a, C, A> where C: BorrowMut hub: &'a ShoppingContent, _request: ProductstatusesCustomBatchRequest, + _include_attributes: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -15593,8 +14667,11 @@ impl<'a, C, A> ProductstatuseCustombatchCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((3 + self._additional_params.len())); - for &field in ["alt"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + if let Some(value) = self._include_attributes { + params.push(("includeAttributes", value.to_string())); + } + for &field in ["alt", "includeAttributes"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15606,7 +14683,7 @@ impl<'a, C, A> ProductstatuseCustombatchCall<'a, C, A> where C: BorrowMut ProductstatuseCustombatchCall<'a, C, A> where C: BorrowMut ProductstatuseCustombatchCall<'a, C, A> { + self._include_attributes = 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. /// @@ -15791,8 +14875,8 @@ impl<'a, C, A> ProductstatuseCustombatchCall<'a, C, A> where C: BorrowMut ProductListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/products"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/products".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16107,7 +15191,7 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/products/{productId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/products/{productId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16309,7 +15393,7 @@ impl<'a, C, A> ProductGetCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.products().delete("merchantId", "productId") -/// .dry_run(true) +/// .dry_run(false) /// .doit(); /// # } /// ``` @@ -16358,7 +15442,7 @@ impl<'a, C, A> ProductDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "{merchantId}/products/{productId}"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/products/{productId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16610,7 +15694,7 @@ impl<'a, C, A> ProductCustombatchCall<'a, C, A> where C: BorrowMut ProductCustombatchCall<'a, C, A> where C: BorrowMut ProductInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/products"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/products".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17053,10 +16137,10 @@ impl<'a, C, A> ProductInsertCall<'a, C, A> where C: BorrowMut, A: } -/// Lists the shipping settings of the sub-accounts in your Merchant Center account. This method can only be called for multi-client accounts. +/// Retrieves the status of a datafeed from your Merchant Center account. This method can only be called for non-multi-client accounts. /// -/// A builder for the *list* method supported by a *accountshipping* resource. -/// It is not used directly, but through a `AccountshippingMethods` instance. +/// A builder for the *get* method supported by a *datafeedstatuse* resource. +/// It is not used directly, but through a `DatafeedstatuseMethods` instance. /// /// # Example /// @@ -17079,13 +16163,258 @@ impl<'a, C, A> ProductInsertCall<'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.accountshipping().list("merchantId") -/// .page_token("dolores") -/// .max_results(3) +/// let result = hub.datafeedstatuses().get("merchantId", "datafeedId") /// .doit(); /// # } /// ``` -pub struct AccountshippingListCall<'a, C, A> +pub struct DatafeedstatuseGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a ShoppingContent, + _merchant_id: String, + _datafeed_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DatafeedstatuseGetCall<'a, C, A> {} + +impl<'a, C, A> DatafeedstatuseGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, DatafeedStatus)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.datafeedstatuses.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(("datafeedId", self._datafeed_id.to_string())); + for &field in ["alt", "merchantId", "datafeedId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/datafeedstatuses/{datafeedId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{datafeedId}", "datafeedId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["datafeedId", "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)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// 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) -> DatafeedstatuseGetCall<'a, C, A> { + self._merchant_id = new_value.to_string(); + self + } + /// + /// Sets the *datafeed id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn datafeed_id(mut self, new_value: &str) -> DatafeedstatuseGetCall<'a, C, A> { + self._datafeed_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatafeedstatuseGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DatafeedstatuseGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DatafeedstatuseGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists the statuses of the datafeeds in your Merchant Center account. This method can only be called for non-multi-client accounts. +/// +/// A builder for the *list* method supported by a *datafeedstatuse* resource. +/// It is not used directly, but through a `DatafeedstatuseMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_content2 as content2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.datafeedstatuses().list("merchantId") +/// .page_token("ut") +/// .max_results(31) +/// .doit(); +/// # } +/// ``` +pub struct DatafeedstatuseListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, @@ -17097,13 +16426,13 @@ pub struct AccountshippingListCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for AccountshippingListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for DatafeedstatuseListCall<'a, C, A> {} -impl<'a, C, A> AccountshippingListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> DatafeedstatuseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AccountshippingListResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, DatafeedstatusesListResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -17111,7 +16440,7 @@ impl<'a, C, A> AccountshippingListCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.accountshipping.list", + dlg.begin(MethodInfo { id: "content.datafeedstatuses.list", http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("merchantId", self._merchant_id.to_string())); @@ -17133,7 +16462,7 @@ impl<'a, C, A> AccountshippingListCall<'a, C, A> where C: BorrowMut AccountshippingListCall<'a, C, A> where C: BorrowMut AccountshippingListCall<'a, C, A> { + pub fn merchant_id(mut self, new_value: &str) -> DatafeedstatuseListCall<'a, C, A> { self._merchant_id = new_value.to_string(); self } /// The token returned by the previous request. /// /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AccountshippingListCall<'a, C, A> { + pub fn page_token(mut self, new_value: &str) -> DatafeedstatuseListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The maximum number of shipping settings to return in the response, used for paging. + /// The maximum number of products to return in the response, used for paging. /// /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> AccountshippingListCall<'a, C, A> { + pub fn max_results(mut self, new_value: u32) -> DatafeedstatuseListCall<'a, C, A> { self._max_results = Some(new_value); self } @@ -17266,7 +16595,7 @@ impl<'a, C, A> AccountshippingListCall<'a, C, A> where C: BorrowMut AccountshippingListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatafeedstatuseListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -17287,7 +16616,7 @@ impl<'a, C, A> AccountshippingListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountshippingListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> DatafeedstatuseListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -17304,7 +16633,7 @@ impl<'a, C, A> AccountshippingListCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> AccountshippingListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> DatafeedstatuseListCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -17312,10 +16641,8 @@ impl<'a, C, A> AccountshippingListCall<'a, C, A> where C: BorrowMut AccountshippingListCall<'a, C, A> where C: BorrowMut AccountshippingListCall<'a, C, A> where C: BorrowMut +pub struct DatafeedstatuseCustombatchCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, - _request: AccountShipping, - _merchant_id: String, - _account_id: String, - _dry_run: Option, + _request: DatafeedstatusesCustomBatchRequest, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for AccountshippingPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for DatafeedstatuseCustombatchCall<'a, C, A> {} -impl<'a, C, A> AccountshippingPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> DatafeedstatuseCustombatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AccountShipping)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, DatafeedstatusesCustomBatchResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -17376,591 +16699,10 @@ impl<'a, C, A> AccountshippingPatchCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.accountshipping.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("accountId", self._account_id.to_string())); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "merchantId", "accountId", "dryRun"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/accountshipping/{accountId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{accountId}", "accountId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["accountId", "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::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: AccountShipping) -> AccountshippingPatchCall<'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) -> AccountshippingPatchCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the account for which to get/update account shipping settings. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> AccountshippingPatchCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// Flag to run the request in dry-run mode. - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> AccountshippingPatchCall<'a, C, A> { - self._dry_run = 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) -> AccountshippingPatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AccountshippingPatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccountshippingPatchCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Updates the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. -/// -/// A builder for the *update* method supported by a *accountshipping* resource. -/// It is not used directly, but through a `AccountshippingMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::AccountShipping; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = AccountShipping::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.accountshipping().update(req, "merchantId", "accountId") -/// .dry_run(true) -/// .doit(); -/// # } -/// ``` -pub struct AccountshippingUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: AccountShipping, - _merchant_id: String, - _account_id: String, - _dry_run: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccountshippingUpdateCall<'a, C, A> {} - -impl<'a, C, A> AccountshippingUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AccountShipping)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.accountshipping.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("merchantId", self._merchant_id.to_string())); - params.push(("accountId", self._account_id.to_string())); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "merchantId", "accountId", "dryRun"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/accountshipping/{accountId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{accountId}", "accountId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["accountId", "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::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: AccountShipping) -> AccountshippingUpdateCall<'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) -> AccountshippingUpdateCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the account for which to get/update account shipping settings. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> AccountshippingUpdateCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// Flag to run the request in dry-run mode. - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> AccountshippingUpdateCall<'a, C, A> { - self._dry_run = 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) -> AccountshippingUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AccountshippingUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccountshippingUpdateCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves and updates the shipping settings of multiple accounts in a single request. -/// -/// A builder for the *custombatch* method supported by a *accountshipping* resource. -/// It is not used directly, but through a `AccountshippingMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// use content2::AccountshippingCustomBatchRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = AccountshippingCustomBatchRequest::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.accountshipping().custombatch(req) -/// .dry_run(true) -/// .doit(); -/// # } -/// ``` -pub struct AccountshippingCustombatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _request: AccountshippingCustomBatchRequest, - _dry_run: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccountshippingCustombatchCall<'a, C, A> {} - -impl<'a, C, A> AccountshippingCustombatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AccountshippingCustomBatchResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.accountshipping.custombatch", + dlg.begin(MethodInfo { id: "content.datafeedstatuses.custombatch", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - if let Some(value) = self._dry_run { - params.push(("dryRun", value.to_string())); - } - for &field in ["alt", "dryRun"].iter() { + 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)); @@ -17972,7 +16714,7 @@ impl<'a, C, A> AccountshippingCustombatchCall<'a, C, A> where C: BorrowMut AccountshippingCustombatchCall<'a, C, A> where C: BorrowMut AccountshippingCustombatchCall<'a, C, A> { + pub fn request(mut self, new_value: DatafeedstatusesCustomBatchRequest) -> DatafeedstatuseCustombatchCall<'a, C, A> { self._request = new_value; self } - /// Flag to run the request in dry-run mode. - /// - /// Sets the *dry run* query property to the given value. - pub fn dry_run(mut self, new_value: bool) -> AccountshippingCustombatchCall<'a, C, A> { - self._dry_run = 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) -> AccountshippingCustombatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DatafeedstatuseCustombatchCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -18112,7 +16847,7 @@ impl<'a, C, A> AccountshippingCustombatchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountshippingCustombatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> DatafeedstatuseCustombatchCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -18129,254 +16864,7 @@ impl<'a, C, A> AccountshippingCustombatchCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> AccountshippingCustombatchCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Retrieves the shipping settings of the account. This method can only be called for accounts to which the managing account has access: either the managing account itself or sub-accounts if the managing account is a multi-client account. -/// -/// A builder for the *get* method supported by a *accountshipping* resource. -/// It is not used directly, but through a `AccountshippingMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_content2 as content2; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use content2::ShoppingContent; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = ShoppingContent::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.accountshipping().get("merchantId", "accountId") -/// .doit(); -/// # } -/// ``` -pub struct AccountshippingGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _merchant_id: String, - _account_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccountshippingGetCall<'a, C, A> {} - -impl<'a, C, A> AccountshippingGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, AccountShipping)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.accountshipping.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(("accountId", self._account_id.to_string())); - for &field in ["alt", "merchantId", "accountId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "{merchantId}/accountshipping/{accountId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{accountId}", "accountId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(2); - for param_name in ["accountId", "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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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 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) -> AccountshippingGetCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The ID of the account for which to get/update account shipping settings. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> AccountshippingGetCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> AccountshippingGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> AccountshippingGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccountshippingGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> DatafeedstatuseCustombatchCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -18411,13 +16899,13 @@ impl<'a, C, A> AccountshippingGetCall<'a, C, A> where C: BorrowMut OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/orders".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18780,7 +17268,7 @@ impl<'a, C, A> OrderGettestordertemplateCall<'a, C, A> where C: BorrowMut 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 = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19281,7 +17769,7 @@ impl<'a, C, A> OrderRefundCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/refund"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}/refund".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19559,7 +18047,7 @@ impl<'a, C, A> OrderAcknowledgeCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/acknowledge"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}/acknowledge".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19837,7 +18325,7 @@ impl<'a, C, A> OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut +pub struct OrderGetbymerchantorderidCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, _merchant_id: String, - _order_id: String, + _merchant_order_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrderAdvancetestorderCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrderGetbymerchantorderidCall<'a, C, A> {} -impl<'a, C, A> OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersAdvanceTestOrderResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersGetByMerchantOrderIdResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -20091,12 +18579,12 @@ impl<'a, C, A> OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.orders.advancetestorder", - http_method: hyper::method::Method::Post }); + dlg.begin(MethodInfo { id: "content.orders.getbymerchantorderid", + 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() { + params.push(("merchantOrderId", self._merchant_order_id.to_string())); + for &field in ["alt", "merchantId", "merchantOrderId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -20108,12 +18596,12 @@ impl<'a, C, A> OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -20125,7 +18613,7 @@ impl<'a, C, A> OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["orderId", "merchantId"].iter() { + for param_name in ["merchantOrderId", "merchantId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -20158,7 +18646,7 @@ impl<'a, C, A> OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut OrderAdvancetestorderCall<'a, C, A> { + pub fn merchant_id(mut self, new_value: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { self._merchant_id = new_value.to_string(); self } - /// The ID of the test order to modify. + /// The merchant order id to be looked for. /// - /// Sets the *order id* path property to the given value. + /// Sets the *merchant 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) -> OrderAdvancetestorderCall<'a, C, A> { - self._order_id = new_value.to_string(); + pub fn merchant_order_id(mut self, new_value: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { + self._merchant_order_id = new_value.to_string(); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -20237,7 +18725,7 @@ impl<'a, C, A> OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut OrderAdvancetestorderCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderGetbymerchantorderidCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -20258,7 +18746,7 @@ impl<'a, C, A> OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrderAdvancetestorderCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> OrderGetbymerchantorderidCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -20275,7 +18763,7 @@ impl<'a, C, A> OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> OrderAdvancetestorderCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrderGetbymerchantorderidCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -20360,7 +18848,7 @@ impl<'a, C, A> 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::new(), auth); -/// // You can configure optional parameters by calling 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().getbymerchantorderid("merchantId", "merchantOrderId") -/// .doit(); -/// # } -/// ``` -pub struct OrderGetbymerchantorderidCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a ShoppingContent, - _merchant_id: String, - _merchant_order_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for OrderGetbymerchantorderidCall<'a, C, A> {} - -impl<'a, C, A> OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersGetByMerchantOrderIdResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.getbymerchantorderid", - 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(("merchantOrderId", self._merchant_order_id.to_string())); - for &field in ["alt", "merchantId", "merchantOrderId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) 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}/ordersbymerchantid/{merchantOrderId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{merchantId}", "merchantId"), ("{merchantOrderId}", "merchantOrderId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["merchantOrderId", "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)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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 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) -> OrderGetbymerchantorderidCall<'a, C, A> { - self._merchant_id = new_value.to_string(); - self - } - /// The merchant order id to be looked for. - /// - /// Sets the *merchant 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 merchant_order_id(mut self, new_value: &str) -> OrderGetbymerchantorderidCall<'a, C, A> { - self._merchant_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) -> OrderGetbymerchantorderidCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> OrderGetbymerchantorderidCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> OrderGetbymerchantorderidCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Retrieves or modifies multiple orders in a single request. This method can only be called for non-multi-client accounts. /// /// A builder for the *custombatch* method supported by a *order* resource. @@ -21149,7 +19390,7 @@ impl<'a, C, A> OrderCustombatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "orders/batch"; + let mut url = "https://www.googleapis.com/content/v2/orders/batch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -21307,6 +19548,284 @@ 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 yup_oauth2 as oauth2; +/// # extern crate google_content2 as content2; +/// use content2::OrdersCancelLineItemRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use content2::ShoppingContent; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = ShoppingContent::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = 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 = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}/cancelLineItem".to_string(); + 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. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing 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: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Marks line item(s) as shipped. This method can only be called for non-multi-client accounts. /// /// A builder for the *shiplineitems* method supported by a *order* resource. @@ -21386,7 +19905,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 = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}/shipLineItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -21664,7 +20183,7 @@ impl<'a, C, A> OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = ShoppingContent::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = 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") +/// let result = hub.orders().advancetestorder("merchantId", "orderId") /// .doit(); /// # } /// ``` -pub struct OrderCancellineitemCall<'a, C, A> +pub struct OrderAdvancetestorderCall<'a, C, A> where C: 'a, A: 'a { hub: &'a ShoppingContent, - _request: OrdersCancelLineItemRequest, _merchant_id: String, _order_id: String, _delegate: Option<&'a mut Delegate>, @@ -21911,13 +20423,13 @@ pub struct OrderCancellineitemCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for OrderCancellineitemCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for OrderAdvancetestorderCall<'a, C, A> {} -impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> OrderAdvancetestorderCall<'a, C, 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)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, OrdersAdvanceTestOrderResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -21925,9 +20437,9 @@ impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "content.orders.cancellineitem", + dlg.begin(MethodInfo { id: "content.orders.advancetestorder", http_method: hyper::method::Method::Post }); - 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(("merchantId", self._merchant_id.to_string())); params.push(("orderId", self._order_id.to_string())); for &field in ["alt", "merchantId", "orderId"].iter() { @@ -21942,7 +20454,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 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> { + pub fn merchant_id(mut self, new_value: &str) -> OrderAdvancetestorderCall<'a, C, A> { self._merchant_id = new_value.to_string(); self } - /// The ID of the order. + /// The ID of the test order to modify. /// /// 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> { + pub fn order_id(mut self, new_value: &str) -> OrderAdvancetestorderCall<'a, C, A> { self._order_id = new_value.to_string(); self } @@ -22095,7 +20583,7 @@ impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut OrderCancellineitemCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> OrderAdvancetestorderCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -22116,7 +20604,7 @@ impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> OrderCancellineitemCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> OrderAdvancetestorderCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -22133,7 +20621,7 @@ impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> OrderCancellineitemCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> OrderAdvancetestorderCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -22141,7 +20629,7 @@ impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut OrderCancelCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/cancel"; + let mut url = "https://www.googleapis.com/content/v2/{merchantId}/orders/{orderId}/cancel".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -22419,3 +20907,4 @@ impl<'a, C, A> OrderCancelCall<'a, C, A> where C: BorrowMut, A: o } + diff --git a/gen/content2_sandbox-cli/Cargo.toml b/gen/content2_sandbox-cli/Cargo.toml index 3a36203c89..f3e39b999c 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.4+20161205" +version = "1.0.4+20170519" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-content2_sandbox] path = "../content2_sandbox" -version = "1.0.4+20161205" +version = "1.0.4+20170519" diff --git a/gen/content2_sandbox-cli/README.md b/gen/content2_sandbox-cli/README.md index 3b350890d9..b7ff324fdf 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 *20161205*. The CLI is at version *1.0.4*. +This documentation was generated from the *Shopping Content* API at revision *20170519*. The CLI is at version *1.0.4*. ```bash content2-sandbox [options] diff --git a/gen/content2_sandbox-cli/mkdocs.yml b/gen/content2_sandbox-cli/mkdocs.yml index bf4a56f24e..10805d8677 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.4+20161205 +site_name: Shopping Content v1.0.4+20170519 site_url: http://byron.github.io/google-apis-rs/google-content2_sandbox-cli site_description: A complete library to interact with Shopping Content (protocol v2sandbox) diff --git a/gen/content2_sandbox-cli/src/main.rs b/gen/content2_sandbox-cli/src/main.rs index 8b3665520d..931f052cbd 100644 --- a/gen/content2_sandbox-cli/src/main.rs +++ b/gen/content2_sandbox-cli/src/main.rs @@ -1420,7 +1420,7 @@ fn main() { Some(false)), ]), ("cancel", - Some(r##"Cancels all line items in an order. This method can only be called for non-multi-client accounts."##), + Some(r##"Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_cancel", vec![ (Some(r##"merchant-id"##), @@ -1454,7 +1454,7 @@ fn main() { Some(false)), ]), ("cancellineitem", - Some(r##"Cancels a line item. This method can only be called for non-multi-client accounts."##), + Some(r##"Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts."##), "Details at http://byron.github.io/google-apis-rs/google_content2_sandbox_cli/orders_cancellineitem", vec![ (Some(r##"merchant-id"##), @@ -1819,7 +1819,7 @@ fn main() { let mut app = App::new("content2-sandbox") .author("Sebastian Thiel ") - .version("1.0.4+20161205") + .version("1.0.4+20170519") .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 d1966cd884..21dfe09cdf 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.4+20161205" +version = "1.0.4+20170519" 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.4+20161205" +documentation = "https://docs.rs/google-content2_sandbox/1.0.4+20170519" license = "MIT" keywords = ["content", "google", "protocol", "web", "api"] diff --git a/gen/content2_sandbox/README.md b/gen/content2_sandbox/README.md index 90279ce4d4..7c3b55b123 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.4+20161205*, where *20161205* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Shopping Content* crate version *1.0.4+20170519*, where *20170519* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161205/google_content2_sandbox/struct.ShoppingContent.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.ShoppingContent.html) ... -* [orders](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.Order.html) - * [*acknowledge*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderCancellineitemCall.html), [*createtestorder*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderCreatetestorderCall.html), [*custombatch*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderGettestordertemplateCall.html), [*list*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderRefundCall.html), [*returnlineitem*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderReturnlineitemCall.html), [*shiplineitems*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderShiplineitemCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/struct.OrderUpdateshipmentCall.html) +* [orders](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.Order.html) + * [*acknowledge*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderAcknowledgeCall.html), [*advancetestorder*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderAdvancetestorderCall.html), [*cancel*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderCancelCall.html), [*cancellineitem*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderCancellineitemCall.html), [*createtestorder*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderCreatetestorderCall.html), [*custombatch*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderCustombatchCall.html), [*get*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderGetCall.html), [*getbymerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderGetbymerchantorderidCall.html), [*gettestordertemplate*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderGettestordertemplateCall.html), [*list*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderListCall.html), [*refund*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderRefundCall.html), [*returnlineitem*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderReturnlineitemCall.html), [*shiplineitems*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderShiplineitemCall.html), [*updatemerchantorderid*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/struct.OrderUpdatemerchantorderidCall.html) and [*updateshipment*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/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.4+20161205/google_content2_sandbox/struct.ShoppingContent.html)** +* **[Hub](https://docs.rs/google-content2_sandbox/1.0.4+20170519/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.4+20161205/google_content2_sandbox/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-content2_sandbox/1.0.4+20170519/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.4+20161205/google_content2_sandbox/trait.Part.html)** + * **[Parts](https://docs.rs/google-content2_sandbox/1.0.4+20170519/google_content2_sandbox/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-content2_sandbox/1.0.4+20161205/google_content2_sandbox/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-content2_sandbox/1.0.4+20170519/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. @@ -136,17 +136,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-content2_sandbox/1.0.4+20161205/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.4+20170519/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.4+20161205/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.4+20170519/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.4+20161205/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.4+20170519/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.4+20161205/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.4+20170519/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")`. @@ -156,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-content2_sandbox/1.0.4+20161205/google_content2_sandbox/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-content2_sandbox/1.0.4+20161205/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.4+20170519/google_content2_sandbox/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-content2_sandbox/1.0.4+20170519/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.4+20161205/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.4+20170519/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.4+20161205/google_content2_sandbox/trait.RequestValue.html) and -[decodable](https://docs.rs/google-content2_sandbox/1.0.4+20161205/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.4+20170519/google_content2_sandbox/trait.RequestValue.html) and +[decodable](https://docs.rs/google-content2_sandbox/1.0.4+20170519/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.4+20161205/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.4+20170519/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.4+20161205/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.4+20170519/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.4+20161205/google_content2_sandbox/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-content2_sandbox/1.0.4+20170519/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 1cc3b0cd09..5d6d275d4d 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.4+20161205*, where *20161205* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Shopping Content* crate version *1.0.4+20170519*, where *20170519* is the exact revision of the *content:v2sandbox* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Shopping Content* *v2_sandbox* API can be found at the //! [official documentation site](https://developers.google.com/shopping-content). @@ -191,7 +191,7 @@ // 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 +// 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)] @@ -323,8 +323,6 @@ pub struct ShoppingContent { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for ShoppingContent {} @@ -337,8 +335,6 @@ impl<'a, C, A> ShoppingContent client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/content/v2sandbox/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -355,26 +351,6 @@ impl<'a, C, A> ShoppingContent self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/content/v2sandbox/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -2076,7 +2052,7 @@ impl<'a, C, A> OrderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Cancels a line item. This method can only be called for non-multi-client accounts. + /// Cancels a line item, making a full refund. This method can only be called for non-multi-client accounts. /// /// # Arguments /// @@ -2137,7 +2113,7 @@ 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. This method can only be called for non-multi-client accounts. + /// Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. /// /// # Arguments /// @@ -2258,7 +2234,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 = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders/{orderId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2540,7 +2516,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders"; + let mut url = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2836,7 +2812,7 @@ impl<'a, C, A> OrderUpdateshipmentCall<'a, C, A> where C: BorrowMut OrderAdvancetestorderCall<'a, C, A> where C: BorrowMut OrderUpdatemerchantorderidCall<'a, C, A> where C: BorrowMut OrderReturnlineitemCall<'a, C, A> where C: BorrowMut OrderGettestordertemplateCall<'a, C, A> where C: BorrowMut OrderCreatetestorderCall<'a, C, A> where C: BorrowMut OrderRefundCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/refund"; + let mut url = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders/{orderId}/refund".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4704,7 +4680,7 @@ impl<'a, C, A> OrderCustombatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "orders/batch"; + let mut url = "https://www.googleapis.com/content/v2sandbox/orders/batch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4862,7 +4838,7 @@ impl<'a, C, A> OrderCustombatchCall<'a, C, A> where C: BorrowMut, } -/// Cancels a line item. This method can only be called for non-multi-client accounts. +/// 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. @@ -4941,7 +4917,7 @@ impl<'a, C, A> OrderCancellineitemCall<'a, C, A> where C: BorrowMut OrderGetbymerchantorderidCall<'a, C, A> where C: BorrowMut OrderAcknowledgeCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/acknowledge"; + let mut url = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders/{orderId}/acknowledge".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5665,7 +5641,7 @@ impl<'a, C, A> OrderAcknowledgeCall<'a, C, A> where C: BorrowMut, } -/// Cancels all line items in an order. This method can only be called for non-multi-client accounts. +/// Cancels all line items in an order, making a full refund. This method can only be called for non-multi-client accounts. /// /// A builder for the *cancel* method supported by a *order* resource. /// It is not used directly, but through a `OrderMethods` instance. @@ -5744,7 +5720,7 @@ impl<'a, C, A> OrderCancelCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{merchantId}/orders/{orderId}/cancel"; + let mut url = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders/{orderId}/cancel".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6022,7 +5998,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 = "https://www.googleapis.com/content/v2sandbox/{merchantId}/orders/{orderId}/shipLineItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6221,3 +6197,4 @@ impl<'a, C, A> OrderShiplineitemCall<'a, C, A> where C: BorrowMut } + diff --git a/gen/coordinate1-cli/Cargo.toml b/gen/coordinate1-cli/Cargo.toml index db02d53f76..c86bca8d78 100644 --- a/gen/coordinate1-cli/Cargo.toml +++ b/gen/coordinate1-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/coordinate1/src/lib.rs b/gen/coordinate1/src/lib.rs index ec2b58b0e8..73c5957f84 100644 --- a/gen/coordinate1/src/lib.rs +++ b/gen/coordinate1/src/lib.rs @@ -200,7 +200,7 @@ // 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 +// 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)] @@ -345,8 +345,6 @@ pub struct Coordinate { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Coordinate {} @@ -359,8 +357,6 @@ impl<'a, C, A> Coordinate client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/coordinate/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -392,26 +388,6 @@ impl<'a, C, A> Coordinate self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/coordinate/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1415,7 +1391,7 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -1721,7 +1697,7 @@ impl<'a, C, A> JobUpdateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2122,7 +2098,7 @@ impl<'a, C, A> JobPatchCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2482,7 +2458,7 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2787,7 +2763,7 @@ impl<'a, C, A> JobInsertCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3151,7 +3127,7 @@ impl<'a, C, A> ScheduleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}/schedule"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}/schedule".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3477,7 +3453,7 @@ impl<'a, C, A> SchedulePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}/schedule"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}/schedule".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3776,7 +3752,7 @@ impl<'a, C, A> ScheduleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams/{teamId}/jobs/{jobId}/schedule"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/jobs/{jobId}/schedule".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4021,7 +3997,7 @@ impl<'a, C, A> WorkerListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams/{teamId}/workers"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/workers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4270,7 +4246,7 @@ impl<'a, C, A> LocationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams/{teamId}/workers/{workerEmail}/locations"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams/{teamId}/workers/{workerEmail}/locations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4552,7 +4528,7 @@ impl<'a, C, A> TeamListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "teams"; + let mut url = "https://www.googleapis.com/coordinate/v1/teams".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4777,7 +4753,7 @@ impl<'a, C, A> CustomFieldDefListCall<'a, C, A> where C: BorrowMut CustomFieldDefListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Customsearch {} @@ -349,8 +347,6 @@ impl<'a, C, A> Customsearch client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/customsearch/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -367,26 +363,6 @@ impl<'a, C, A> Customsearch self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/customsearch/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1113,7 +1089,7 @@ impl<'a, C, A> CseListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1"; + let mut url = "https://www.googleapis.com/customsearch/v1".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1453,3 +1429,4 @@ impl<'a, C, A> CseListCall<'a, C, A> where C: BorrowMut, A: oauth } + diff --git a/gen/dataproc1-cli/Cargo.toml b/gen/dataproc1-cli/Cargo.toml index 53d54dd113..52eaad8ffa 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.4+20161102" +version = "1.0.4+20170515" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-dataproc1] path = "../dataproc1" -version = "1.0.4+20161102" +version = "1.0.4+20170515" diff --git a/gen/dataproc1-cli/README.md b/gen/dataproc1-cli/README.md index a794a36142..f67968738d 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 *20161102*. The CLI is at version *1.0.4*. +This documentation was generated from the *dataproc* API at revision *20170515*. The CLI is at version *1.0.4*. ```bash dataproc1 [options] @@ -40,6 +40,7 @@ dataproc1 [options] regions-jobs-delete [-p ]... [-o ] regions-jobs-get [-p ]... [-o ] regions-jobs-list [-p ]... [-o ] + regions-jobs-patch (-r )... [-p ]... [-o ] regions-jobs-submit (-r )... [-p ]... [-o ] regions-operations-cancel [-p ]... [-o ] regions-operations-delete [-p ]... [-o ] diff --git a/gen/dataproc1-cli/mkdocs.yml b/gen/dataproc1-cli/mkdocs.yml index 95416ebe51..0dd5618022 100644 --- a/gen/dataproc1-cli/mkdocs.yml +++ b/gen/dataproc1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dataproc v1.0.4+20161102 +site_name: dataproc v1.0.4+20170515 site_url: http://byron.github.io/google-apis-rs/google-dataproc1-cli site_description: A complete library to interact with dataproc (protocol v1) @@ -19,6 +19,7 @@ pages: - ['projects_regions-jobs-delete.md', 'Projects', 'Regions Jobs Delete'] - ['projects_regions-jobs-get.md', 'Projects', 'Regions Jobs Get'] - ['projects_regions-jobs-list.md', 'Projects', 'Regions Jobs List'] +- ['projects_regions-jobs-patch.md', 'Projects', 'Regions Jobs Patch'] - ['projects_regions-jobs-submit.md', 'Projects', 'Regions Jobs Submit'] - ['projects_regions-operations-cancel.md', 'Projects', 'Regions Operations Cancel'] - ['projects_regions-operations-delete.md', 'Projects', 'Regions Operations Delete'] diff --git a/gen/dataproc1-cli/src/main.rs b/gen/dataproc1-cli/src/main.rs index cf31bf6ae2..868d7bab95 100644 --- a/gen/dataproc1-cli/src/main.rs +++ b/gen/dataproc1-cli/src/main.rs @@ -72,6 +72,7 @@ impl<'n> Engine<'n> { "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 })), "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 })), @@ -84,39 +85,40 @@ impl<'n> Engine<'n> { "config.gce-cluster-config.internal-ip-only" => Some(("config.gceClusterConfig.internalIpOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.gce-cluster-config.network-uri" => Some(("config.gceClusterConfig.networkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.tags" => Some(("config.gceClusterConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.gce-cluster-config.service-account" => Some(("config.gceClusterConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.zone-uri" => Some(("config.gceClusterConfig.zoneUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.subnetwork-uri" => Some(("config.gceClusterConfig.subnetworkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.service-account-scopes" => Some(("config.gceClusterConfig.serviceAccountScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.gce-cluster-config.metadata" => Some(("config.gceClusterConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "config.worker-config.is-preemptible" => Some(("config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.worker-config.num-instances" => Some(("config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.worker-config.machine-type-uri" => Some(("config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.instance-names" => Some(("config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.worker-config.disk-config.num-local-ssds" => Some(("config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.worker-config.disk-config.boot-disk-size-gb" => Some(("config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-template-name" => Some(("config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-group-manager-name" => Some(("config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.worker-config.num-instances" => Some(("config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.worker-config.is-preemptible" => Some(("config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.worker-config.image-uri" => Some(("config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.secondary-worker-config.is-preemptible" => Some(("config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.secondary-worker-config.num-instances" => Some(("config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.machine-type-uri" => Some(("config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.instance-names" => Some(("config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.secondary-worker-config.disk-config.num-local-ssds" => Some(("config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.secondary-worker-config.num-instances" => Some(("config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.secondary-worker-config.is-preemptible" => Some(("config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.secondary-worker-config.image-uri" => Some(("config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.master-config.is-preemptible" => Some(("config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.master-config.num-instances" => Some(("config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.machine-type-uri" => Some(("config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.instance-names" => Some(("config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.master-config.disk-config.num-local-ssds" => Some(("config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.disk-config.boot-disk-size-gb" => Some(("config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-template-name" => Some(("config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-group-manager-name" => Some(("config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.master-config.num-instances" => Some(("config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.master-config.is-preemptible" => Some(("config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.master-config.image-uri" => Some(("config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "cluster-name", "cluster-uuid", "config", "config-bucket", "detail", "disk-config", "gce-cluster-config", "hdfs-metrics", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "labels", "machine-type-uri", "managed-group-config", "master-config", "metadata", "metrics", "network-uri", "num-instances", "num-local-ssds", "project-id", "properties", "secondary-worker-config", "service-account-scopes", "software-config", "state", "state-start-time", "status", "subnetwork-uri", "tags", "worker-config", "yarn-metrics", "zone-uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "cluster-name", "cluster-uuid", "config", "config-bucket", "detail", "disk-config", "gce-cluster-config", "hdfs-metrics", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "labels", "machine-type-uri", "managed-group-config", "master-config", "metadata", "metrics", "network-uri", "num-instances", "num-local-ssds", "project-id", "properties", "secondary-worker-config", "service-account", "service-account-scopes", "software-config", "state", "state-start-time", "status", "subnetwork-uri", "substate", "tags", "worker-config", "yarn-metrics", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -452,6 +454,7 @@ impl<'n> Engine<'n> { "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 })), "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 })), @@ -464,39 +467,40 @@ impl<'n> Engine<'n> { "config.gce-cluster-config.internal-ip-only" => Some(("config.gceClusterConfig.internalIpOnly", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.gce-cluster-config.network-uri" => Some(("config.gceClusterConfig.networkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.tags" => Some(("config.gceClusterConfig.tags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "config.gce-cluster-config.service-account" => Some(("config.gceClusterConfig.serviceAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.zone-uri" => Some(("config.gceClusterConfig.zoneUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.subnetwork-uri" => Some(("config.gceClusterConfig.subnetworkUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.gce-cluster-config.service-account-scopes" => Some(("config.gceClusterConfig.serviceAccountScopes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.gce-cluster-config.metadata" => Some(("config.gceClusterConfig.metadata", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "config.worker-config.is-preemptible" => Some(("config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.worker-config.num-instances" => Some(("config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.worker-config.machine-type-uri" => Some(("config.workerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.instance-names" => Some(("config.workerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.worker-config.disk-config.num-local-ssds" => Some(("config.workerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.worker-config.disk-config.boot-disk-size-gb" => Some(("config.workerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-template-name" => Some(("config.workerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.worker-config.managed-group-config.instance-group-manager-name" => Some(("config.workerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.worker-config.num-instances" => Some(("config.workerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.worker-config.is-preemptible" => Some(("config.workerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.worker-config.image-uri" => Some(("config.workerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.secondary-worker-config.is-preemptible" => Some(("config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.secondary-worker-config.num-instances" => Some(("config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.machine-type-uri" => Some(("config.secondaryWorkerConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.instance-names" => Some(("config.secondaryWorkerConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.secondary-worker-config.disk-config.num-local-ssds" => Some(("config.secondaryWorkerConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.disk-config.boot-disk-size-gb" => Some(("config.secondaryWorkerConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-template-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.secondary-worker-config.managed-group-config.instance-group-manager-name" => Some(("config.secondaryWorkerConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.secondary-worker-config.num-instances" => Some(("config.secondaryWorkerConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.secondary-worker-config.is-preemptible" => Some(("config.secondaryWorkerConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.secondary-worker-config.image-uri" => Some(("config.secondaryWorkerConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.master-config.is-preemptible" => Some(("config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "config.master-config.num-instances" => Some(("config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.machine-type-uri" => Some(("config.masterConfig.machineTypeUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.instance-names" => Some(("config.masterConfig.instanceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "config.master-config.disk-config.num-local-ssds" => Some(("config.masterConfig.diskConfig.numLocalSsds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.disk-config.boot-disk-size-gb" => Some(("config.masterConfig.diskConfig.bootDiskSizeGb", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-template-name" => Some(("config.masterConfig.managedGroupConfig.instanceTemplateName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "config.master-config.managed-group-config.instance-group-manager-name" => Some(("config.masterConfig.managedGroupConfig.instanceGroupManagerName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "config.master-config.num-instances" => Some(("config.masterConfig.numInstances", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "config.master-config.is-preemptible" => Some(("config.masterConfig.isPreemptible", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "config.master-config.image-uri" => Some(("config.masterConfig.imageUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "cluster-name", "cluster-uuid", "config", "config-bucket", "detail", "disk-config", "gce-cluster-config", "hdfs-metrics", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "labels", "machine-type-uri", "managed-group-config", "master-config", "metadata", "metrics", "network-uri", "num-instances", "num-local-ssds", "project-id", "properties", "secondary-worker-config", "service-account-scopes", "software-config", "state", "state-start-time", "status", "subnetwork-uri", "tags", "worker-config", "yarn-metrics", "zone-uri"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["boot-disk-size-gb", "cluster-name", "cluster-uuid", "config", "config-bucket", "detail", "disk-config", "gce-cluster-config", "hdfs-metrics", "image-uri", "image-version", "instance-group-manager-name", "instance-names", "instance-template-name", "internal-ip-only", "is-preemptible", "labels", "machine-type-uri", "managed-group-config", "master-config", "metadata", "metrics", "network-uri", "num-instances", "num-local-ssds", "project-id", "properties", "secondary-worker-config", "service-account", "service-account-scopes", "software-config", "state", "state-start-time", "status", "subnetwork-uri", "substate", "tags", "worker-config", "yarn-metrics", "zone-uri"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -816,6 +820,149 @@ impl<'n> Engine<'n> { } } + fn _projects_regions_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()[..] { + "status.state" => Some(("status.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.state-start-time" => Some(("status.stateStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.details" => Some(("status.details", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "status.substate" => Some(("status.substate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spark-sql-job.query-file-uri" => Some(("sparkSqlJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spark-sql-job.script-variables" => Some(("sparkSqlJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spark-sql-job.logging-config.driver-log-levels" => Some(("sparkSqlJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spark-sql-job.jar-file-uris" => Some(("sparkSqlJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spark-sql-job.query-list.queries" => Some(("sparkSqlJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spark-sql-job.properties" => Some(("sparkSqlJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "pig-job.query-file-uri" => Some(("pigJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pig-job.script-variables" => Some(("pigJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "pig-job.logging-config.driver-log-levels" => Some(("pigJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "pig-job.jar-file-uris" => Some(("pigJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "pig-job.query-list.queries" => Some(("pigJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "pig-job.continue-on-failure" => Some(("pigJob.continueOnFailure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "pig-job.properties" => Some(("pigJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "placement.cluster-name" => Some(("placement.clusterName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "placement.cluster-uuid" => Some(("placement.clusterUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference.project-id" => Some(("reference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference.job-id" => Some(("reference.jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hadoop-job.args" => Some(("hadoopJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "hadoop-job.logging-config.driver-log-levels" => Some(("hadoopJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "hadoop-job.jar-file-uris" => Some(("hadoopJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "hadoop-job.file-uris" => Some(("hadoopJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "hadoop-job.main-class" => Some(("hadoopJob.mainClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hadoop-job.archive-uris" => Some(("hadoopJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "hadoop-job.main-jar-file-uri" => Some(("hadoopJob.mainJarFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hadoop-job.properties" => Some(("hadoopJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "driver-output-resource-uri" => Some(("driverOutputResourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "driver-control-files-uri" => Some(("driverControlFilesUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spark-job.args" => Some(("sparkJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spark-job.logging-config.driver-log-levels" => Some(("sparkJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "spark-job.jar-file-uris" => Some(("sparkJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spark-job.file-uris" => Some(("sparkJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spark-job.main-class" => Some(("sparkJob.mainClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spark-job.archive-uris" => Some(("sparkJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "spark-job.main-jar-file-uri" => Some(("sparkJob.mainJarFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "spark-job.properties" => Some(("sparkJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "scheduling.max-failures-per-hour" => Some(("scheduling.maxFailuresPerHour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "pyspark-job.main-python-file-uri" => Some(("pysparkJob.mainPythonFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pyspark-job.args" => Some(("pysparkJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "pyspark-job.logging-config.driver-log-levels" => Some(("pysparkJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "pyspark-job.jar-file-uris" => Some(("pysparkJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "pyspark-job.file-uris" => Some(("pysparkJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "pyspark-job.archive-uris" => Some(("pysparkJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "pyspark-job.python-file-uris" => Some(("pysparkJob.pythonFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "pyspark-job.properties" => Some(("pysparkJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "hive-job.query-file-uri" => Some(("hiveJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "hive-job.script-variables" => Some(("hiveJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "hive-job.jar-file-uris" => Some(("hiveJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "hive-job.query-list.queries" => Some(("hiveJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "hive-job.continue-on-failure" => Some(("hiveJob.continueOnFailure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "hive-job.properties" => Some(("hiveJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["archive-uris", "args", "cluster-name", "cluster-uuid", "continue-on-failure", "details", "driver-control-files-uri", "driver-log-levels", "driver-output-resource-uri", "file-uris", "hadoop-job", "hive-job", "jar-file-uris", "job-id", "labels", "logging-config", "main-class", "main-jar-file-uri", "main-python-file-uri", "max-failures-per-hour", "pig-job", "placement", "project-id", "properties", "pyspark-job", "python-file-uris", "queries", "query-file-uri", "query-list", "reference", "scheduling", "script-variables", "spark-job", "spark-sql-job", "state", "state-start-time", "status", "substate"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Job = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().regions_jobs_patch(request, opt.value_of("project-id").unwrap_or(""), opt.value_of("region").unwrap_or(""), opt.value_of("job-id").unwrap_or("")); + for parg in 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_regions_jobs_submit(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -842,14 +989,13 @@ impl<'n> Engine<'n> { "job.status.state" => Some(("job.status.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.status.state-start-time" => Some(("job.status.stateStartTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.status.details" => Some(("job.status.details", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job.hadoop-job.args" => Some(("job.hadoopJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "job.hadoop-job.logging-config.driver-log-levels" => Some(("job.hadoopJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "job.hadoop-job.jar-file-uris" => Some(("job.hadoopJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "job.hadoop-job.file-uris" => Some(("job.hadoopJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "job.hadoop-job.main-class" => Some(("job.hadoopJob.mainClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job.hadoop-job.archive-uris" => Some(("job.hadoopJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "job.hadoop-job.main-jar-file-uri" => Some(("job.hadoopJob.mainJarFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job.hadoop-job.properties" => Some(("job.hadoopJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.status.substate" => Some(("job.status.substate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.spark-sql-job.query-file-uri" => Some(("job.sparkSqlJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.spark-sql-job.script-variables" => Some(("job.sparkSqlJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.spark-sql-job.logging-config.driver-log-levels" => Some(("job.sparkSqlJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.spark-sql-job.jar-file-uris" => Some(("job.sparkSqlJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-sql-job.query-list.queries" => Some(("job.sparkSqlJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.spark-sql-job.properties" => Some(("job.sparkSqlJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "job.pig-job.query-file-uri" => Some(("job.pigJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.pig-job.script-variables" => Some(("job.pigJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "job.pig-job.logging-config.driver-log-levels" => Some(("job.pigJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -861,12 +1007,14 @@ impl<'n> Engine<'n> { "job.placement.cluster-uuid" => Some(("job.placement.clusterUuid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.reference.project-id" => Some(("job.reference.projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.reference.job-id" => Some(("job.reference.jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job.spark-sql-job.query-file-uri" => Some(("job.sparkSqlJob.queryFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job.spark-sql-job.script-variables" => Some(("job.sparkSqlJob.scriptVariables", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "job.spark-sql-job.logging-config.driver-log-levels" => Some(("job.sparkSqlJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), - "job.spark-sql-job.jar-file-uris" => Some(("job.sparkSqlJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "job.spark-sql-job.query-list.queries" => Some(("job.sparkSqlJob.queryList.queries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "job.spark-sql-job.properties" => Some(("job.sparkSqlJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.hadoop-job.args" => Some(("job.hadoopJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.hadoop-job.logging-config.driver-log-levels" => Some(("job.hadoopJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.hadoop-job.jar-file-uris" => Some(("job.hadoopJob.jarFileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.hadoop-job.file-uris" => Some(("job.hadoopJob.fileUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.hadoop-job.main-class" => Some(("job.hadoopJob.mainClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.hadoop-job.archive-uris" => Some(("job.hadoopJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "job.hadoop-job.main-jar-file-uri" => Some(("job.hadoopJob.mainJarFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job.hadoop-job.properties" => Some(("job.hadoopJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "job.labels" => Some(("job.labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "job.driver-output-resource-uri" => Some(("job.driverOutputResourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.driver-control-files-uri" => Some(("job.driverControlFilesUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -878,6 +1026,7 @@ impl<'n> Engine<'n> { "job.spark-job.archive-uris" => Some(("job.sparkJob.archiveUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "job.spark-job.main-jar-file-uri" => Some(("job.sparkJob.mainJarFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.spark-job.properties" => Some(("job.sparkJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "job.scheduling.max-failures-per-hour" => Some(("job.scheduling.maxFailuresPerHour", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "job.pyspark-job.main-python-file-uri" => Some(("job.pysparkJob.mainPythonFileUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "job.pyspark-job.args" => Some(("job.pysparkJob.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "job.pyspark-job.logging-config.driver-log-levels" => Some(("job.pysparkJob.loggingConfig.driverLogLevels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), @@ -893,7 +1042,7 @@ impl<'n> Engine<'n> { "job.hive-job.continue-on-failure" => Some(("job.hiveJob.continueOnFailure", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "job.hive-job.properties" => Some(("job.hiveJob.properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["archive-uris", "args", "cluster-name", "cluster-uuid", "continue-on-failure", "details", "driver-control-files-uri", "driver-log-levels", "driver-output-resource-uri", "file-uris", "hadoop-job", "hive-job", "jar-file-uris", "job", "job-id", "labels", "logging-config", "main-class", "main-jar-file-uri", "main-python-file-uri", "pig-job", "placement", "project-id", "properties", "pyspark-job", "python-file-uris", "queries", "query-file-uri", "query-list", "reference", "script-variables", "spark-job", "spark-sql-job", "state", "state-start-time", "status"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["archive-uris", "args", "cluster-name", "cluster-uuid", "continue-on-failure", "details", "driver-control-files-uri", "driver-log-levels", "driver-output-resource-uri", "file-uris", "hadoop-job", "hive-job", "jar-file-uris", "job", "job-id", "labels", "logging-config", "main-class", "main-jar-file-uri", "main-python-file-uri", "max-failures-per-hour", "pig-job", "placement", "project-id", "properties", "pyspark-job", "python-file-uris", "queries", "query-file-uri", "query-list", "reference", "scheduling", "script-variables", "spark-job", "spark-sql-job", "state", "state-start-time", "status", "substate"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1208,6 +1357,9 @@ impl<'n> Engine<'n> { ("regions-jobs-list", Some(opt)) => { call_result = self._projects_regions_jobs_list(opt, dry_run, &mut err); }, + ("regions-jobs-patch", Some(opt)) => { + call_result = self._projects_regions_jobs_patch(opt, dry_run, &mut err); + }, ("regions-jobs-submit", Some(opt)) => { call_result = self._projects_regions_jobs_submit(opt, dry_run, &mut err); }, @@ -1315,20 +1467,20 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'regions-clusters-create', 'regions-clusters-delete', 'regions-clusters-diagnose', 'regions-clusters-get', 'regions-clusters-list', 'regions-clusters-patch', 'regions-jobs-cancel', 'regions-jobs-delete', 'regions-jobs-get', 'regions-jobs-list', 'regions-jobs-submit', 'regions-operations-cancel', 'regions-operations-delete', 'regions-operations-get' and 'regions-operations-list'", vec![ + ("projects", "methods: 'regions-clusters-create', 'regions-clusters-delete', 'regions-clusters-diagnose', 'regions-clusters-get', 'regions-clusters-list', 'regions-clusters-patch', 'regions-jobs-cancel', 'regions-jobs-delete', 'regions-jobs-get', 'regions-jobs-list', 'regions-jobs-patch', 'regions-jobs-submit', 'regions-operations-cancel', 'regions-operations-delete', 'regions-operations-get' and 'regions-operations-list'", vec![ ("regions-clusters-create", Some(r##"Creates a cluster in a project."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-clusters-create", vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project that the cluster belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project that the cluster belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -1356,19 +1508,19 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project that the cluster belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project that the cluster belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), (Some(r##"cluster-name"##), None, - Some(r##"[Required] The cluster name."##), + Some(r##"Required. The cluster name."##), Some(true), Some(false)), @@ -1385,24 +1537,24 @@ fn main() { Some(false)), ]), ("regions-clusters-diagnose", - Some(r##"Gets cluster diagnostic information. After the operation completes, the Operation.response field contains `DiagnoseClusterOutputLocation`."##), + Some(r##"Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-clusters-diagnose", vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project that the cluster belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project that the cluster belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), (Some(r##"cluster-name"##), None, - Some(r##"[Required] The cluster name."##), + Some(r##"Required. The cluster name."##), Some(true), Some(false)), @@ -1430,19 +1582,19 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project that the cluster belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project that the cluster belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), (Some(r##"cluster-name"##), None, - Some(r##"[Required] The cluster name."##), + Some(r##"Required. The cluster name."##), Some(true), Some(false)), @@ -1464,13 +1616,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project that the cluster belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project that the cluster belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -1492,19 +1644,19 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project the cluster belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project the cluster belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), (Some(r##"cluster-name"##), None, - Some(r##"[Required] The cluster name."##), + Some(r##"Required. The cluster name."##), Some(true), Some(false)), @@ -1527,24 +1679,24 @@ fn main() { Some(false)), ]), ("regions-jobs-cancel", - Some(r##"Starts a job cancellation request. To access the job resource after cancellation, call [regions/{region}/jobs.list](/dataproc/reference/rest/v1/projects.regions.jobs/list) or [regions/{region}/jobs.get](/dataproc/reference/rest/v1/projects.regions.jobs/get)."##), + Some(r##"Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-jobs-cancel", vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project that the job belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project that the job belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), (Some(r##"job-id"##), None, - Some(r##"[Required] The job ID."##), + Some(r##"Required. The job ID."##), Some(true), Some(false)), @@ -1567,24 +1719,24 @@ fn main() { Some(false)), ]), ("regions-jobs-delete", - Some(r##"Deletes the job from the project. If the job is active, the delete fails, and the response returns `FAILED_PRECONDITION`."##), + Some(r##"Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-jobs-delete", vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project that the job belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project that the job belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), (Some(r##"job-id"##), None, - Some(r##"[Required] The job ID."##), + Some(r##"Required. The job ID."##), Some(true), Some(false)), @@ -1606,19 +1758,19 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project that the job belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project that the job belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), (Some(r##"job-id"##), None, - Some(r##"[Required] The job ID."##), + Some(r##"Required. The job ID."##), Some(true), Some(false)), @@ -1640,13 +1792,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project that the job belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project that the job belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -1656,6 +1808,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)), + ]), + ("regions-jobs-patch", + Some(r##"Updates a job in a project."##), + "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-jobs-patch", + vec![ + (Some(r##"project-id"##), + None, + Some(r##"Required. The ID of the Google Cloud Platform project that the job belongs to."##), + Some(true), + Some(false)), + + (Some(r##"region"##), + None, + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), + Some(true), + Some(false)), + + (Some(r##"job-id"##), + None, + Some(r##"Required. The job 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"##), @@ -1668,13 +1860,13 @@ fn main() { vec![ (Some(r##"project-id"##), None, - Some(r##"[Required] The ID of the Google Cloud Platform project that the job belongs to."##), + Some(r##"Required. The ID of the Google Cloud Platform project that the job belongs to."##), Some(true), Some(false)), (Some(r##"region"##), None, - Some(r##"[Required] The Cloud Dataproc region in which to handle the request."##), + Some(r##"Required. The Cloud Dataproc region in which to handle the request."##), Some(true), Some(false)), @@ -1697,7 +1889,7 @@ fn main() { Some(false)), ]), ("regions-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`."##), + 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_dataproc1_cli/projects_regions-operations-cancel", vec![ (Some(r##"name"##), @@ -1719,7 +1911,7 @@ fn main() { Some(false)), ]), ("regions-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`."##), + 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_dataproc1_cli/projects_regions-operations-delete", vec![ (Some(r##"name"##), @@ -1763,7 +1955,7 @@ fn main() { Some(false)), ]), ("regions-operations-list", - Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`."##), + Some(r##"Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations."##), "Details at http://byron.github.io/google-apis-rs/google_dataproc1_cli/projects_regions-operations-list", vec![ (Some(r##"name"##), @@ -1790,8 +1982,8 @@ fn main() { let mut app = App::new("dataproc1") .author("Sebastian Thiel ") - .version("1.0.4+20161102") - .about("An API for managing Hadoop-based clusters and jobs on Google Cloud Platform.") + .version("1.0.4+20170515") + .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") .long("scope") diff --git a/gen/dataproc1/Cargo.toml b/gen/dataproc1/Cargo.toml index 890a85041b..3cb8fb3ab3 100644 --- a/gen/dataproc1/Cargo.toml +++ b/gen/dataproc1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dataproc1" -version = "1.0.4+20161102" +version = "1.0.4+20170515" 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.4+20161102" +documentation = "https://docs.rs/google-dataproc1/1.0.4+20170515" license = "MIT" keywords = ["dataproc", "google", "protocol", "web", "api"] diff --git a/gen/dataproc1/README.md b/gen/dataproc1/README.md index 3dd69e6351..b42f852737 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.4+20161102*, where *20161102* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *dataproc* crate version *1.0.4+20170515*, where *20170515* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161102/google_dataproc1/struct.Dataproc.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.Dataproc.html) ... * projects - * [*regions clusters create*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionClusterGetCall.html), [*regions clusters list*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionClusterPatchCall.html), [*regions jobs cancel*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionJobGetCall.html), [*regions jobs list*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionJobListCall.html), [*regions jobs submit*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionJobSubmitCall.html), [*regions operations cancel*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionOperationGetCall.html) and [*regions operations list*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/struct.ProjectRegionOperationListCall.html) + * [*regions clusters create*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionClusterGetCall.html), [*regions clusters list*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionClusterPatchCall.html), [*regions jobs cancel*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionJobGetCall.html), [*regions jobs list*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionJobListCall.html), [*regions jobs patch*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionJobPatchCall.html), [*regions jobs submit*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionJobSubmitCall.html), [*regions operations cancel*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/struct.ProjectRegionOperationGetCall.html) and [*regions operations list*](https://docs.rs/google-dataproc1/1.0.4+20170515/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.4+20161102/google_dataproc1/struct.Dataproc.html)** +* **[Hub](https://docs.rs/google-dataproc1/1.0.4+20170515/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.4+20161102/google_dataproc1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dataproc1/1.0.4+20170515/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.4+20161102/google_dataproc1/trait.Part.html)** + * **[Parts](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dataproc1/1.0.4+20161102/google_dataproc1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dataproc1/1.0.4+20170515/google_dataproc1/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-dataproc1/1.0.4+20161102/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.4+20170515/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.4+20161102/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.4+20170515/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.4+20161102/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.4+20170515/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.4+20161102/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.4+20170515/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")`. @@ -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-dataproc1/1.0.4+20161102/google_dataproc1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dataproc1/1.0.4+20161102/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.4+20170515/google_dataproc1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dataproc1/1.0.4+20170515/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.4+20161102/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.4+20170515/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.4+20161102/google_dataproc1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dataproc1/1.0.4+20161102/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.4+20170515/google_dataproc1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dataproc1/1.0.4+20170515/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.4+20161102/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.4+20170515/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.4+20161102/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.4+20170515/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.4+20161102/google_dataproc1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dataproc1/1.0.4+20170515/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 10a20f83b8..788c87617b 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.4+20161102*, where *20161102* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *dataproc* crate version *1.0.4+20170515*, where *20170515* is the exact revision of the *dataproc:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *dataproc* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/dataproc/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Dataproc.html) ... //! //! * projects -//! * [*regions clusters create*](struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](struct.ProjectRegionClusterGetCall.html), [*regions clusters list*](struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](struct.ProjectRegionClusterPatchCall.html), [*regions jobs cancel*](struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](struct.ProjectRegionJobGetCall.html), [*regions jobs list*](struct.ProjectRegionJobListCall.html), [*regions jobs submit*](struct.ProjectRegionJobSubmitCall.html), [*regions operations cancel*](struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](struct.ProjectRegionOperationGetCall.html) and [*regions operations list*](struct.ProjectRegionOperationListCall.html) +//! * [*regions clusters create*](struct.ProjectRegionClusterCreateCall.html), [*regions clusters delete*](struct.ProjectRegionClusterDeleteCall.html), [*regions clusters diagnose*](struct.ProjectRegionClusterDiagnoseCall.html), [*regions clusters get*](struct.ProjectRegionClusterGetCall.html), [*regions clusters list*](struct.ProjectRegionClusterListCall.html), [*regions clusters patch*](struct.ProjectRegionClusterPatchCall.html), [*regions jobs cancel*](struct.ProjectRegionJobCancelCall.html), [*regions jobs delete*](struct.ProjectRegionJobDeleteCall.html), [*regions jobs get*](struct.ProjectRegionJobGetCall.html), [*regions jobs list*](struct.ProjectRegionJobListCall.html), [*regions jobs patch*](struct.ProjectRegionJobPatchCall.html), [*regions jobs submit*](struct.ProjectRegionJobSubmitCall.html), [*regions operations cancel*](struct.ProjectRegionOperationCancelCall.html), [*regions operations delete*](struct.ProjectRegionOperationDeleteCall.html), [*regions operations get*](struct.ProjectRegionOperationGetCall.html) and [*regions operations list*](struct.ProjectRegionOperationListCall.html) //! //! //! @@ -181,7 +181,7 @@ // 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 +// 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)] @@ -313,8 +313,6 @@ pub struct Dataproc { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Dataproc {} @@ -327,8 +325,6 @@ impl<'a, C, A> Dataproc client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://dataproc.googleapis.com/".to_string(), - _root_url: "https://dataproc.googleapis.com/".to_string(), } } @@ -345,33 +341,13 @@ impl<'a, C, A> Dataproc self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://dataproc.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://dataproc.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// A Cloud Dataproc job for running [Apache Spark SQL](http://spark.apache.org/sql/) queries. +/// A Cloud Dataproc job for running Apache Spark SQL (http://spark.apache.org/sql/) queries. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -380,50 +356,66 @@ pub struct SparkSqlJob { /// The HCFS URI of the script that contains SQL queries. #[serde(rename="queryFileUri")] pub query_file_uri: Option, - /// [Optional] Mapping of query variable names to values (equivalent to the Spark SQL command: SET `name="value";`). + /// Optional. Mapping of query variable names to values (equivalent to the Spark SQL command: SET name="value";). #[serde(rename="scriptVariables")] pub script_variables: Option>, - /// [Optional] The runtime log config for job execution. + /// Optional. The runtime log config for job execution. #[serde(rename="loggingConfig")] pub logging_config: Option, - /// [Optional] HCFS URIs of jar files to be added to the Spark CLASSPATH. + /// Optional. HCFS URIs of jar files to be added to the Spark CLASSPATH. #[serde(rename="jarFileUris")] pub jar_file_uris: Option>, /// A list of queries. #[serde(rename="queryList")] pub query_list: Option, - /// [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. + /// 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. pub properties: Option>, } impl Part for SparkSqlJob {} -/// [Optional] The config settings for Google Compute Engine resources in an instance group, such as a master or worker group. +/// Job scheduling options.Beta Feature: These options are available for testing purposes only. They may be changed before final release. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct JobScheduling { + /// 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. + #[serde(rename="maxFailuresPerHour")] + pub max_failures_per_hour: Option, +} + +impl Part for JobScheduling {} + + +/// Optional. The config settings for Google Compute Engine resources in an instance group, such as a master or worker 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 InstanceGroupConfig { - /// [Required] The number of VM instances in the instance group. For master instance groups, must be set to 1. - #[serde(rename="numInstances")] - pub num_instances: Option, - /// [Optional] Specifies that this instance group contains preemptible instances. + /// Optional. Specifies that this instance group contains preemptible instances. #[serde(rename="isPreemptible")] pub is_preemptible: Option, - /// [Output-only] The config for Google Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups. - #[serde(rename="managedGroupConfig")] - pub managed_group_config: Option, - /// [Required] The Google Compute Engine machine type used for cluster instances. Example: `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2`. + /// Required. The Google Compute Engine machine type used for cluster instances. Example: https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2. #[serde(rename="machineTypeUri")] pub machine_type_uri: Option, - /// [Optional] Disk option config settings. - #[serde(rename="diskConfig")] - pub disk_config: Option, - /// [Optional] The list of instance names. Cloud Dataproc derives the names from `cluster_name`, `num_instances`, and the instance group if not set by user (recommended practice is to let Cloud Dataproc derive the name). + /// Optional. The list of instance names. Cloud Dataproc derives the names from cluster_name, num_instances, and the instance group if not set by user (recommended practice is to let Cloud Dataproc derive the name). #[serde(rename="instanceNames")] pub instance_names: Option>, - /// [Output-only] The Google Compute Engine image resource used for cluster instances. Inferred from `SoftwareConfig.image_version`. + /// Optional. Disk option config settings. + #[serde(rename="diskConfig")] + pub disk_config: Option, + /// Optional. The Google Compute Engine accelerator configuration for these instances.Beta Feature: This feature is still under development. It may be changed before final release. + pub accelerators: Option>, + /// Output-only. The config for Google Compute Engine Instance Group Manager that manages this group. This is only used for preemptible instance groups. + #[serde(rename="managedGroupConfig")] + pub managed_group_config: Option, + /// Required. The number of VM instances in the instance group. For master instance groups, must be set to 1. + #[serde(rename="numInstances")] + pub num_instances: Option, + /// Output-only. The Google Compute Engine image resource used for cluster instances. Inferred from SoftwareConfig.image_version. #[serde(rename="imageUri")] pub image_uri: Option, } @@ -431,19 +423,19 @@ pub struct InstanceGroupConfig { impl Part for InstanceGroupConfig {} -/// A YARN application created by a job. Application information is a subset of org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto. **Beta Feature**: This report is available for testing purposes only. It may be changed before final release. +/// A YARN application created by a job. Application information is a subset of org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto.Beta Feature: This report is available for testing purposes only. It may be changed before final release. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct YarnApplication { - /// [Required] The numerical progress of the application, from 1 to 100. + /// Required. The numerical progress of the application, from 1 to 100. pub progress: Option, - /// [Required] The application state. + /// Required. The application state. pub state: Option, - /// [Required] The application name. + /// Required. The application name. pub name: Option, - /// [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. + /// 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. #[serde(rename="trackingUrl")] pub tracking_url: Option, } @@ -451,7 +443,11 @@ pub struct YarnApplication { impl Part for YarnApplication {} -/// 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 `{}`. +/// 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 /// @@ -468,7 +464,14 @@ 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` which can be used for common error conditions. # Language mapping The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and the `Status` message can be used in a variety of environments, either with or without APIs, to provide 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 purpose. - Batch operations. If a client uses batch request and batch response, the `Status` message should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the `Status` message. - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any stripping needed for security/privacy reasons. +/// 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. /// @@ -485,21 +488,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 512 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. @@ -508,55 +508,91 @@ impl Part for JobReference {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GceClusterConfig { - /// [Optional] If true, all instances in the cluster will only have internal IP addresses. By default, clusters are not restricted to internal IP addresses, and will have ephemeral external IP addresses assigned to each instance. This `internal_ip_only` restriction can only be enabled for subnetwork enabled networks, and all off-cluster dependencies must be configured to be accessible without external IP addresses. + /// Optional. If true, all instances in the cluster will only have internal IP addresses. By default, clusters are not restricted to internal IP addresses, and will have ephemeral external IP addresses assigned to each instance. This internal_ip_only restriction can only be enabled for subnetwork enabled networks, and all off-cluster dependencies must be configured to be accessible without external IP addresses. #[serde(rename="internalIpOnly")] pub internal_ip_only: Option, - /// [Optional] The Google Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither `network_uri` nor `subnetwork_uri` is specified, the "default" network of the project is used, if it exists. Cannot be a "Custom Subnet Network" (see [Using Subnetworks](/compute/docs/subnetworks) for more information). Example: `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default`. + /// Optional. The Google Compute Engine network to be used for machine communications. Cannot be specified with subnetwork_uri. If neither network_uri nor subnetwork_uri is specified, the "default" network of the project is used, if it exists. Cannot be a "Custom Subnet Network" (see Using Subnetworks for more information). Example: https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default. #[serde(rename="networkUri")] pub network_uri: Option, - /// [Optional] The Google Compute Engine subnetwork to be used for machine communications. Cannot be specified with network_uri. Example: `https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0`. - #[serde(rename="subnetworkUri")] - pub subnetwork_uri: Option, - /// [Optional] The URIs of service account scopes to be included in Google Compute Engine instances. The following base set of scopes is always included: * https://www.googleapis.com/auth/cloud.useraccounts.readonly * https://www.googleapis.com/auth/devstorage.read_write * https://www.googleapis.com/auth/logging.write If no scopes are specified, the following defaults are also provided: * https://www.googleapis.com/auth/bigquery * https://www.googleapis.com/auth/bigtable.admin.table * https://www.googleapis.com/auth/bigtable.data * https://www.googleapis.com/auth/devstorage.full_control - #[serde(rename="serviceAccountScopes")] - pub service_account_scopes: Option>, - /// The Google Compute Engine tags to add to all instances (see [Tagging instances](/compute/docs/label-or-tag-resources#tags)). + /// The Google Compute Engine tags to add to all instances (see Tagging instances). pub tags: Option>, - /// 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)). - pub metadata: Option>, - /// [Required] The zone where the Google Compute Engine cluster will be located. Example: `https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]`. + /// Optional. The 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: + /// roles/logging.logWriter + /// roles/storage.objectAdmin(see https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example: [account_id]@[project_id].iam.gserviceaccount.com + #[serde(rename="serviceAccount")] + pub service_account: Option, + /// Required. The zone where the Google Compute Engine cluster will be located. Example: https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone]. #[serde(rename="zoneUri")] pub zone_uri: Option, + /// Optional. The Google Compute Engine subnetwork to be used for machine communications. Cannot be specified with network_uri. Example: https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/sub0. + #[serde(rename="subnetworkUri")] + pub subnetwork_uri: Option, + /// Optional. The URIs of service account scopes to be included in Google Compute Engine instances. The following base set of scopes is always included: + /// https://www.googleapis.com/auth/cloud.useraccounts.readonly + /// https://www.googleapis.com/auth/devstorage.read_write + /// https://www.googleapis.com/auth/logging.writeIf no scopes are specified, the following defaults are also provided: + /// https://www.googleapis.com/auth/bigquery + /// https://www.googleapis.com/auth/bigtable.admin.table + /// https://www.googleapis.com/auth/bigtable.data + /// https://www.googleapis.com/auth/devstorage.full_control + #[serde(rename="serviceAccountScopes")] + pub service_account_scopes: Option>, + /// 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)). + pub metadata: Option>, } impl Part for GceClusterConfig {} +/// Specifies the type and number of accelerator cards attached to the instances of an instance group (see GPUs on Compute Engine). +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AcceleratorConfig { + /// The number of the accelerator cards of this type exposed to this instance. + #[serde(rename="acceleratorCount")] + pub accelerator_count: Option, + /// Full or partial URI of the accelerator type resource to expose to this instance. See Google Compute Engine AcceleratorTypes( /compute/docs/reference/beta/acceleratorTypes) + #[serde(rename="acceleratorTypeUri")] + pub accelerator_type_uri: Option, +} + +impl Part for AcceleratorConfig {} + + /// The cluster 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 ClusterConfig { - /// [Optional] The config settings for software inside the cluster. + /// Optional. The config settings for software inside the cluster. #[serde(rename="softwareConfig")] pub software_config: Option, - /// [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. + /// 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. #[serde(rename="configBucket")] pub config_bucket: Option, - /// [Required] The shared Google Compute Engine config settings for all instances in a cluster. + /// Required. The shared Google Compute Engine config settings for all instances in a cluster. #[serde(rename="gceClusterConfig")] pub gce_cluster_config: Option, - /// [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`): ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) if [[ "${ROLE}" == 'Master' ]]; then ... master specific actions ... else ... worker specific actions ... fi + /// 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): + /// ROLE=$(curl -H Metadata-Flavor:Google http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) + /// if [[ "${ROLE}" == 'Master' ]]; then + /// ... master specific actions ... + /// else + /// ... worker specific actions ... + /// fi + /// #[serde(rename="initializationActions")] pub initialization_actions: Option>, - /// [Optional] The Google Compute Engine config settings for worker instances in a cluster. + /// Optional. The Google Compute Engine config settings for worker instances in a cluster. #[serde(rename="workerConfig")] pub worker_config: Option, - /// [Optional] The Google Compute Engine config settings for additional worker instances in a cluster. + /// Optional. The Google Compute Engine config settings for additional worker instances in a cluster. #[serde(rename="secondaryWorkerConfig")] pub secondary_worker_config: Option, - /// [Optional] The Google Compute Engine config settings for the master instance in a cluster. + /// Optional. The Google Compute Engine config settings for the master instance in a cluster. #[serde(rename="masterConfig")] pub master_config: Option, } @@ -575,7 +611,7 @@ impl Part for ClusterConfig {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SubmitJobRequest { - /// [Required] The job resource. + /// Required. The job resource. pub job: Option, } @@ -588,7 +624,17 @@ impl RequestValue for SubmitJobRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct QueryList { - /// [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: "hiveJob": { "queryList": { "queries": [ "query1", "query2", "query3;query4", ] } } + /// 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: + /// "hiveJob": { + /// "queryList": { + /// "queries": [ + /// "query1", + /// "query2", + /// "query3;query4", + /// ] + /// } + /// } + /// pub queries: Option>, } @@ -601,10 +647,10 @@ impl Part for QueryList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DiskConfig { - /// [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. + /// 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. #[serde(rename="numLocalSsds")] pub num_local_ssds: Option, - /// [Optional] Size in GB of the boot disk (default is 500GB). + /// Optional. Size in GB of the boot disk (default is 500GB). #[serde(rename="bootDiskSizeGb")] pub boot_disk_size_gb: Option, } @@ -621,50 +667,54 @@ impl Part for DiskConfig {} /// /// * [regions jobs submit projects](struct.ProjectRegionJobSubmitCall.html) (response) /// * [regions jobs get projects](struct.ProjectRegionJobGetCall.html) (response) +/// * [regions jobs patch projects](struct.ProjectRegionJobPatchCall.html) (request|response) /// * [regions jobs cancel projects](struct.ProjectRegionJobCancelCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Job { - /// [Output-only] The job status. Additional application-specific status information may be contained in the type_job and yarn_applications fields. + /// Output-only. The job status. Additional application-specific status information may be contained in the type_job and yarn_applications fields. pub status: Option, - /// Job is a Hadoop job. - #[serde(rename="hadoopJob")] - pub hadoop_job: Option, - /// [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. - pub labels: Option>, - /// [Required] Job information, including how, when, and where to run the job. - pub placement: Option, - /// [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 job_id. - pub reference: Option, /// Job is a SparkSql job. #[serde(rename="sparkSqlJob")] pub spark_sql_job: Option, + /// 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. + pub labels: Option>, + /// Required. Job information, including how, when, and where to run the job. + pub placement: Option, + /// 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 job_id. + pub reference: Option, + /// Job is a Hadoop job. + #[serde(rename="hadoopJob")] + pub hadoop_job: Option, /// Job is a Pig job. #[serde(rename="pigJob")] pub pig_job: Option, - /// [Output-only] A URI pointing to the location of the stdout of the job's driver program. + /// 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`. + /// 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, /// Job is a Spark job. #[serde(rename="sparkJob")] pub spark_job: Option, - /// [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. + /// 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. #[serde(rename="yarnApplications")] pub yarn_applications: Option>, - /// [Output-only] The previous job status. + /// Optional. Job scheduling configuration. + pub scheduling: Option, + /// 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, } +impl RequestValue for Job {} impl ResponseResult for Job {} @@ -674,10 +724,10 @@ impl ResponseResult for Job {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ManagedGroupConfig { - /// [Output-only] The name of the Instance Template used for the Managed Instance Group. + /// Output-only. The name of the Instance Template used for the Managed Instance Group. #[serde(rename="instanceTemplateName")] pub instance_template_name: Option, - /// [Output-only] The name of the Instance Group Manager for this group. + /// Output-only. The name of the Instance Group Manager for this group. #[serde(rename="instanceGroupManagerName")] pub instance_group_manager_name: Option, } @@ -685,33 +735,33 @@ pub struct ManagedGroupConfig { impl Part for ManagedGroupConfig {} -/// A Cloud Dataproc job for running [Apache PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html) applications on YARN. +/// A Cloud Dataproc job for running Apache PySpark (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) applications on YARN. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PySparkJob { - /// [Required] The HCFS URI of the main Python file to use as the driver. Must be a .py file. + /// Required. The HCFS URI of the main Python file to use as the driver. Must be a .py file. #[serde(rename="mainPythonFileUri")] pub main_python_file_uri: Option, - /// [Optional] HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks. + /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Python driver and tasks. #[serde(rename="jarFileUris")] pub jar_file_uris: Option>, - /// [Optional] The runtime log config for job execution. + /// Optional. The runtime log config for job execution. #[serde(rename="loggingConfig")] pub logging_config: Option, - /// [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. + /// 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. pub args: Option>, - /// [Optional] HCFS URIs of files to be copied to the working directory of Python drivers and distributed tasks. Useful for naively parallel tasks. + /// Optional. HCFS URIs of files to be copied to the working directory of Python drivers and distributed tasks. Useful for naively parallel tasks. #[serde(rename="fileUris")] pub file_uris: Option>, - /// [Optional] HCFS URIs of archives to be extracted in the working directory of .jar, .tar, .tar.gz, .tgz, and .zip. + /// Optional. HCFS URIs of archives to be extracted in the working directory of .jar, .tar, .tar.gz, .tgz, and .zip. #[serde(rename="archiveUris")] pub archive_uris: Option>, - /// [Optional] HCFS file URIs of Python files to pass to the PySpark framework. Supported file types: .py, .egg, and .zip. + /// Optional. HCFS file URIs of Python files to pass to the PySpark framework. Supported file types: .py, .egg, and .zip. #[serde(rename="pythonFileUris")] pub python_file_uris: Option>, - /// [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. + /// 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. pub properties: Option>, } @@ -724,10 +774,10 @@ impl Part for PySparkJob {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct NodeInitializationAction { - /// [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. + /// 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. #[serde(rename="executionTimeout")] pub execution_timeout: Option, - /// [Required] Google Cloud Storage URI of executable file. + /// Required. Google Cloud Storage URI of executable file. #[serde(rename="executableFile")] pub executable_file: Option, } @@ -761,10 +811,10 @@ impl RequestValue for DiagnoseClusterRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListClustersResponse { - /// [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. + /// 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. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// [Output-only] The clusters in the project. + /// Output-only. The clusters in the project. pub clusters: Option>, } @@ -782,10 +832,10 @@ impl ResponseResult for ListClustersResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListJobsResponse { - /// [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 ListJobsRequest. + /// 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 ListJobsRequest. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// [Output-only] Jobs list. + /// Output-only. Jobs list. pub jobs: Option>, } @@ -798,13 +848,15 @@ impl ResponseResult for ListJobsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobStatus { - /// [Output-only] A state message specifying the overall job state. + /// Output-only. A state message specifying the overall job state. pub state: Option, - /// [Output-only] The time when this state was entered. + /// Output-only. The time when this state was entered. #[serde(rename="stateStartTime")] pub state_start_time: Option, - /// [Output-only] Optional job state details, such as an error description if the state is ERROR. + /// Output-only. Optional job state details, such as an error description if the state is ERROR. pub details: Option, + /// Output-only. Additional state information, which includes status reported by the agent. + pub substate: Option, } impl Part for JobStatus {} @@ -816,10 +868,10 @@ impl Part for JobStatus {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct JobPlacement { - /// [Required] The name of the cluster where the job will be submitted. + /// Required. The name of the cluster where the job will be submitted. #[serde(rename="clusterName")] pub cluster_name: Option, - /// [Output-only] A cluster UUID generated by the Cloud Dataproc service when the job is submitted. + /// Output-only. A cluster UUID generated by the Cloud Dataproc service when the job is submitted. #[serde(rename="clusterUuid")] pub cluster_uuid: Option, } @@ -827,21 +879,24 @@ 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. +/// 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. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -858,7 +913,7 @@ pub struct ClusterMetrics { impl Part for ClusterMetrics {} -/// A Cloud Dataproc job for running [Apache Hive](https://hive.apache.org/) queries on YARN. +/// A Cloud Dataproc job for running Apache Hive (https://hive.apache.org/) queries on YARN. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -867,52 +922,52 @@ pub struct HiveJob { /// The HCFS URI of the script that contains Hive queries. #[serde(rename="queryFileUri")] pub query_file_uri: Option, - /// [Optional] Mapping of query variable names to values (equivalent to the Hive command: `SET name="value";`). + /// Optional. Mapping of query variable names to values (equivalent to the Hive command: SET name="value";). #[serde(rename="scriptVariables")] pub script_variables: Option>, - /// [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. + /// 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. #[serde(rename="continueOnFailure")] pub continue_on_failure: Option, - /// [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. + /// 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. #[serde(rename="jarFileUris")] pub jar_file_uris: Option>, /// A list of queries. #[serde(rename="queryList")] pub query_list: Option, - /// [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. + /// 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. pub properties: Option>, } impl Part for HiveJob {} -/// 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). +/// 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). /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct HadoopJob { - /// [Optional] Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks. + /// Optional. Jar file URIs to add to the CLASSPATHs of the Hadoop driver and tasks. #[serde(rename="jarFileUris")] pub jar_file_uris: Option>, - /// [Optional] The runtime log config for job execution. + /// Optional. The runtime log config for job execution. #[serde(rename="loggingConfig")] pub logging_config: Option, - /// [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. + /// 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. pub args: Option>, - /// [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. + /// 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. #[serde(rename="fileUris")] pub file_uris: Option>, - /// 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`. + /// 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. #[serde(rename="mainClass")] pub main_class: Option, - /// [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. + /// 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. #[serde(rename="archiveUris")] pub archive_uris: Option>, - /// 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' + /// 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' #[serde(rename="mainJarFileUri")] pub main_jar_file_uri: Option, - /// [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. + /// 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. pub properties: Option>, } @@ -925,10 +980,19 @@ impl Part for HadoopJob {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SoftwareConfig { - /// [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](/dataproc/versioning)). + /// 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). #[serde(rename="imageVersion")] pub image_version: Option, - /// [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: * core: `core-site.xml` * hdfs: `hdfs-site.xml` * mapred: `mapred-site.xml` * yarn: `yarn-site.xml` * hive: `hive-site.xml` * pig: `pig.properties` * spark: `spark-defaults.conf` + /// 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: + /// capacity-scheduler: capacity-scheduler.xml + /// core: core-site.xml + /// distcp: distcp-default.xml + /// hdfs: hdfs-site.xml + /// hive: hive-site.xml + /// mapred: mapred-site.xml + /// pig: pig.properties + /// spark: spark-defaults.conf + /// yarn: yarn-site.xml pub properties: Option>, } @@ -956,7 +1020,7 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// A Cloud Dataproc job for running [Apache Pig](https://pig.apache.org/) queries on YARN. +/// A Cloud Dataproc job for running Apache Pig (https://pig.apache.org/) queries on YARN. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -965,22 +1029,22 @@ pub struct PigJob { /// The HCFS URI of the script that contains the Pig queries. #[serde(rename="queryFileUri")] pub query_file_uri: Option, - /// [Optional] Mapping of query variable names to values (equivalent to the Pig command: `name=[value]`). + /// Optional. Mapping of query variable names to values (equivalent to the Pig command: name=[value]). #[serde(rename="scriptVariables")] pub script_variables: Option>, - /// [Optional] The runtime log config for job execution. + /// Optional. The runtime log config for job execution. #[serde(rename="loggingConfig")] pub logging_config: Option, - /// [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. + /// 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. #[serde(rename="continueOnFailure")] pub continue_on_failure: Option, - /// [Optional] HCFS URIs of jar files to add to the CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. + /// Optional. HCFS URIs of jar files to add to the CLASSPATH of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig UDFs. #[serde(rename="jarFileUris")] pub jar_file_uris: Option>, /// A list of queries. #[serde(rename="queryList")] pub query_list: Option, - /// [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. + /// 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. pub properties: Option>, } @@ -1000,25 +1064,25 @@ impl Part for PigJob {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Cluster { - /// [Output-only] Cluster status. + /// Output-only. Cluster status. pub status: Option, - /// [Output-only] A cluster UUID (Unique Universal Identifier). Cloud Dataproc generates this value when it creates the cluster. + /// Output-only. A cluster UUID (Unique Universal Identifier). Cloud Dataproc generates this value when it creates the cluster. #[serde(rename="clusterUuid")] pub cluster_uuid: Option, - /// [Required] The cluster name. Cluster names within a project must be unique. Names of deleted clusters can be reused. + /// Required. The cluster name. Cluster names within a project must be unique. Names of deleted clusters can be reused. #[serde(rename="clusterName")] pub cluster_name: Option, - /// [Required] The Google Cloud Platform project ID that the cluster belongs to. + /// Required. The Google Cloud Platform project ID that the cluster belongs to. #[serde(rename="projectId")] pub project_id: Option, - /// [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. + /// 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. pub labels: Option>, - /// 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. + /// 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. pub metrics: Option, - /// [Output-only] The previous cluster status. + /// Output-only. The previous cluster status. #[serde(rename="statusHistory")] pub status_history: Option>, - /// [Required] The cluster config. Note that Cloud Dataproc may set default values, and values may change when clusters are updated. + /// Required. The cluster config. Note that Cloud Dataproc may set default values, and values may change when clusters are updated. pub config: Option, } @@ -1026,33 +1090,33 @@ impl RequestValue for Cluster {} impl ResponseResult for Cluster {} -/// A Cloud Dataproc job for running [Apache Spark](http://spark.apache.org/) applications on YARN. +/// A Cloud Dataproc job for running Apache Spark (http://spark.apache.org/) applications on YARN. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SparkJob { - /// [Optional] HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks. + /// Optional. HCFS URIs of jar files to add to the CLASSPATHs of the Spark driver and tasks. #[serde(rename="jarFileUris")] pub jar_file_uris: Option>, - /// [Optional] The runtime log config for job execution. + /// Optional. The runtime log config for job execution. #[serde(rename="loggingConfig")] pub logging_config: Option, - /// [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. + /// 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. pub args: Option>, - /// [Optional] HCFS URIs of files to be copied to the working directory of Spark drivers and distributed tasks. Useful for naively parallel tasks. + /// Optional. HCFS URIs of files to be copied to the working directory of Spark drivers and distributed tasks. Useful for naively parallel tasks. #[serde(rename="fileUris")] pub file_uris: Option>, - /// 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`. + /// 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. #[serde(rename="mainClass")] pub main_class: Option, - /// [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. + /// 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. #[serde(rename="archiveUris")] pub archive_uris: Option>, /// The HCFS URI of the jar file that contains the main class. #[serde(rename="mainJarFileUri")] pub main_jar_file_uri: Option, - /// [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. + /// 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. pub properties: Option>, } @@ -1065,13 +1129,15 @@ impl Part for SparkJob {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ClusterStatus { - /// [Output-only] The cluster's state. + /// Output-only. The cluster's state. pub state: Option, - /// [Output-only] Time when this state was entered. + /// Output-only. Time when this state was entered. #[serde(rename="stateStartTime")] pub state_start_time: Option, - /// [Output-only] Optional details of cluster's state. + /// 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, } impl Part for ClusterStatus {} @@ -1092,16 +1158,16 @@ impl Part for ClusterStatus {} /// #[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, + /// 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 {} @@ -1150,7 +1216,7 @@ impl RequestValue for CancelJobRequest {} /// ::default(), None); /// let mut hub = Dataproc::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `regions_clusters_create(...)`, `regions_clusters_delete(...)`, `regions_clusters_diagnose(...)`, `regions_clusters_get(...)`, `regions_clusters_list(...)`, `regions_clusters_patch(...)`, `regions_jobs_cancel(...)`, `regions_jobs_delete(...)`, `regions_jobs_get(...)`, `regions_jobs_list(...)`, `regions_jobs_submit(...)`, `regions_operations_cancel(...)`, `regions_operations_delete(...)`, `regions_operations_get(...)` and `regions_operations_list(...)` +/// // like `regions_clusters_create(...)`, `regions_clusters_delete(...)`, `regions_clusters_diagnose(...)`, `regions_clusters_get(...)`, `regions_clusters_list(...)`, `regions_clusters_patch(...)`, `regions_jobs_cancel(...)`, `regions_jobs_delete(...)`, `regions_jobs_get(...)`, `regions_jobs_list(...)`, `regions_jobs_patch(...)`, `regions_jobs_submit(...)`, `regions_operations_cancel(...)`, `regions_operations_delete(...)`, `regions_operations_get(...)` and `regions_operations_list(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -1171,9 +1237,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - [Required] The ID of the Google Cloud Platform project that the cluster belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. - /// * `clusterName` - [Required] The cluster name. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the cluster belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `clusterName` - Required. The cluster name. pub fn regions_clusters_get(&self, project_id: &str, region: &str, cluster_name: &str) -> ProjectRegionClusterGetCall<'a, C, A> { ProjectRegionClusterGetCall { hub: self.hub, @@ -1192,8 +1258,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - [Required] The ID of the Google Cloud Platform project that the cluster belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the cluster belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. pub fn regions_clusters_list(&self, project_id: &str, region: &str) -> ProjectRegionClusterListCall<'a, C, A> { ProjectRegionClusterListCall { hub: self.hub, @@ -1214,8 +1280,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - [Required] The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. pub fn regions_jobs_list(&self, project_id: &str, region: &str) -> ProjectRegionJobListCall<'a, C, A> { ProjectRegionJobListCall { hub: self.hub, @@ -1239,9 +1305,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - [Required] The ID of the Google Cloud Platform project the cluster belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. - /// * `clusterName` - [Required] The cluster name. + /// * `projectId` - Required. The ID of the Google Cloud Platform project the cluster belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `clusterName` - Required. The cluster name. pub fn regions_clusters_patch(&self, request: Cluster, project_id: &str, region: &str, cluster_name: &str) -> ProjectRegionClusterPatchCall<'a, C, A> { ProjectRegionClusterPatchCall { hub: self.hub, @@ -1262,9 +1328,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - [Required] The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. - /// * `jobId` - [Required] The job ID. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `jobId` - Required. The job ID. pub fn regions_jobs_get(&self, project_id: &str, region: &str, job_id: &str) -> ProjectRegionJobGetCall<'a, C, A> { ProjectRegionJobGetCall { hub: self.hub, @@ -1279,7 +1345,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. 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`. + /// 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 /// @@ -1317,9 +1383,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `projectId` - [Required] The ID of the Google Cloud Platform project that the cluster belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. - /// * `clusterName` - [Required] The cluster name. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the cluster belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `clusterName` - Required. The cluster name. pub fn regions_clusters_delete(&self, project_id: &str, region: &str, cluster_name: &str) -> ProjectRegionClusterDeleteCall<'a, C, A> { ProjectRegionClusterDeleteCall { hub: self.hub, @@ -1334,14 +1400,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets cluster diagnostic information. After the operation completes, the Operation.response field contains `DiagnoseClusterOutputLocation`. + /// Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation. /// /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - [Required] The ID of the Google Cloud Platform project that the cluster belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. - /// * `clusterName` - [Required] The cluster name. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the cluster belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `clusterName` - Required. The cluster name. pub fn regions_clusters_diagnose(&self, request: DiagnoseClusterRequest, project_id: &str, region: &str, cluster_name: &str) -> ProjectRegionClusterDiagnoseCall<'a, C, A> { ProjectRegionClusterDiagnoseCall { hub: self.hub, @@ -1362,8 +1428,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - [Required] The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. pub fn regions_jobs_submit(&self, request: SubmitJobRequest, project_id: &str, region: &str) -> ProjectRegionJobSubmitCall<'a, C, A> { ProjectRegionJobSubmitCall { hub: self.hub, @@ -1383,8 +1449,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - [Required] The ID of the Google Cloud Platform project that the cluster belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the cluster belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. pub fn regions_clusters_create(&self, request: Cluster, project_id: &str, region: &str) -> ProjectRegionClusterCreateCall<'a, C, A> { ProjectRegionClusterCreateCall { hub: self.hub, @@ -1399,13 +1465,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the job from the project. If the job is active, the delete fails, and the response returns `FAILED_PRECONDITION`. + /// Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION. /// /// # Arguments /// - /// * `projectId` - [Required] The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. - /// * `jobId` - [Required] The job ID. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `jobId` - Required. The job ID. pub fn regions_jobs_delete(&self, project_id: &str, region: &str, job_id: &str) -> ProjectRegionJobDeleteCall<'a, C, A> { ProjectRegionJobDeleteCall { hub: self.hub, @@ -1420,7 +1486,7 @@ 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`. + /// 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 /// @@ -1437,7 +1503,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. + /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding below allows API services to override the binding to use different resource name schemes, such as users/*/operations. /// /// # Arguments /// @@ -1457,14 +1523,38 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Starts a job cancellation request. To access the job resource after cancellation, call [regions/{region}/jobs.list](/dataproc/reference/rest/v1/projects.regions.jobs/list) or [regions/{region}/jobs.get](/dataproc/reference/rest/v1/projects.regions.jobs/get). + /// Updates a job in a project. /// /// # Arguments /// /// * `request` - No description provided. - /// * `projectId` - [Required] The ID of the Google Cloud Platform project that the job belongs to. - /// * `region` - [Required] The Cloud Dataproc region in which to handle the request. - /// * `jobId` - [Required] The job ID. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `jobId` - Required. The job ID. + pub fn regions_jobs_patch(&self, request: Job, project_id: &str, region: &str, job_id: &str) -> ProjectRegionJobPatchCall<'a, C, A> { + ProjectRegionJobPatchCall { + hub: self.hub, + _request: request, + _project_id: project_id.to_string(), + _region: region.to_string(), + _job_id: job_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: + /// + /// Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `projectId` - Required. The ID of the Google Cloud Platform project that the job belongs to. + /// * `region` - Required. The Cloud Dataproc region in which to handle the request. + /// * `jobId` - Required. The job ID. pub fn regions_jobs_cancel(&self, request: CancelJobRequest, project_id: &str, region: &str, job_id: &str) -> ProjectRegionJobCancelCall<'a, C, A> { ProjectRegionJobCancelCall { hub: self.hub, @@ -1561,7 +1651,7 @@ impl<'a, C, A> ProjectRegionClusterGetCall<'a, C, A> where C: BorrowMut ProjectRegionClusterGetCall<'a, C, A> where C: BorrowMut ProjectRegionClusterGetCall<'a, C, A> where C: BorrowMut ProjectRegionClusterGetCall<'a, C, A> where C: BorrowMut ProjectRegionClusterListCall<'a, C, A> where C: BorrowMut ProjectRegionClusterListCall<'a, C, A> where C: BorrowMut ProjectRegionClusterListCall<'a, C, A> where C: BorrowMut ProjectRegionClusterListCall<'a, C, A> where C: BorrowMut ProjectRegionClusterListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// [Optional] The standard List page size. + /// Optional. The standard List page size. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ProjectRegionClusterListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// [Optional] A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax: field:value [field:value] ... or 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 valid filters are: status.state:ACTIVE clusterName:mycluster labels.env:staging \ labels.starred:* and status.state = ACTIVE AND clusterName = mycluster \ AND labels.env = staging AND labels.starred = * + /// 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 = * /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectRegionClusterListCall<'a, C, A> { @@ -2138,7 +2228,7 @@ impl<'a, C, A> ProjectRegionJobListCall<'a, C, A> where C: BorrowMut ProjectRegionJobListCall<'a, C, A> where C: BorrowMut ProjectRegionJobListCall<'a, C, A> where C: BorrowMut ProjectRegionJobListCall<'a, C, A> where C: BorrowMut ProjectRegionJobListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// [Optional] The number of results to return in each response. + /// Optional. The number of results to return in each response. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ProjectRegionJobListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// [Optional] Specifies enumerated categories of jobs to list (default = match ALL jobs). + /// Optional. Specifies enumerated categories of jobs to list (default = match ALL jobs). /// /// Sets the *job state matcher* query property to the given value. pub fn job_state_matcher(mut self, new_value: &str) -> 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] ... or [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 valid filters are: status.state:ACTIVE labels.env:staging labels.starred:* and 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 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 = * /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> ProjectRegionJobListCall<'a, C, A> { self._filter = Some(new_value.to_string()); self } - /// [Optional] If set, the returned jobs list includes only jobs that were submitted to the named cluster. + /// Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster. /// /// Sets the *cluster name* query property to the given value. pub fn cluster_name(mut self, new_value: &str) -> ProjectRegionJobListCall<'a, C, A> { @@ -2440,7 +2530,7 @@ impl<'a, C, A> ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMut ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMut ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMut ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMut ProjectRegionClusterPatchCall<'a, C, A> where C: BorrowMutNote: Currently, only the following fields can be updated:
Mask Purpose
labels Update labels
config.worker_config.num_instances Resize primary worker group
config.secondary_worker_config.num_instances Resize secondary worker group
/// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> ProjectRegionClusterPatchCall<'a, C, A> { @@ -2736,7 +2842,7 @@ impl<'a, C, A> ProjectRegionJobGetCall<'a, C, A> where C: BorrowMut ProjectRegionJobGetCall<'a, C, A> where C: BorrowMut ProjectRegionJobGetCall<'a, C, A> where C: BorrowMut ProjectRegionJobGetCall<'a, C, A> where C: BorrowMut ProjectRegionJobGetCall<'a, C, A> where C: BorrowMut ProjectRegionOperationCancelCall<'a, C, A> where C: BorrowMut ProjectRegionOperationGetCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDiagnoseCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDiagnoseCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDiagnoseCall<'a, C, A> where C: BorrowMut ProjectRegionClusterDiagnoseCall<'a, C, A> where C: BorrowMut ProjectRegionJobSubmitCall<'a, C, A> where C: BorrowMut ProjectRegionJobSubmitCall<'a, C, A> where C: BorrowMut ProjectRegionJobSubmitCall<'a, C, A> where C: BorrowMut ProjectRegionClusterCreateCall<'a, C, A> where C: BorrowMut ProjectRegionClusterCreateCall<'a, C, A> where C: BorrowMut ProjectRegionClusterCreateCall<'a, C, A> where C: BorrowMut ProjectRegionClusterCreateCall<'a, C, A> where C: BorrowMut ProjectRegionJobDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionJobDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionJobDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionJobDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionJobDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectRegionOperationListCall<'a, C, A> where C: BorrowMut ProjectRegionOperationListCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Dataproc::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = 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().regions_jobs_patch(req, "projectId", "region", "jobId") +/// .update_mask("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct ProjectRegionJobPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Dataproc, + _request: Job, + _project_id: String, + _region: String, + _job_id: String, + _update_mask: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectRegionJobPatchCall<'a, C, A> {} + +impl<'a, C, A> ProjectRegionJobPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Job)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "dataproc.projects.regions.jobs.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + params.push(("region", self._region.to_string())); + params.push(("jobId", self._job_id.to_string())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + for &field in ["alt", "projectId", "region", "jobId", "updateMask"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://dataproc.googleapis.com/v1/projects/{projectId}/regions/{region}/jobs/{jobId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId"), ("{region}", "region"), ("{jobId}", "jobId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["jobId", "region", "projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::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: Job) -> ProjectRegionJobPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The ID of the Google Cloud Platform project that the job belongs to. + /// + /// 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) -> ProjectRegionJobPatchCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// Required. The Cloud Dataproc region in which to handle the request. + /// + /// Sets the *region* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn region(mut self, new_value: &str) -> ProjectRegionJobPatchCall<'a, C, A> { + self._region = new_value.to_string(); + self + } + /// Required. The job ID. + /// + /// Sets the *job id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn job_id(mut self, new_value: &str) -> ProjectRegionJobPatchCall<'a, C, A> { + self._job_id = new_value.to_string(); + self + } + /// Required. Specifies the path, relative to Job, of the field to update. For example, to update the labels of a Job the update_mask parameter would be specified as labels, and the PATCH request body would specify the new value. Note: Currently, labels is the only field that can be updated. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> ProjectRegionJobPatchCall<'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) -> ProjectRegionJobPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> ProjectRegionJobPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectRegionJobPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get. /// /// A builder for the *regions.jobs.cancel* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -5418,7 +5832,7 @@ impl<'a, C, A> ProjectRegionJobCancelCall<'a, C, A> where C: BorrowMut ProjectRegionJobCancelCall<'a, C, A> where C: BorrowMut ProjectRegionJobCancelCall<'a, C, A> where C: BorrowMut ProjectRegionJobCancelCall<'a, C, A> where C: BorrowMut ProjectRegionJobCancelCall<'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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-deploymentmanager2] path = "../deploymentmanager2" -version = "1.0.4+20161209" +version = "1.0.4+20170501" diff --git a/gen/deploymentmanager2-cli/README.md b/gen/deploymentmanager2-cli/README.md index 45c2487a7f..1967ac9607 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 *20161209*. The CLI is at version *1.0.4*. +This documentation was generated from the *Deployment Manager* API at revision *20170501*. The CLI is at version *1.0.4*. ```bash deploymentmanager2 [options] diff --git a/gen/deploymentmanager2-cli/mkdocs.yml b/gen/deploymentmanager2-cli/mkdocs.yml index 28656d2d5f..45fcad5908 100644 --- a/gen/deploymentmanager2-cli/mkdocs.yml +++ b/gen/deploymentmanager2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Deployment Manager v1.0.4+20161209 +site_name: Deployment Manager v1.0.4+20170501 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 b273a5eef0..b214c43c07 100644 --- a/gen/deploymentmanager2-cli/src/main.rs +++ b/gen/deploymentmanager2-cli/src/main.rs @@ -315,6 +315,7 @@ 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 })), + "update.description" => Some(("update.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.manifest" => Some(("update.manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "manifest" => Some(("manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "insert-time" => Some(("insertTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -498,6 +499,7 @@ 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 })), + "update.description" => Some(("update.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.manifest" => Some(("update.manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "manifest" => Some(("manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "insert-time" => Some(("insertTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -879,6 +881,7 @@ 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 })), + "update.description" => Some(("update.description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "update.manifest" => Some(("update.manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "manifest" => Some(("manifest", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "insert-time" => Some(("insertTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2129,7 +2132,7 @@ fn main() { let mut app = App::new("deploymentmanager2") .author("Sebastian Thiel ") - .version("1.0.4+20161209") + .version("1.0.4+20170501") .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 9b2bcc5162..9bd0a0f60a 100644 --- a/gen/deploymentmanager2/Cargo.toml +++ b/gen/deploymentmanager2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-deploymentmanager2" -version = "1.0.4+20161209" +version = "1.0.4+20170501" 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.4+20161209" +documentation = "https://docs.rs/google-deploymentmanager2/1.0.4+20170501" license = "MIT" keywords = ["deploymentmanager", "google", "protocol", "web", "api"] diff --git a/gen/deploymentmanager2/README.md b/gen/deploymentmanager2/README.md index b007406d55..847961f5a4 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.4+20161209*, where *20161209* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Deployment Manager* crate version *1.0.4+20170501*, where *20170501* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161209/google_deploymentmanager2/struct.DeploymentManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentManager.html) ... -* [deployments](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.Deployment.html) - * [*cancel preview*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentCancelPreviewCall.html), [*delete*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentGetCall.html), [*get iam policy*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentGetIamPolicyCall.html), [*insert*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentInsertCall.html), [*list*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentListCall.html), [*patch*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentPatchCall.html), [*set iam policy*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentSetIamPolicyCall.html), [*stop*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentStopCall.html), [*test iam permissions*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentTestIamPermissionCall.html) and [*update*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.DeploymentUpdateCall.html) -* [manifests](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.Manifest.html) - * [*get*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.ManifestGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.ManifestListCall.html) -* [operations](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.Operation.html) - * [*get*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.OperationListCall.html) -* [resources](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.ResourceType.html) - * [*get*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.ResourceGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.ResourceListCall.html) -* [types](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.Type.html) - * [*list*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/struct.TypeListCall.html) +* [deployments](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.Deployment.html) + * [*cancel preview*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentCancelPreviewCall.html), [*delete*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentDeleteCall.html), [*get*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentGetCall.html), [*get iam policy*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentGetIamPolicyCall.html), [*insert*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentInsertCall.html), [*list*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentListCall.html), [*patch*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentPatchCall.html), [*set iam policy*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentSetIamPolicyCall.html), [*stop*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentStopCall.html), [*test iam permissions*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentTestIamPermissionCall.html) and [*update*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.DeploymentUpdateCall.html) +* [manifests](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.Manifest.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.ManifestGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.ManifestListCall.html) +* [operations](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.Operation.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.OperationListCall.html) +* [resources](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.ResourceType.html) + * [*get*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.ResourceGetCall.html) and [*list*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.ResourceListCall.html) +* [types](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/struct.Type.html) + * [*list*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/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.4+20161209/google_deploymentmanager2/struct.DeploymentManager.html)** +* **[Hub](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/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.4+20161209/google_deploymentmanager2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/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.4+20161209/google_deploymentmanager2/trait.Part.html)** + * **[Parts](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/google_deploymentmanager2/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-deploymentmanager2/1.0.4+20161209/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.4+20170501/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.4+20161209/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.4+20170501/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.4+20161209/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.4+20170501/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.4+20161209/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.4+20170501/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")`. @@ -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-deploymentmanager2/1.0.4+20161209/google_deploymentmanager2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/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.4+20170501/google_deploymentmanager2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/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.4+20161209/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.4+20170501/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.4+20161209/google_deploymentmanager2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-deploymentmanager2/1.0.4+20161209/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.4+20170501/google_deploymentmanager2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/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.4+20161209/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.4+20170501/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.4+20161209/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.4+20170501/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.4+20161209/google_deploymentmanager2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-deploymentmanager2/1.0.4+20170501/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 2791d8c3eb..34f6b3adfc 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.4+20161209*, where *20161209* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Deployment Manager* crate version *1.0.4+20170501*, where *20170501* is the exact revision of the *deploymentmanager:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Deployment Manager* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/deployment-manager/). @@ -197,7 +197,7 @@ // 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 +// 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)] @@ -343,8 +343,6 @@ pub struct DeploymentManager { client: RefCell, auth: RefCell
, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for DeploymentManager {} @@ -357,8 +355,6 @@ impl<'a, C, A> DeploymentManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/deploymentmanager/v2/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -387,39 +383,23 @@ impl<'a, C, A> DeploymentManager self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/deploymentmanager/v2/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// Provides the configuration for a sub-type of logging. +/// 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 are exempted from this type of logging Follows the same format of Binding.members. + /// 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. @@ -533,7 +513,7 @@ pub struct Operation { /// [Output Only] Reserved for future use. #[serde(rename="clientOperationId")] pub client_operation_id: Option, - /// [Output Only] Creation timestamp in RFC3339 text format. + /// [Deprecated] This field is deprecated. #[serde(rename="creationTimestamp")] pub creation_timestamp: Option, /// [Output Only] The unique identifier for the resource. This identifier is defined by the server. @@ -728,6 +708,8 @@ impl ResponseResult for Manifest {} pub struct DeploymentUpdate { /// [Output Only] Map of labels; provided by the client when the resource is created or updated. Specifically: Label keys must be between 1 and 63 characters long and must conform to the following regular expression: [a-z]([-a-z0-9]*[a-z0-9])? Label values must be between 0 and 63 characters long and must conform to the regular expression ([a-z]([-a-z0-9]*[a-z0-9])?)? pub labels: Option>, + /// [Output Only] An optional user-provided description of the deployment after the current update has been applied. + pub description: Option, /// [Output Only] URL of the manifest representing the update configuration of this deployment. pub manifest: Option, } @@ -840,9 +822,7 @@ impl Part for ResourceUpdate {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Specifies audit logging configs for "data access". "data access": generally refers to data reads/writes and admin reads. "admin activity": generally refers to admin writes. - /// - /// Note: `AuditConfig` doesn't apply to "admin activity", which always enables audit logging. + /// Specifies cloud audit logging configuration for this policy. #[serde(rename="auditConfigs")] pub audit_configs: Option>, /// Version of the `Policy`. The default version is 0. @@ -1130,19 +1110,27 @@ impl NestedType for OperationError {} impl Part for OperationError {} -/// Provides the configuration for non-admin_activity logging for a service. Controls exemptions and specific log sub-types. +/// 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 { - /// Specifies the identities that are exempted from "data access" audit logging for the `service` specified above. Follows the same format of Binding.members. + /// #[serde(rename="exemptedMembers")] pub exempted_members: Option>, - /// The configuration for each type of logging + /// The configuration for logging of each type of permission. #[serde(rename="auditLogConfigs")] pub audit_log_configs: Option>, - /// Specifies a service that will be enabled for audit logging. For example, `resourcemanager`, `storage`, `compute`. `allServices` is a special value that covers all services. + /// 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, } @@ -2002,7 +1990,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/operations/{operation}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/operations/{operation}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2267,7 +2255,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/operations"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2398,7 +2386,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: self._order_by = Some(new_value.to_string()); self } - /// 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. + /// 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) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> OperationListCall<'a, C, A> { @@ -2564,7 +2552,7 @@ impl<'a, C, A> ManifestListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/manifests"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2705,7 +2693,7 @@ impl<'a, C, A> ManifestListCall<'a, C, A> where C: BorrowMut, A: self._order_by = Some(new_value.to_string()); self } - /// 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. + /// 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) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ManifestListCall<'a, C, A> { @@ -2853,7 +2841,7 @@ impl<'a, C, A> ManifestGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/manifests/{manifest}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3128,7 +3116,7 @@ impl<'a, C, A> TypeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/types"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/types".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3259,7 +3247,7 @@ impl<'a, C, A> TypeListCall<'a, C, A> where C: BorrowMut, A: oaut self._order_by = Some(new_value.to_string()); self } - /// 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. + /// 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) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> TypeListCall<'a, C, A> { @@ -3407,7 +3395,7 @@ impl<'a, C, A> ResourceGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/resources/{resource}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources/{resource}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3684,7 +3672,7 @@ impl<'a, C, A> ResourceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/resources"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/resources".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3825,7 +3813,7 @@ impl<'a, C, A> ResourceListCall<'a, C, A> where C: BorrowMut, A: self._order_by = Some(new_value.to_string()); self } - /// 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. + /// 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) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ResourceListCall<'a, C, A> { @@ -3993,7 +3981,7 @@ impl<'a, C, A> DeploymentUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4285,7 +4273,7 @@ impl<'a, C, A> DeploymentGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -4542,7 +4530,7 @@ impl<'a, C, A> DeploymentInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4817,7 +4805,7 @@ impl<'a, C, A> DeploymentTestIamPermissionCall<'a, C, A> where C: BorrowMut DeploymentGetIamPolicyCall<'a, C, A> where C: BorrowMut DeploymentCancelPreviewCall<'a, C, A> where C: BorrowMut DeploymentListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -5762,7 +5750,7 @@ impl<'a, C, A> DeploymentListCall<'a, C, A> where C: BorrowMut, A self._order_by = Some(new_value.to_string()); self } - /// 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. + /// 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) /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> DeploymentListCall<'a, C, A> { @@ -5930,7 +5918,7 @@ impl<'a, C, A> DeploymentPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6229,7 +6217,7 @@ impl<'a, C, A> DeploymentStopCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/stop"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}/stop".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6507,7 +6495,7 @@ impl<'a, C, A> DeploymentSetIamPolicyCall<'a, C, A> where C: BorrowMut DeploymentDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2/projects/{project}/global/deployments/{deployment}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6965,3 +6953,4 @@ impl<'a, C, A> DeploymentDeleteCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/deploymentmanager2_beta2-cli/Cargo.toml b/gen/deploymentmanager2_beta2-cli/Cargo.toml index dbe2e2e437..6c2d836f7c 100644 --- a/gen/deploymentmanager2_beta2-cli/Cargo.toml +++ b/gen/deploymentmanager2_beta2-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/deploymentmanager2_beta2/src/lib.rs b/gen/deploymentmanager2_beta2/src/lib.rs index 543d6990a9..6384fd6a7a 100644 --- a/gen/deploymentmanager2_beta2/src/lib.rs +++ b/gen/deploymentmanager2_beta2/src/lib.rs @@ -192,7 +192,7 @@ // 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 +// 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)] @@ -338,8 +338,6 @@ pub struct DeploymentManager { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for DeploymentManager {} @@ -352,8 +350,6 @@ impl<'a, C, A> DeploymentManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/deploymentmanager/v2beta2/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -382,26 +378,6 @@ impl<'a, C, A> DeploymentManager self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/deploymentmanager/v2beta2/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1446,7 +1422,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/operations/{operation}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/operations/{operation}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -1706,7 +1682,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/operations"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -1987,7 +1963,7 @@ impl<'a, C, A> ManifestListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/manifests"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/manifests".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2265,7 +2241,7 @@ impl<'a, C, A> ManifestGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/manifests/{manifest}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/manifests/{manifest}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2524,7 +2500,7 @@ impl<'a, C, A> ResourceGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/resources/{resource}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/resources/{resource}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2796,7 +2772,7 @@ impl<'a, C, A> ResourceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}/resources"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}/resources".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3085,7 +3061,7 @@ impl<'a, C, A> TypeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/types"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/types".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3373,7 +3349,7 @@ impl<'a, C, A> DeploymentUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3665,7 +3641,7 @@ impl<'a, C, A> DeploymentGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3917,7 +3893,7 @@ impl<'a, C, A> DeploymentInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4191,7 +4167,7 @@ impl<'a, C, A> DeploymentListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -4479,7 +4455,7 @@ impl<'a, C, A> DeploymentPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4771,7 +4747,7 @@ impl<'a, C, A> DeploymentDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/deployments/{deployment}"; + let mut url = "https://www.googleapis.com/deploymentmanager/v2beta2/projects/{project}/global/deployments/{deployment}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4946,3 +4922,4 @@ impl<'a, C, A> DeploymentDeleteCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/dfareporting2d1-cli/Cargo.toml b/gen/dfareporting2d1-cli/Cargo.toml index 3d046a357b..d97b942b85 100644 --- a/gen/dfareporting2d1-cli/Cargo.toml +++ b/gen/dfareporting2d1-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/dfareporting2d1/src/lib.rs b/gen/dfareporting2d1/src/lib.rs index 6cad9819cf..74e3dcfebe 100644 --- a/gen/dfareporting2d1/src/lib.rs +++ b/gen/dfareporting2d1/src/lib.rs @@ -301,7 +301,7 @@ // 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 +// 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)] @@ -435,8 +435,6 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -449,8 +447,6 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/dfareporting/v2.1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -629,26 +625,6 @@ impl<'a, C, A> Dfareporting self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/dfareporting/v2.1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -13257,7 +13233,7 @@ impl<'a, C, A> UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/platformTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -13984,7 +13960,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/platformTypes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14230,7 +14206,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creativeFields".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16486,7 +16462,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creativeFields/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16975,7 +16951,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17780,7 +17756,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18032,7 +18008,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18292,7 +18268,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18536,7 +18512,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18847,7 +18823,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19141,7 +19117,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19889,7 +19865,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20160,7 +20136,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20414,7 +20390,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20694,7 +20670,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20976,7 +20952,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21234,9 +21210,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21908,7 +21884,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22230,7 +22206,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/changeLogs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22540,7 +22516,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/changeLogs/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22787,7 +22763,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}/run".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23844,7 +23820,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24135,7 +24111,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24415,7 +24391,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24683,7 +24659,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24959,7 +24935,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25490,7 +25466,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25746,7 +25722,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26006,7 +25982,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26283,7 +26259,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26551,7 +26527,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26886,7 +26862,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27215,7 +27191,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27476,7 +27452,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/advertisers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27738,7 +27714,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/metros".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29926,7 +29902,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30226,7 +30202,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() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30483,7 +30459,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31255,7 +31231,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31499,7 +31475,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31775,7 +31751,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32174,7 +32150,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32589,7 +32565,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/ads/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32841,7 +32817,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33102,7 +33078,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/connectionTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -34066,7 +34042,7 @@ impl<'a, C, A> AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -35935,7 +35911,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36261,7 +36237,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36611,7 +36587,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36879,7 +36855,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37150,7 +37126,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/regions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39327,7 +39303,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creativeGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39840,7 +39816,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creativeGroups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40445,7 +40421,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41565,7 +41541,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41856,7 +41832,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42141,7 +42117,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42402,7 +42378,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/subaccounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42649,7 +42625,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42894,7 +42870,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/mobileCarriers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43131,7 +43107,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -44970,7 +44946,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45306,7 +45282,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placementGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46442,7 +46418,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47067,7 +47043,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47324,7 +47300,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50177,7 +50153,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50438,7 +50414,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creatives/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50775,7 +50751,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51137,7 +51113,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51408,7 +51384,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51664,7 +51640,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51952,7 +51928,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52228,7 +52204,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52560,7 +52536,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52891,7 +52867,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53180,7 +53156,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53494,7 +53470,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53762,7 +53738,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54038,7 +54014,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54299,7 +54275,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54546,7 +54522,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/cities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56231,7 +56207,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58154,7 +58130,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58406,7 +58382,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/directorySites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59061,7 +59037,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/directorySites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59313,7 +59289,7 @@ impl<'a, C, A> SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59594,7 +59570,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59860,7 +59836,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/sizes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60107,7 +60083,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/countries".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61992,7 +61968,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/countries/{dartId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62241,7 +62217,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62549,7 +62525,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62862,7 +62838,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/postalCodes/{code}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63107,7 +63083,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/postalCodes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63342,7 +63318,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/browsers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63579,7 +63555,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63861,7 +63837,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64153,7 +64129,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64421,7 +64397,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64699,7 +64675,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65080,7 +65056,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65459,7 +65435,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65725,7 +65701,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66003,7 +65979,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.1/userprofiles/{profileId}/placements/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66438,3 +66414,4 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/dfareporting2d2-cli/Cargo.toml b/gen/dfareporting2d2-cli/Cargo.toml index a7b5918e65..9242586d13 100644 --- a/gen/dfareporting2d2-cli/Cargo.toml +++ b/gen/dfareporting2d2-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/dfareporting2d2/src/lib.rs b/gen/dfareporting2d2/src/lib.rs index 7709565490..daf8551a59 100644 --- a/gen/dfareporting2d2/src/lib.rs +++ b/gen/dfareporting2d2/src/lib.rs @@ -301,7 +301,7 @@ // 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 +// 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)] @@ -435,8 +435,6 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -449,8 +447,6 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/dfareporting/v2.2/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -629,26 +625,6 @@ impl<'a, C, A> Dfareporting self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/dfareporting/v2.2/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -13277,7 +13253,7 @@ impl<'a, C, A> UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/platformTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14004,7 +13980,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/platformTypes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14250,7 +14226,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creativeFields".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16506,7 +16482,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creativeFields/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16995,7 +16971,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17800,7 +17776,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18052,7 +18028,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18312,7 +18288,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18556,7 +18532,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18867,7 +18843,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19161,7 +19137,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19909,7 +19885,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20180,7 +20156,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20434,7 +20410,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20714,7 +20690,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20996,7 +20972,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21254,9 +21230,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21928,7 +21904,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22250,7 +22226,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/changeLogs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22560,7 +22536,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/changeLogs/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22807,7 +22783,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}/run".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23864,7 +23840,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24155,7 +24131,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24435,7 +24411,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24703,7 +24679,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24979,7 +24955,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25510,7 +25486,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25766,7 +25742,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26026,7 +26002,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26303,7 +26279,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26571,7 +26547,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26906,7 +26882,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27235,7 +27211,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27496,7 +27472,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/advertisers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27758,7 +27734,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/metros".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29946,7 +29922,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30246,7 +30222,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() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30503,7 +30479,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31275,7 +31251,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31519,7 +31495,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31795,7 +31771,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32194,7 +32170,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32609,7 +32585,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/ads/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32861,7 +32837,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33122,7 +33098,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/connectionTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -34086,7 +34062,7 @@ impl<'a, C, A> AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -35955,7 +35931,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36281,7 +36257,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36631,7 +36607,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36899,7 +36875,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37170,7 +37146,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/regions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39347,7 +39323,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creativeGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39860,7 +39836,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creativeGroups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40465,7 +40441,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41585,7 +41561,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41876,7 +41852,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42161,7 +42137,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42422,7 +42398,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/subaccounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42669,7 +42645,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42914,7 +42890,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/mobileCarriers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43151,7 +43127,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -44990,7 +44966,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45346,7 +45322,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placementGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46510,7 +46486,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47135,7 +47111,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47392,7 +47368,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50245,7 +50221,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50506,7 +50482,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creatives/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50843,7 +50819,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51205,7 +51181,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51476,7 +51452,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51732,7 +51708,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52020,7 +51996,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52296,7 +52272,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52628,7 +52604,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52959,7 +52935,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53248,7 +53224,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53562,7 +53538,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53830,7 +53806,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54106,7 +54082,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54367,7 +54343,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54614,7 +54590,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/cities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56299,7 +56275,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58222,7 +58198,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58474,7 +58450,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/directorySites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59129,7 +59105,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/directorySites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59381,7 +59357,7 @@ impl<'a, C, A> SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59662,7 +59638,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59928,7 +59904,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/sizes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60175,7 +60151,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/countries".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62060,7 +62036,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/countries/{dartId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62309,7 +62285,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62617,7 +62593,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62930,7 +62906,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/postalCodes/{code}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63175,7 +63151,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/postalCodes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63410,7 +63386,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/browsers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63647,7 +63623,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63929,7 +63905,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64221,7 +64197,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64489,7 +64465,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64767,7 +64743,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65168,7 +65144,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65575,7 +65551,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65841,7 +65817,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66119,7 +66095,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.2/userprofiles/{profileId}/placements/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66554,3 +66530,4 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/dfareporting2d3-cli/Cargo.toml b/gen/dfareporting2d3-cli/Cargo.toml index da53f734fe..8958fb2ab2 100644 --- a/gen/dfareporting2d3-cli/Cargo.toml +++ b/gen/dfareporting2d3-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/dfareporting2d3/src/lib.rs b/gen/dfareporting2d3/src/lib.rs index ce90ae0fa5..650d35113b 100644 --- a/gen/dfareporting2d3/src/lib.rs +++ b/gen/dfareporting2d3/src/lib.rs @@ -301,7 +301,7 @@ // 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 +// 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)] @@ -435,8 +435,6 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -449,8 +447,6 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/dfareporting/v2.3/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -629,26 +625,6 @@ impl<'a, C, A> Dfareporting self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/dfareporting/v2.3/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -13263,7 +13239,7 @@ impl<'a, C, A> UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/platformTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -13990,7 +13966,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/platformTypes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14236,7 +14212,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creativeFields".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16492,7 +16468,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creativeFields/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16981,7 +16957,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17786,7 +17762,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18038,7 +18014,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18298,7 +18274,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18542,7 +18518,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18853,7 +18829,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19147,7 +19123,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19895,7 +19871,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20166,7 +20142,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20420,7 +20396,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20700,7 +20676,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20982,7 +20958,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21240,9 +21216,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21914,7 +21890,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22236,7 +22212,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/changeLogs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22546,7 +22522,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/changeLogs/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22793,7 +22769,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}/run".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23850,7 +23826,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24141,7 +24117,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24421,7 +24397,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24689,7 +24665,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24965,7 +24941,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25496,7 +25472,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25752,7 +25728,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26012,7 +25988,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26289,7 +26265,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26557,7 +26533,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26892,7 +26868,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27221,7 +27197,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27482,7 +27458,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/advertisers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27744,7 +27720,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/metros".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29696,7 +29672,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29996,7 +29972,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() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30253,7 +30229,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31025,7 +31001,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31269,7 +31245,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31545,7 +31521,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31944,7 +31920,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32359,7 +32335,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/ads/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32611,7 +32587,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32872,7 +32848,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/connectionTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33836,7 +33812,7 @@ impl<'a, C, A> AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -35705,7 +35681,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36031,7 +36007,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36381,7 +36357,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36649,7 +36625,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36920,7 +36896,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/regions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39097,7 +39073,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creativeGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39610,7 +39586,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creativeGroups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40215,7 +40191,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41335,7 +41311,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41626,7 +41602,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41911,7 +41887,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42172,7 +42148,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/subaccounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42419,7 +42395,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42664,7 +42640,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/mobileCarriers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42901,7 +42877,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -44740,7 +44716,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45096,7 +45072,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placementGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46260,7 +46236,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46885,7 +46861,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47142,7 +47118,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -49995,7 +49971,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50256,7 +50232,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creatives/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50593,7 +50569,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50955,7 +50931,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51226,7 +51202,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51482,7 +51458,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51770,7 +51746,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52046,7 +52022,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52378,7 +52354,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52709,7 +52685,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52998,7 +52974,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53312,7 +53288,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53580,7 +53556,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53856,7 +53832,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54117,7 +54093,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54364,7 +54340,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/cities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56049,7 +56025,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -57972,7 +57948,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58224,7 +58200,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/directorySites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58879,7 +58855,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/directorySites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59131,7 +59107,7 @@ impl<'a, C, A> SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59412,7 +59388,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59678,7 +59654,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/sizes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59925,7 +59901,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/countries".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61810,7 +61786,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/countries/{dartId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62059,7 +62035,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62367,7 +62343,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62680,7 +62656,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/postalCodes/{code}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62925,7 +62901,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/postalCodes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63160,7 +63136,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/browsers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63397,7 +63373,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63679,7 +63655,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63971,7 +63947,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64239,7 +64215,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64517,7 +64493,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64918,7 +64894,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65325,7 +65301,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65591,7 +65567,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65869,7 +65845,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.3/userprofiles/{profileId}/placements/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66304,3 +66280,4 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/dfareporting2d4-cli/Cargo.toml b/gen/dfareporting2d4-cli/Cargo.toml index 2c7aab06fe..b33f9c24f8 100644 --- a/gen/dfareporting2d4-cli/Cargo.toml +++ b/gen/dfareporting2d4-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/dfareporting2d4/src/lib.rs b/gen/dfareporting2d4/src/lib.rs index b6a475e4e0..3162e59831 100644 --- a/gen/dfareporting2d4/src/lib.rs +++ b/gen/dfareporting2d4/src/lib.rs @@ -301,7 +301,7 @@ // 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 +// 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)] @@ -435,8 +435,6 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -449,8 +447,6 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/dfareporting/v2.4/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -629,26 +625,6 @@ impl<'a, C, A> Dfareporting self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/dfareporting/v2.4/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -13267,7 +13243,7 @@ impl<'a, C, A> UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/platformTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -13994,7 +13970,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/platformTypes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14240,7 +14216,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creativeFields".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16496,7 +16472,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creativeFields/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16985,7 +16961,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17790,7 +17766,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18042,7 +18018,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18302,7 +18278,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18546,7 +18522,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18857,7 +18833,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19151,7 +19127,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19899,7 +19875,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20170,7 +20146,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20424,7 +20400,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20704,7 +20680,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20986,7 +20962,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21244,9 +21220,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21918,7 +21894,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22240,7 +22216,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/changeLogs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22550,7 +22526,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/changeLogs/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22797,7 +22773,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}/run".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23854,7 +23830,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24145,7 +24121,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24425,7 +24401,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24693,7 +24669,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24969,7 +24945,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25500,7 +25476,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25756,7 +25732,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26016,7 +25992,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26293,7 +26269,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26561,7 +26537,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26896,7 +26872,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27225,7 +27201,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27486,7 +27462,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/advertisers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27748,7 +27724,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/metros".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29700,7 +29676,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30000,7 +29976,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() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30257,7 +30233,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31029,7 +31005,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31273,7 +31249,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31549,7 +31525,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31948,7 +31924,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32363,7 +32339,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/ads/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32615,7 +32591,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32876,7 +32852,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/connectionTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33840,7 +33816,7 @@ impl<'a, C, A> AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -35709,7 +35685,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36035,7 +36011,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36385,7 +36361,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36653,7 +36629,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36924,7 +36900,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/regions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39101,7 +39077,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creativeGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39614,7 +39590,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creativeGroups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40219,7 +40195,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41339,7 +41315,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41630,7 +41606,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41915,7 +41891,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42176,7 +42152,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/subaccounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42423,7 +42399,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42668,7 +42644,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/mobileCarriers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42905,7 +42881,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -44744,7 +44720,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45100,7 +45076,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placementGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46264,7 +46240,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46901,7 +46877,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47158,7 +47134,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50011,7 +49987,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50272,7 +50248,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creatives/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50609,7 +50585,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50971,7 +50947,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51242,7 +51218,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51498,7 +51474,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51786,7 +51762,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52062,7 +52038,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52394,7 +52370,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52725,7 +52701,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53014,7 +52990,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53328,7 +53304,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53596,7 +53572,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53872,7 +53848,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54133,7 +54109,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54380,7 +54356,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/cities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56065,7 +56041,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -57988,7 +57964,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58240,7 +58216,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/directorySites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58895,7 +58871,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/directorySites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59147,7 +59123,7 @@ impl<'a, C, A> SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59428,7 +59404,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59694,7 +59670,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/sizes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59941,7 +59917,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/countries".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61826,7 +61802,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/countries/{dartId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62075,7 +62051,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62383,7 +62359,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62696,7 +62672,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/postalCodes/{code}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62941,7 +62917,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/postalCodes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63176,7 +63152,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/browsers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63413,7 +63389,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63695,7 +63671,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63987,7 +63963,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64255,7 +64231,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64533,7 +64509,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64934,7 +64910,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65341,7 +65317,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65607,7 +65583,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65885,7 +65861,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.4/userprofiles/{profileId}/placements/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66320,3 +66296,4 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/dfareporting2d5-cli/Cargo.toml b/gen/dfareporting2d5-cli/Cargo.toml index 3eb6291de3..71a49f3768 100644 --- a/gen/dfareporting2d5-cli/Cargo.toml +++ b/gen/dfareporting2d5-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting2d5-cli" -version = "1.0.4+20161027" +version = "1.0.4+20170428" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.5)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d5-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-dfareporting2d5] path = "../dfareporting2d5" -version = "1.0.4+20161027" +version = "1.0.4+20170428" diff --git a/gen/dfareporting2d5-cli/README.md b/gen/dfareporting2d5-cli/README.md index 1ed01ee898..41710118ef 100644 --- a/gen/dfareporting2d5-cli/README.md +++ b/gen/dfareporting2d5-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 *20161027*. The CLI is at version *1.0.4*. +This documentation was generated from the *dfareporting* API at revision *20170428*. The CLI is at version *1.0.4*. ```bash dfareporting2d5 [options] diff --git a/gen/dfareporting2d5-cli/mkdocs.yml b/gen/dfareporting2d5-cli/mkdocs.yml index db541edd4b..b1bc8d3202 100644 --- a/gen/dfareporting2d5-cli/mkdocs.yml +++ b/gen/dfareporting2d5-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dfareporting v1.0.4+20161027 +site_name: dfareporting v1.0.4+20170428 site_url: http://byron.github.io/google-apis-rs/google-dfareporting2d5-cli site_description: A complete library to interact with dfareporting (protocol v2.5) diff --git a/gen/dfareporting2d5-cli/src/main.rs b/gen/dfareporting2d5-cli/src/main.rs index 34d0339ed1..a1fff9fae0 100644 --- a/gen/dfareporting2d5-cli/src/main.rs +++ b/gen/dfareporting2d5-cli/src/main.rs @@ -22705,7 +22705,7 @@ fn main() { let mut app = App::new("dfareporting2d5") .author("Sebastian Thiel ") - .version("1.0.4+20161027") + .version("1.0.4+20170428") .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_dfareporting2d5_cli") .arg(Arg::with_name("url") diff --git a/gen/dfareporting2d5/Cargo.toml b/gen/dfareporting2d5/Cargo.toml index 0dd8e5016c..e3ac32c29b 100644 --- a/gen/dfareporting2d5/Cargo.toml +++ b/gen/dfareporting2d5/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dfareporting2d5" -version = "1.0.4+20161027" +version = "1.0.4+20170428" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.5)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d5" homepage = "https://developers.google.com/doubleclick-advertisers/reporting/" -documentation = "https://docs.rs/google-dfareporting2d5/1.0.4+20161027" +documentation = "https://docs.rs/google-dfareporting2d5/1.0.4+20170428" license = "MIT" keywords = ["dfareporting", "google", "protocol", "web", "api"] diff --git a/gen/dfareporting2d5/README.md b/gen/dfareporting2d5/README.md index 1636478f22..cf4a2caf0e 100644 --- a/gen/dfareporting2d5/README.md +++ b/gen/dfareporting2d5/README.md @@ -5,138 +5,138 @@ DO NOT EDIT ! --> The `google-dfareporting2d5` library allows access to all features of the *Google dfareporting* service. -This documentation was generated from *dfareporting* crate version *1.0.4+20161027*, where *20161027* is the exact revision of the *dfareporting:v2.5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *dfareporting* crate version *1.0.4+20170428*, where *20170428* is the exact revision of the *dfareporting:v2.5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *dfareporting* *v2d5* API can be found at the [official documentation site](https://developers.google.com/doubleclick-advertisers/reporting/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Dfareporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Dfareporting.html) ... -* [account active ad summaries](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountActiveAdSummary.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountActiveAdSummaryGetCall.html) -* [account permission groups](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountPermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountPermissionGroupListCall.html) -* [account permissions](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountPermission.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountPermissionListCall.html) -* [account user profiles](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountUserProfile.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountUserProfileUpdateCall.html) -* [accounts](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Account.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AccountUpdateCall.html) -* [ads](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Ad.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdUpdateCall.html) -* [advertiser groups](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserGroup.html) - * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserGroupUpdateCall.html) -* [advertisers](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Advertiser.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.AdvertiserUpdateCall.html) -* [browsers](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Browser.html) - * [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.BrowserListCall.html) -* [campaign creative associations](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CampaignCreativeAssociation.html) - * [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CampaignCreativeAssociationListCall.html) -* [campaigns](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Campaign.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CampaignUpdateCall.html) -* [change logs](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ChangeLog.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ChangeLogListCall.html) -* [cities](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.City.html) - * [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CityListCall.html) -* [connection types](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ConnectionType.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ConnectionTypeListCall.html) -* [content categories](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ContentCategory.html) - * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ContentCategoryUpdateCall.html) -* [conversions](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Conversion.html) - * [*batchinsert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ConversionBatchinsertCall.html) -* [countries](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Country.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CountryListCall.html) -* [creative assets](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeAsset.html) - * [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeAssetInsertCall.html) -* [creative field values](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldValue.html) - * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldValueUpdateCall.html) -* [creative fields](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeField.html) - * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeFieldUpdateCall.html) -* [creative groups](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeGroupUpdateCall.html) -* [creatives](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Creative.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeUpdateCall.html) -* [dimension values](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DimensionValue.html) - * [*query*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DimensionValueQueryCall.html) -* [directory site contacts](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DirectorySiteContact.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DirectorySiteContactListCall.html) -* [directory sites](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DirectorySite.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DirectorySiteListCall.html) -* [dynamic targeting keys](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DynamicTargetingKey.html) - * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.DynamicTargetingKeyListCall.html) -* [event tags](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.EventTag.html) - * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.EventTagUpdateCall.html) -* [files](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.File.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FileListCall.html) -* [floodlight activities](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivity.html) - * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityUpdateCall.html) -* [floodlight activity groups](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightActivityGroupUpdateCall.html) -* [floodlight configurations](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightConfiguration.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FloodlightConfigurationUpdateCall.html) -* [inventory items](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.InventoryItem.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.InventoryItemListCall.html) -* [landing pages](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.LandingPage.html) - * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.LandingPageUpdateCall.html) -* [metros](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Metro.html) - * [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.MetroListCall.html) -* [mobile carriers](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.MobileCarrier.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.MobileCarrierListCall.html) -* [operating system versions](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OperatingSystemVersion.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OperatingSystemVersionListCall.html) -* [operating systems](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OperatingSystem.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OperatingSystemListCall.html) -* [order documents](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OrderDocument.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OrderDocumentListCall.html) -* [orders](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Order.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.OrderListCall.html) -* [placement groups](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementGroupUpdateCall.html) -* [placement strategies](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementStrategy.html) - * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementStrategyUpdateCall.html) -* [placements](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Placement.html) - * [*generatetags*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlacementUpdateCall.html) -* [platform types](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlatformType.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PlatformTypeListCall.html) -* [postal codes](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PostalCode.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.PostalCodeListCall.html) -* [projects](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Project.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ProjectListCall.html) -* [regions](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Region.html) - * [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RegionListCall.html) -* [remarketing list shares](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RemarketingListShare.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RemarketingListShareUpdateCall.html) -* [remarketing lists](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.RemarketingListUpdateCall.html) -* [reports](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Report.html) - * [*compatible fields query*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportUpdateCall.html) -* [sites](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Site.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SiteUpdateCall.html) -* [sizes](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Size.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SizeListCall.html) -* [subaccounts](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Subaccount.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.SubaccountUpdateCall.html) -* [targetable remarketing lists](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.TargetableRemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.TargetableRemarketingListListCall.html) -* [user profiles](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserProfile.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserProfileListCall.html) -* [user role permission groups](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRolePermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRolePermissionGroupListCall.html) -* [user role permissions](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRolePermission.html) - * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRolePermissionListCall.html) -* [user roles](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRole.html) - * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.UserRoleUpdateCall.html) +* [account active ad summaries](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserGroupUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ConversionBatchinsertCall.html) +* [countries](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DimensionValueQueryCall.html) +* [directory site contacts](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DirectorySiteContact.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DirectorySiteContactListCall.html) +* [directory sites](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.InventoryItemListCall.html) +* [landing pages](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.LandingPage.html) + * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.LandingPageUpdateCall.html) +* [metros](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.MetroListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.TargetableRemarketingListListCall.html) +* [user profiles](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.UserRoleUpdateCall.html) Upload supported by ... -* [*insert creative assets*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.CreativeAssetInsertCall.html) +* [*insert creative assets*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.CreativeAssetInsertCall.html) Download supported by ... -* [*get files*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.FileGetCall.html) -* [*files get reports*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.ReportFileGetCall.html) +* [*get files*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.ReportFileGetCall.html) @@ -144,17 +144,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/struct.Dfareporting.html)** +* **[Hub](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/struct.Dfareporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.Part.html)** + * **[Parts](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -250,17 +250,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/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-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/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-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/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-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/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")`. @@ -270,29 +270,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-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/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-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/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-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/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-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/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-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/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-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/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-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/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-dfareporting2d5/1.0.4+20161027/google_dfareporting2d5/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dfareporting2d5/1.0.4+20170428/google_dfareporting2d5/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/dfareporting2d5/src/lib.rs b/gen/dfareporting2d5/src/lib.rs index 54baa23640..ea5bb7af78 100644 --- a/gen/dfareporting2d5/src/lib.rs +++ b/gen/dfareporting2d5/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.4+20161027*, where *20161027* is the exact revision of the *dfareporting:v2.5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *dfareporting* crate version *1.0.4+20170428*, where *20170428* is the exact revision of the *dfareporting:v2.5* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *dfareporting* *v2d5* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-advertisers/reporting/). @@ -305,7 +305,7 @@ // 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 +// 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)] @@ -443,8 +443,6 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -457,8 +455,6 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/dfareporting/v2.5/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -643,26 +639,6 @@ impl<'a, C, A> Dfareporting self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/dfareporting/v2.5/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1043,10 +1019,10 @@ impl ResponseResult for AccountActiveAdSummary {} /// #[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. + /// 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. + /// 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, } @@ -1392,7 +1368,7 @@ impl Part for ListPopulationRule {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Account { - /// File size limit in kilobytes of Rich Media teaser creatives. Must be between 1 and 10240. + /// 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, /// Whether to serve creatives with Active View tags. If disabled, viewability data will not be available for any impressions. @@ -1439,7 +1415,7 @@ pub struct Account { 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. + /// 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. @@ -1499,7 +1475,8 @@ pub struct Account { /// - "45" for RUB /// - "46" for AED /// - "47" for BGN - /// - "48" for HRK + /// - "48" for HRK + /// - "49" for MXN #[serde(rename="currencyId")] pub currency_id: Option, /// Reporting configuration of this account. @@ -1533,7 +1510,7 @@ pub struct DayPartTargeting { /// - "SATURDAY" #[serde(rename="daysOfWeek")] pub days_of_week: Option>, - /// Hours of the day when the ad will serve. Must be an integer between 0 and 23 (inclusive), 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. + /// 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. @@ -1783,7 +1760,7 @@ impl ResponseResult for FloodlightActivityGroup {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AudienceSegment { - /// Weight allocated to this segment. Must be between 1 and 1000. The weight assigned will be understood in proportion to the weights assigned to other segments in the same segment group. + /// 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, @@ -2100,6 +2077,8 @@ pub struct Placement { /// - "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" @@ -2258,7 +2237,7 @@ pub struct OptimizationActivity { /// 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. Must be greater than 1. The weight assigned will be understood in proportion to the weights assigned to the other optimization activities. + /// 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, } @@ -2351,9 +2330,9 @@ impl Part for CompanionClickThroughOverride {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FrequencyCap { - /// Duration of time, in seconds, for this frequency cap. The maximum duration is 90 days in seconds, or 7,776,000. + /// 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. The maximum allowed is 15. + /// 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, } @@ -2621,15 +2600,16 @@ impl Part for DirectorySiteContactAssignment {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreativeAssignment { - /// Weight of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_RANDOM. + /// 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. + /// 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 @@ -2638,7 +2618,6 @@ pub struct CreativeAssignment { /// - RICH_MEDIA_MOBILE_IN_APP /// - RICH_MEDIA_MULTI_FLOATING /// - RICH_MEDIA_PEEL_DOWN - /// - ADVANCED_BANNER /// - VPAID_LINEAR /// - VPAID_NON_LINEAR #[serde(rename="richMediaExitOverrides")] @@ -3012,7 +2991,7 @@ pub struct CreativeAsset { /// 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>, - /// Duration in seconds for which an asset will be displayed. Applicable to the following creative types: INSTREAM_VIDEO and VPAID_LINEAR_VIDEO. + /// 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")] @@ -3082,7 +3061,7 @@ pub struct CreativeAsset { /// 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. This is a read-only field. 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. + /// zIndex value of an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to 999999999, inclusive. #[serde(rename="zIndex")] pub z_index: Option, /// Rich media child asset type. This is a read-only field. Applicable to the following creative types: all VPAID. @@ -3094,7 +3073,7 @@ pub struct CreativeAsset { /// 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. Must be between 0 and 9.99. 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. + /// 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. @@ -3107,7 +3086,7 @@ pub struct CreativeAsset { 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. + /// 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. @@ -3352,14 +3331,14 @@ impl Part for OrderContact {} 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. + /// Country ID of this directory site. This is a read-only field. #[serde(rename="countryId")] pub country_id: Option, - /// Description of this directory site. + /// 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. + /// Currency ID of this directory site. This is a read-only field. /// Possible values are: /// - "1" for USD /// - "2" for GBP @@ -3407,7 +3386,8 @@ pub struct DirectorySite { /// - "45" for RUB /// - "46" for AED /// - "47" for BGN - /// - "48" for HRK + /// - "48" for HRK + /// - "49" for MXN #[serde(rename="currencyId")] pub currency_id: Option, /// Tag types for regular placements. @@ -3493,10 +3473,7 @@ pub struct CreativeGroup { 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 one of the following subgroups 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 - /// - 2 + /// 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. @@ -4340,7 +4317,7 @@ pub struct DeliverySchedule { /// 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. Must be between 1 and 10. + /// 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, } @@ -4645,10 +4622,10 @@ pub struct TagData { /// Tag string for serving an ad. #[serde(rename="impressionTag")] pub impression_tag: Option, - /// Creative associated with this placement tag. + /// 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. + /// 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. @@ -4811,7 +4788,7 @@ pub struct RemarketingList { /// 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. + /// 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. @@ -4867,7 +4844,7 @@ pub struct FloodlightActivity { /// Advertiser ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's advertiser or the existing activity's advertiser. #[serde(rename="advertiserId")] pub advertiser_id: Option, - /// Code type used for cache busting in the generated tag. + /// Code type used for cache busting in the generated tag. Applicable only when floodlightActivityGroupType is COUNTER and countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING. #[serde(rename="cacheBustingType")] pub cache_busting_type: Option, /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. @@ -5367,11 +5344,11 @@ impl ResponseResult for LandingPage {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Size { - /// Width of this 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. + /// 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, @@ -6204,7 +6181,7 @@ impl Part for ReportFloodlightCriteriaReportProperties {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ConversionsBatchInsertResponse { - /// The status of each conversion's insertion status. The status is returned in the same order that conversions are inserted. + /// 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")] @@ -6700,12 +6677,12 @@ impl ResponseResult for Ad {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PricingSchedulePricingPeriod { - /// Units of this pricing period. + /// 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. + /// 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. @@ -13669,7 +13646,7 @@ impl<'a, C, A> ConversionBatchinsertCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/platformTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14657,7 +14634,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/platformTypes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -14903,7 +14880,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> { @@ -16574,7 +16551,7 @@ impl<'a, C, A> CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creativeFields".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16985,7 +16962,7 @@ impl<'a, C, A> CreativeFieldListCall<'a, C, A> where C: BorrowMut self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -17159,7 +17136,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creativeFields/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17648,7 +17625,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18453,7 +18430,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18705,7 +18682,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18965,7 +18942,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19209,7 +19186,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19520,7 +19497,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19640,7 +19617,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: self._subaccount_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -19814,7 +19791,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20562,7 +20539,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20833,7 +20810,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21087,7 +21064,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21367,7 +21344,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21649,7 +21626,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21907,9 +21884,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22581,7 +22558,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22704,7 +22681,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< self._campaign_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -22903,7 +22880,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/changeLogs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -23213,7 +23190,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/changeLogs/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -23460,7 +23437,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}/run".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24517,7 +24494,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24808,7 +24785,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25088,7 +25065,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25356,7 +25333,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25632,7 +25609,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26163,7 +26140,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26419,7 +26396,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26679,7 +26656,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26956,7 +26933,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27224,7 +27201,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27559,7 +27536,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27686,7 +27663,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A self._status = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -27888,7 +27865,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -28149,7 +28126,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/advertisers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -28411,7 +28388,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> { @@ -29562,7 +29539,7 @@ impl<'a, C, A> FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/metros".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30363,7 +30340,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30486,7 +30463,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau self._project_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -30663,7 +30640,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() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30920,7 +30897,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> { @@ -31488,7 +31465,7 @@ impl<'a, C, A> UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31692,7 +31669,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31936,7 +31913,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32212,7 +32189,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32611,7 +32588,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32746,7 +32723,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 self._ssl_compliant = Some(new_value); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -33026,7 +33003,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/ads/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33278,7 +33255,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33539,7 +33516,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/connectionTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -34503,7 +34480,7 @@ impl<'a, C, A> AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> { @@ -35065,7 +35042,7 @@ impl<'a, C, A> AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36372,7 +36349,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36698,7 +36675,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36825,7 +36802,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut self._subaccount_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -37048,7 +37025,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37316,7 +37293,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37587,7 +37564,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> { @@ -38236,7 +38213,7 @@ impl<'a, C, A> FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/regions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39764,7 +39741,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creativeGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40277,7 +40254,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creativeGroups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40693,7 +40670,7 @@ impl<'a, C, A> CreativeGroupListCall<'a, C, A> where C: BorrowMut self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -40882,7 +40859,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> { @@ -41472,7 +41449,7 @@ impl<'a, C, A> TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42002,7 +41979,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42268,7 +42245,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42559,7 +42536,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42672,7 +42649,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -42839,7 +42816,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/subaccounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43086,7 +43063,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43331,7 +43308,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/mobileCarriers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43568,7 +43545,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45407,7 +45384,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -45763,7 +45740,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupListCall<'a, C, A> { @@ -46146,7 +46123,7 @@ impl<'a, C, A> PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placementGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -46927,7 +46904,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47379,7 +47356,7 @@ impl<'a, C, A> InventoryItemListCall<'a, C, A> where C: BorrowMut self._type_ = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -47564,7 +47541,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47821,7 +47798,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> { @@ -49115,7 +49092,7 @@ impl<'a, C, A> ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50674,7 +50651,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -50935,7 +50912,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creatives/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51272,7 +51249,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51400,7 +51377,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: self._studio_creative_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -51634,7 +51611,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51905,7 +51882,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52161,7 +52138,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52449,7 +52426,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52725,7 +52702,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53057,7 +53034,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53177,7 +53154,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: self._subaccount_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -53388,7 +53365,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53677,7 +53654,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53790,7 +53767,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -53991,7 +53968,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54259,7 +54236,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54535,7 +54512,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54796,7 +54773,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55043,7 +55020,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> { @@ -55894,7 +55871,7 @@ impl<'a, C, A> RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/cities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56728,7 +56705,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> { @@ -57545,7 +57522,7 @@ impl<'a, C, A> PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58476,7 +58453,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -58651,7 +58628,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -58903,7 +58880,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/directorySites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59342,7 +59319,7 @@ impl<'a, C, A> DirectorySiteListCall<'a, C, A> where C: BorrowMut self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -59558,7 +59535,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/directorySites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59808,7 +59785,7 @@ impl<'a, C, A> DynamicTargetingKeyDeleteCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyListCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyInsertCall<'a, C, A> where C: BorrowMut SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60903,7 +60880,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61169,7 +61146,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/sizes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61416,7 +61393,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> { @@ -62280,7 +62257,7 @@ impl<'a, C, A> AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/countries".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63301,7 +63278,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/countries/{dartId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63550,7 +63527,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63858,7 +63835,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63981,7 +63958,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut self._project_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -64171,7 +64148,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/postalCodes/{code}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64416,7 +64393,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/postalCodes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64651,7 +64628,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/browsers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64888,7 +64865,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65170,7 +65147,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65283,7 +65260,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -65462,7 +65439,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65730,7 +65707,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66008,7 +65985,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66409,7 +66386,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66522,7 +66499,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -66816,7 +66793,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67082,7 +67059,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67360,7 +67337,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.5/userprofiles/{profileId}/placements/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67795,3 +67772,4 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/dfareporting2d6-cli/Cargo.toml b/gen/dfareporting2d6-cli/Cargo.toml index 898c7c608f..db2ed10aa0 100644 --- a/gen/dfareporting2d6-cli/Cargo.toml +++ b/gen/dfareporting2d6-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-dfareporting2d6-cli" -version = "1.0.4+20161027" +version = "1.0.4+20170428" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.6)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d6-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-dfareporting2d6] path = "../dfareporting2d6" -version = "1.0.4+20161027" +version = "1.0.4+20170428" diff --git a/gen/dfareporting2d6-cli/README.md b/gen/dfareporting2d6-cli/README.md index 126f80bb41..9647fad993 100644 --- a/gen/dfareporting2d6-cli/README.md +++ b/gen/dfareporting2d6-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 *20161027*. The CLI is at version *1.0.4*. +This documentation was generated from the *dfareporting* API at revision *20170428*. The CLI is at version *1.0.4*. ```bash dfareporting2d6 [options] diff --git a/gen/dfareporting2d6-cli/mkdocs.yml b/gen/dfareporting2d6-cli/mkdocs.yml index 00c0829a33..0ad8085cb3 100644 --- a/gen/dfareporting2d6-cli/mkdocs.yml +++ b/gen/dfareporting2d6-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dfareporting v1.0.4+20161027 +site_name: dfareporting v1.0.4+20170428 site_url: http://byron.github.io/google-apis-rs/google-dfareporting2d6-cli site_description: A complete library to interact with dfareporting (protocol v2.6) diff --git a/gen/dfareporting2d6-cli/src/main.rs b/gen/dfareporting2d6-cli/src/main.rs index c8a2333636..775e5a5f59 100644 --- a/gen/dfareporting2d6-cli/src/main.rs +++ b/gen/dfareporting2d6-cli/src/main.rs @@ -23404,7 +23404,7 @@ fn main() { let mut app = App::new("dfareporting2d6") .author("Sebastian Thiel ") - .version("1.0.4+20161027") + .version("1.0.4+20170428") .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_dfareporting2d6_cli") .arg(Arg::with_name("url") diff --git a/gen/dfareporting2d6/Cargo.toml b/gen/dfareporting2d6/Cargo.toml index c120ea4da2..3c291240bc 100644 --- a/gen/dfareporting2d6/Cargo.toml +++ b/gen/dfareporting2d6/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dfareporting2d6" -version = "1.0.4+20161027" +version = "1.0.4+20170428" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.6)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d6" homepage = "https://developers.google.com/doubleclick-advertisers/" -documentation = "https://docs.rs/google-dfareporting2d6/1.0.4+20161027" +documentation = "https://docs.rs/google-dfareporting2d6/1.0.4+20170428" license = "MIT" keywords = ["dfareporting", "google", "protocol", "web", "api"] diff --git a/gen/dfareporting2d6/README.md b/gen/dfareporting2d6/README.md index 2881091934..0a8242945e 100644 --- a/gen/dfareporting2d6/README.md +++ b/gen/dfareporting2d6/README.md @@ -5,142 +5,142 @@ DO NOT EDIT ! --> The `google-dfareporting2d6` library allows access to all features of the *Google dfareporting* service. -This documentation was generated from *dfareporting* crate version *1.0.4+20161027*, where *20161027* is the exact revision of the *dfareporting:v2.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *dfareporting* crate version *1.0.4+20170428*, where *20170428* is the exact revision of the *dfareporting:v2.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *dfareporting* *v2d6* 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-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Dfareporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Dfareporting.html) ... -* [account active ad summaries](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountActiveAdSummary.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountActiveAdSummaryGetCall.html) -* [account permission groups](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountPermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountPermissionGroupListCall.html) -* [account permissions](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountPermission.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountPermissionListCall.html) -* [account user profiles](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountUserProfile.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountUserProfileUpdateCall.html) -* [accounts](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Account.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AccountUpdateCall.html) -* [ads](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Ad.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdUpdateCall.html) -* [advertiser groups](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserGroup.html) - * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserGroupUpdateCall.html) -* [advertisers](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Advertiser.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.AdvertiserUpdateCall.html) -* [browsers](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Browser.html) - * [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.BrowserListCall.html) -* [campaign creative associations](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CampaignCreativeAssociation.html) - * [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CampaignCreativeAssociationListCall.html) -* [campaigns](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Campaign.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CampaignUpdateCall.html) -* [change logs](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ChangeLog.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ChangeLogListCall.html) -* [cities](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.City.html) - * [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CityListCall.html) -* [connection types](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ConnectionType.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ConnectionTypeListCall.html) -* [content categories](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ContentCategory.html) - * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ContentCategoryUpdateCall.html) -* [conversions](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Conversion.html) - * [*batchinsert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ConversionBatchinsertCall.html) -* [countries](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Country.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CountryListCall.html) -* [creative assets](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeAsset.html) - * [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeAssetInsertCall.html) -* [creative field values](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldValue.html) - * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldValueUpdateCall.html) -* [creative fields](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeField.html) - * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeFieldUpdateCall.html) -* [creative groups](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeGroupUpdateCall.html) -* [creatives](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Creative.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeUpdateCall.html) -* [dimension values](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DimensionValue.html) - * [*query*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DimensionValueQueryCall.html) -* [directory site contacts](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DirectorySiteContact.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DirectorySiteContactListCall.html) -* [directory sites](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DirectorySite.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DirectorySiteListCall.html) -* [dynamic targeting keys](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DynamicTargetingKey.html) - * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.DynamicTargetingKeyListCall.html) -* [event tags](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.EventTag.html) - * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.EventTagUpdateCall.html) -* [files](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.File.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FileListCall.html) -* [floodlight activities](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivity.html) - * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityUpdateCall.html) -* [floodlight activity groups](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightActivityGroupUpdateCall.html) -* [floodlight configurations](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightConfiguration.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FloodlightConfigurationUpdateCall.html) -* [inventory items](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.InventoryItem.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.InventoryItemListCall.html) -* [landing pages](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.LandingPage.html) - * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.LandingPageUpdateCall.html) -* [languages](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Language.html) - * [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.LanguageListCall.html) -* [metros](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Metro.html) - * [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.MetroListCall.html) -* [mobile carriers](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.MobileCarrier.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.MobileCarrierListCall.html) -* [operating system versions](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OperatingSystemVersion.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OperatingSystemVersionListCall.html) -* [operating systems](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OperatingSystem.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OperatingSystemListCall.html) -* [order documents](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OrderDocument.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OrderDocumentListCall.html) -* [orders](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Order.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.OrderListCall.html) -* [placement groups](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementGroupUpdateCall.html) -* [placement strategies](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementStrategy.html) - * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementStrategyUpdateCall.html) -* [placements](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Placement.html) - * [*generatetags*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlacementUpdateCall.html) -* [platform types](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlatformType.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PlatformTypeListCall.html) -* [postal codes](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PostalCode.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.PostalCodeListCall.html) -* [projects](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Project.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ProjectListCall.html) -* [regions](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Region.html) - * [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RegionListCall.html) -* [remarketing list shares](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RemarketingListShare.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RemarketingListShareUpdateCall.html) -* [remarketing lists](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.RemarketingListUpdateCall.html) -* [reports](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Report.html) - * [*compatible fields query*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportUpdateCall.html) -* [sites](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Site.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SiteUpdateCall.html) -* [sizes](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Size.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SizeListCall.html) -* [subaccounts](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Subaccount.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.SubaccountUpdateCall.html) -* [targetable remarketing lists](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.TargetableRemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.TargetableRemarketingListListCall.html) -* [targeting templates](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.TargetingTemplate.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.TargetingTemplateUpdateCall.html) -* [user profiles](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserProfile.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserProfileListCall.html) -* [user role permission groups](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRolePermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRolePermissionGroupListCall.html) -* [user role permissions](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRolePermission.html) - * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRolePermissionListCall.html) -* [user roles](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRole.html) - * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.UserRoleUpdateCall.html) +* [account active ad summaries](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserGroupUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ConversionBatchinsertCall.html) +* [countries](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DimensionValueQueryCall.html) +* [directory site contacts](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DirectorySiteContact.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DirectorySiteContactListCall.html) +* [directory sites](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.InventoryItemListCall.html) +* [landing pages](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.LandingPage.html) + * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.LandingPageUpdateCall.html) +* [languages](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Language.html) + * [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.LanguageListCall.html) +* [metros](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.MetroListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.TargetableRemarketingListListCall.html) +* [targeting templates](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.TargetingTemplate.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.TargetingTemplateUpdateCall.html) +* [user profiles](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.UserRoleUpdateCall.html) Upload supported by ... -* [*insert creative assets*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.CreativeAssetInsertCall.html) +* [*insert creative assets*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.CreativeAssetInsertCall.html) Download supported by ... -* [*get files*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.FileGetCall.html) -* [*files get reports*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.ReportFileGetCall.html) +* [*get files*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.ReportFileGetCall.html) @@ -148,17 +148,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/struct.Dfareporting.html)** +* **[Hub](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/struct.Dfareporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.Part.html)** + * **[Parts](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -254,17 +254,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/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-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/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-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/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-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/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")`. @@ -274,29 +274,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-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/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-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/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-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/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-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/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-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/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-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/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-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/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-dfareporting2d6/1.0.4+20161027/google_dfareporting2d6/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dfareporting2d6/1.0.4+20170428/google_dfareporting2d6/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/dfareporting2d6/src/lib.rs b/gen/dfareporting2d6/src/lib.rs index fe2e229dc5..415faa6943 100644 --- a/gen/dfareporting2d6/src/lib.rs +++ b/gen/dfareporting2d6/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.4+20161027*, where *20161027* is the exact revision of the *dfareporting:v2.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *dfareporting* crate version *1.0.4+20170428*, where *20170428* is the exact revision of the *dfareporting:v2.6* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *dfareporting* *v2d6* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-advertisers/). @@ -309,7 +309,7 @@ // 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 +// 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)] @@ -447,8 +447,6 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -461,8 +459,6 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/dfareporting/v2.6/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -653,26 +649,6 @@ impl<'a, C, A> Dfareporting self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/dfareporting/v2.6/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1056,10 +1032,10 @@ impl ResponseResult for AccountActiveAdSummary {} /// #[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. + /// 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. + /// 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, } @@ -1405,7 +1381,7 @@ impl Part for ListPopulationRule {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Account { - /// File size limit in kilobytes of Rich Media teaser creatives. Must be between 1 and 10240. + /// 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. @@ -1452,7 +1428,7 @@ pub struct Account { 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. + /// 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. @@ -1512,7 +1488,8 @@ pub struct Account { /// - "45" for RUB /// - "46" for AED /// - "47" for BGN - /// - "48" for HRK + /// - "48" for HRK + /// - "49" for MXN #[serde(rename="currencyId")] pub currency_id: Option, /// Reporting configuration of this account. @@ -1546,7 +1523,7 @@ pub struct DayPartTargeting { /// - "SATURDAY" #[serde(rename="daysOfWeek")] pub days_of_week: Option>, - /// Hours of the day when the ad will serve. Must be an integer between 0 and 23 (inclusive), 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. + /// 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. @@ -1796,7 +1773,7 @@ impl ResponseResult for FloodlightActivityGroup {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AudienceSegment { - /// Weight allocated to this segment. Must be between 1 and 1000. The weight assigned will be understood in proportion to the weights assigned to other segments in the same segment group. + /// 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, @@ -2110,6 +2087,8 @@ pub struct Placement { /// - "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" @@ -2268,7 +2247,7 @@ pub struct OptimizationActivity { /// 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. Must be greater than 1. The weight assigned will be understood in proportion to the weights assigned to the other optimization activities. + /// 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, } @@ -2361,9 +2340,9 @@ impl Part for CompanionClickThroughOverride {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FrequencyCap { - /// Duration of time, in seconds, for this frequency cap. The maximum duration is 90 days in seconds, or 7,776,000. + /// 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. The maximum allowed is 15. + /// 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, } @@ -2631,15 +2610,16 @@ impl Part for DirectorySiteContactAssignment {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreativeAssignment { - /// Weight of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_RANDOM. + /// 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. + /// 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 @@ -2648,7 +2628,6 @@ pub struct CreativeAssignment { /// - RICH_MEDIA_MOBILE_IN_APP /// - RICH_MEDIA_MULTI_FLOATING /// - RICH_MEDIA_PEEL_DOWN - /// - ADVANCED_BANNER /// - VPAID_LINEAR /// - VPAID_NON_LINEAR #[serde(rename="richMediaExitOverrides")] @@ -3025,7 +3004,7 @@ pub struct CreativeAsset { /// 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. + /// 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")] @@ -3098,7 +3077,7 @@ pub struct CreativeAsset { /// 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. This is a read-only field. 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. + /// zIndex value of an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to 999999999, inclusive. #[serde(rename="zIndex")] pub z_index: Option, /// Rich media child asset type. This is a read-only field. Applicable to the following creative types: all VPAID. @@ -3110,7 +3089,7 @@ pub struct CreativeAsset { /// 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. Must be between 0 and 9.99. 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. + /// 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. @@ -3123,7 +3102,7 @@ pub struct CreativeAsset { 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. + /// 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. @@ -3368,14 +3347,14 @@ impl Part for OrderContact {} 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. + /// Country ID of this directory site. This is a read-only field. #[serde(rename="countryId")] pub country_id: Option, - /// Description of this directory site. + /// 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. + /// Currency ID of this directory site. This is a read-only field. /// Possible values are: /// - "1" for USD /// - "2" for GBP @@ -3423,7 +3402,8 @@ pub struct DirectorySite { /// - "45" for RUB /// - "46" for AED /// - "47" for BGN - /// - "48" for HRK + /// - "48" for HRK + /// - "49" for MXN #[serde(rename="currencyId")] pub currency_id: Option, /// Tag types for regular placements. @@ -3509,10 +3489,7 @@ pub struct CreativeGroup { 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 one of the following subgroups 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 - /// - 2 + /// 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. @@ -4421,7 +4398,7 @@ pub struct DeliverySchedule { /// 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. Must be between 1 and 10. + /// 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, } @@ -4795,10 +4772,10 @@ pub struct TagData { /// Tag string for serving an ad. #[serde(rename="impressionTag")] pub impression_tag: Option, - /// Creative associated with this placement tag. + /// 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. + /// 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. @@ -4977,7 +4954,7 @@ pub struct RemarketingList { /// 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. + /// 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. @@ -5033,7 +5010,7 @@ pub struct FloodlightActivity { /// Advertiser ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's advertiser or the existing activity's advertiser. #[serde(rename="advertiserId")] pub advertiser_id: Option, - /// Code type used for cache busting in the generated tag. + /// Code type used for cache busting in the generated tag. Applicable only when floodlightActivityGroupType is COUNTER and countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING. #[serde(rename="cacheBustingType")] pub cache_busting_type: Option, /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. @@ -5533,11 +5510,11 @@ impl ResponseResult for LandingPage {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Size { - /// Width of this 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. + /// 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, @@ -6429,7 +6406,7 @@ impl Part for ReportFloodlightCriteriaReportProperties {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ConversionsBatchInsertResponse { - /// The status of each conversion's insertion status. The status is returned in the same order that conversions are inserted. + /// 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")] @@ -6934,12 +6911,12 @@ impl ResponseResult for Ad {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PricingSchedulePricingPeriod { - /// Units of this pricing period. + /// 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. + /// 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. @@ -14082,7 +14059,7 @@ impl<'a, C, A> ConversionBatchinsertCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/platformTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15070,7 +15047,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/platformTypes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15309,7 +15286,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15617,7 +15594,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15740,7 +15717,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut self._project_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -15935,7 +15912,7 @@ impl<'a, C, A> CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creativeFields".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16346,7 +16323,7 @@ impl<'a, C, A> CreativeFieldListCall<'a, C, A> where C: BorrowMut self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -16520,7 +16497,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creativeFields/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17009,7 +16986,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17814,7 +17791,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18066,7 +18043,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18326,7 +18303,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18570,7 +18547,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18881,7 +18858,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19001,7 +18978,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: self._subaccount_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -19175,7 +19152,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19923,7 +19900,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20194,7 +20171,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20448,7 +20425,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20728,7 +20705,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21010,7 +20987,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21268,9 +21245,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21942,7 +21919,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22065,7 +22042,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< self._campaign_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -22264,7 +22241,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/changeLogs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22574,7 +22551,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/changeLogs/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22821,7 +22798,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}/run".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -23878,7 +23855,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24169,7 +24146,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24449,7 +24426,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24717,7 +24694,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24993,7 +24970,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25524,7 +25501,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25780,7 +25757,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26040,7 +26017,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26317,7 +26294,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26585,7 +26562,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26920,7 +26897,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27047,7 +27024,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A self._status = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -27249,7 +27226,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27510,7 +27487,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/advertisers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27772,7 +27749,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> { @@ -28923,7 +28900,7 @@ impl<'a, C, A> FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/metros".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29724,7 +29701,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29847,7 +29824,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau self._project_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -30024,7 +30001,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() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30279,7 +30256,7 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/languages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/languages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30516,7 +30493,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> { @@ -31084,7 +31061,7 @@ impl<'a, C, A> UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31288,7 +31265,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31532,7 +31509,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -31808,7 +31785,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32207,7 +32184,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32342,7 +32319,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 self._ssl_compliant = Some(new_value); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -32622,7 +32599,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/ads/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32874,7 +32851,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33135,7 +33112,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/connectionTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -34129,7 +34106,7 @@ impl<'a, C, A> TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> { @@ -34418,7 +34395,7 @@ impl<'a, C, A> TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> { @@ -35227,7 +35204,7 @@ impl<'a, C, A> AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36534,7 +36511,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36860,7 +36837,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36987,7 +36964,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut self._subaccount_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -37210,7 +37187,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37478,7 +37455,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37749,7 +37726,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> { @@ -38398,7 +38375,7 @@ impl<'a, C, A> FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/regions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -39926,7 +39903,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creativeGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40439,7 +40416,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creativeGroups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40855,7 +40832,7 @@ impl<'a, C, A> CreativeGroupListCall<'a, C, A> where C: BorrowMut self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -41044,7 +41021,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetingTemplatePatchCall<'a, C, A> where C: BorrowMut TargetingTemplateListCall<'a, C, A> where C: BorrowMut TargetingTemplateListCall<'a, C, A> where C: BorrowMut TargetingTemplateListCall<'a, C, A> { @@ -41915,7 +41892,7 @@ impl<'a, C, A> TargetingTemplateGetCall<'a, C, A> where C: BorrowMut TargetingTemplateInsertCall<'a, C, A> where C: BorrowMut TargetingTemplateUpdateCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -42977,7 +42954,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43243,7 +43220,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43534,7 +43511,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43647,7 +43624,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -43814,7 +43791,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/subaccounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44061,7 +44038,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44306,7 +44283,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/mobileCarriers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44543,7 +44520,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -46382,7 +46359,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -46738,7 +46715,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupListCall<'a, C, A> { @@ -47121,7 +47098,7 @@ impl<'a, C, A> PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placementGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -47902,7 +47879,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -48354,7 +48331,7 @@ impl<'a, C, A> InventoryItemListCall<'a, C, A> where C: BorrowMut self._type_ = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -48539,7 +48516,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -48796,7 +48773,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> { @@ -50090,7 +50067,7 @@ impl<'a, C, A> ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51649,7 +51626,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51910,7 +51887,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creatives/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52247,7 +52224,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52375,7 +52352,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: self._studio_creative_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -52609,7 +52586,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52880,7 +52857,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53136,7 +53113,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53424,7 +53401,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53700,7 +53677,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54032,7 +54009,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54152,7 +54129,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: self._subaccount_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -54363,7 +54340,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54652,7 +54629,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54765,7 +54742,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -54966,7 +54943,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55234,7 +55211,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55510,7 +55487,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55771,7 +55748,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56018,7 +55995,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> { @@ -56869,7 +56846,7 @@ impl<'a, C, A> RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/cities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -57703,7 +57680,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> { @@ -58520,7 +58497,7 @@ impl<'a, C, A> PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59451,7 +59428,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -59626,7 +59603,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/projects/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59878,7 +59855,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/directorySites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60317,7 +60294,7 @@ impl<'a, C, A> DirectorySiteListCall<'a, C, A> where C: BorrowMut self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -60533,7 +60510,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/directorySites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60783,7 +60760,7 @@ impl<'a, C, A> DynamicTargetingKeyDeleteCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyListCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyInsertCall<'a, C, A> where C: BorrowMut SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61878,7 +61855,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62144,7 +62121,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/sizes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62391,7 +62368,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> { @@ -63255,7 +63232,7 @@ impl<'a, C, A> AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/countries".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64276,7 +64253,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/countries/{dartId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64532,7 +64509,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> { @@ -66198,7 +66175,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/postalCodes/{code}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66443,7 +66420,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/postalCodes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66678,7 +66655,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/browsers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -66915,7 +66892,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67197,7 +67174,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67310,7 +67287,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -67489,7 +67466,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67757,7 +67734,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68035,7 +68012,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68436,7 +68413,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68549,7 +68526,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -68838,7 +68815,7 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placements/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69090,7 +69067,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69356,7 +69333,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.6/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69634,7 +69611,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGeneratetagCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with dfareporting (protocol v2.7)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d7-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-dfareporting2d7] path = "../dfareporting2d7" -version = "1.0.4+20161027" +version = "1.0.4+20170428" diff --git a/gen/dfareporting2d7-cli/README.md b/gen/dfareporting2d7-cli/README.md index 7ec5fe4307..6aaae4ab16 100644 --- a/gen/dfareporting2d7-cli/README.md +++ b/gen/dfareporting2d7-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *dfareporting* API at revision *20161027*. The CLI is at version *1.0.4*. +This documentation was generated from the *dfareporting* API at revision *20170428*. The CLI is at version *1.0.4*. ```bash dfareporting2d7 [options] diff --git a/gen/dfareporting2d7-cli/mkdocs.yml b/gen/dfareporting2d7-cli/mkdocs.yml index fca5e9a4d7..114da68483 100644 --- a/gen/dfareporting2d7-cli/mkdocs.yml +++ b/gen/dfareporting2d7-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dfareporting v1.0.4+20161027 +site_name: dfareporting v1.0.4+20170428 site_url: http://byron.github.io/google-apis-rs/google-dfareporting2d7-cli site_description: A complete library to interact with dfareporting (protocol v2.7) diff --git a/gen/dfareporting2d7-cli/src/main.rs b/gen/dfareporting2d7-cli/src/main.rs index 80452151f8..941da2e1ee 100644 --- a/gen/dfareporting2d7-cli/src/main.rs +++ b/gen/dfareporting2d7-cli/src/main.rs @@ -20403,7 +20403,7 @@ fn main() { ("files", "methods: 'get' and 'list'", vec![ ("get", - Some(r##"Retrieves a report file by its report ID and file ID."##), + 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_dfareporting2d7_cli/files_get", vec![ (Some(r##"report-id"##), @@ -22455,7 +22455,7 @@ fn main() { Some(true)), ]), ("files-get", - Some(r##"Retrieves a report file."##), + Some(r##"Retrieves a report file. This method supports media download."##), "Details at http://byron.github.io/google-apis-rs/google_dfareporting2d7_cli/reports_files-get", vec![ (Some(r##"profile-id"##), @@ -23630,7 +23630,7 @@ fn main() { let mut app = App::new("dfareporting2d7") .author("Sebastian Thiel ") - .version("1.0.4+20161027") + .version("1.0.4+20170428") .about("Manages your DoubleClick Campaign Manager ad campaigns and reports.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_dfareporting2d7_cli") .arg(Arg::with_name("url") diff --git a/gen/dfareporting2d7/Cargo.toml b/gen/dfareporting2d7/Cargo.toml index a9e71718d1..253fd6cf7d 100644 --- a/gen/dfareporting2d7/Cargo.toml +++ b/gen/dfareporting2d7/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dfareporting2d7" -version = "1.0.4+20161027" +version = "1.0.4+20170428" authors = ["Sebastian Thiel "] description = "A complete library to interact with dfareporting (protocol v2.7)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/dfareporting2d7" homepage = "https://developers.google.com/doubleclick-advertisers/" -documentation = "https://docs.rs/google-dfareporting2d7/1.0.4+20161027" +documentation = "https://docs.rs/google-dfareporting2d7/1.0.4+20170428" license = "MIT" keywords = ["dfareporting", "google", "protocol", "web", "api"] diff --git a/gen/dfareporting2d7/README.md b/gen/dfareporting2d7/README.md index eebd31e5e8..d6e26d6d35 100644 --- a/gen/dfareporting2d7/README.md +++ b/gen/dfareporting2d7/README.md @@ -5,144 +5,144 @@ DO NOT EDIT ! --> The `google-dfareporting2d7` library allows access to all features of the *Google dfareporting* service. -This documentation was generated from *dfareporting* crate version *1.0.4+20161027*, where *20161027* is the exact revision of the *dfareporting:v2.7* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *dfareporting* crate version *1.0.4+20170428*, where *20170428* is the exact revision of the *dfareporting:v2.7* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *dfareporting* *v2d7* API can be found at the [official documentation site](https://developers.google.com/doubleclick-advertisers/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Dfareporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Dfareporting.html) ... -* [account active ad summaries](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountActiveAdSummary.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountActiveAdSummaryGetCall.html) -* [account permission groups](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountPermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountPermissionGroupListCall.html) -* [account permissions](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountPermission.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountPermissionListCall.html) -* [account user profiles](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountUserProfile.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountUserProfileUpdateCall.html) -* [accounts](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Account.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AccountUpdateCall.html) -* [ads](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Ad.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdUpdateCall.html) -* [advertiser groups](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserGroup.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserGroupUpdateCall.html) -* [advertisers](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Advertiser.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.AdvertiserUpdateCall.html) -* [browsers](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Browser.html) - * [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.BrowserListCall.html) -* [campaign creative associations](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CampaignCreativeAssociation.html) - * [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CampaignCreativeAssociationListCall.html) -* [campaigns](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Campaign.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CampaignUpdateCall.html) -* [change logs](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ChangeLog.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ChangeLogListCall.html) -* [cities](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.City.html) - * [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CityListCall.html) -* [connection types](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ConnectionType.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ConnectionTypeListCall.html) -* [content categories](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ContentCategory.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ContentCategoryUpdateCall.html) -* [conversions](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Conversion.html) - * [*batchinsert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ConversionBatchinsertCall.html) -* [countries](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Country.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CountryListCall.html) -* [creative assets](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeAsset.html) - * [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeAssetInsertCall.html) -* [creative field values](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldValue.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldValueUpdateCall.html) -* [creative fields](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeField.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeFieldUpdateCall.html) -* [creative groups](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeGroupUpdateCall.html) -* [creatives](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Creative.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeUpdateCall.html) -* [dimension values](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DimensionValue.html) - * [*query*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DimensionValueQueryCall.html) -* [directory site contacts](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DirectorySiteContact.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DirectorySiteContactListCall.html) -* [directory sites](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DirectorySite.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DirectorySiteListCall.html) -* [dynamic targeting keys](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DynamicTargetingKey.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.DynamicTargetingKeyListCall.html) -* [event tags](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.EventTag.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.EventTagUpdateCall.html) -* [files](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.File.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FileListCall.html) -* [floodlight activities](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivity.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityUpdateCall.html) -* [floodlight activity groups](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightActivityGroupUpdateCall.html) -* [floodlight configurations](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightConfiguration.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FloodlightConfigurationUpdateCall.html) -* [inventory items](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.InventoryItem.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.InventoryItemListCall.html) -* [landing pages](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.LandingPage.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.LandingPageUpdateCall.html) -* [languages](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Language.html) - * [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.LanguageListCall.html) -* [metros](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Metro.html) - * [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.MetroListCall.html) -* [mobile carriers](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.MobileCarrier.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.MobileCarrierListCall.html) -* [operating system versions](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OperatingSystemVersion.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OperatingSystemVersionListCall.html) -* [operating systems](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OperatingSystem.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OperatingSystemListCall.html) -* [order documents](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OrderDocument.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OrderDocumentListCall.html) -* [orders](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Order.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.OrderListCall.html) -* [placement groups](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementGroupUpdateCall.html) -* [placement strategies](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementStrategy.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementStrategyUpdateCall.html) -* [placements](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Placement.html) - * [*generatetags*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlacementUpdateCall.html) -* [platform types](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlatformType.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PlatformTypeListCall.html) -* [postal codes](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PostalCode.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.PostalCodeListCall.html) -* [projects](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Project.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ProjectListCall.html) -* [regions](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Region.html) - * [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RegionListCall.html) -* [remarketing list shares](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RemarketingListShare.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RemarketingListShareUpdateCall.html) -* [remarketing lists](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.RemarketingListUpdateCall.html) -* [reports](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Report.html) - * [*compatible fields query*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportUpdateCall.html) -* [sites](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Site.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SiteUpdateCall.html) -* [sizes](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Size.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SizeListCall.html) -* [subaccounts](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Subaccount.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.SubaccountUpdateCall.html) -* [targetable remarketing lists](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.TargetableRemarketingList.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.TargetableRemarketingListListCall.html) -* [targeting templates](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.TargetingTemplate.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.TargetingTemplateUpdateCall.html) -* [user profiles](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserProfile.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserProfileListCall.html) -* [user role permission groups](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRolePermissionGroup.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRolePermissionGroupListCall.html) -* [user role permissions](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRolePermission.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRolePermissionListCall.html) -* [user roles](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRole.html) - * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.UserRoleUpdateCall.html) -* [video formats](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.VideoFormat.html) - * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.VideoFormatListCall.html) +* [account active ad summaries](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountActiveAdSummary.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountActiveAdSummaryGetCall.html) +* [account permission groups](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountPermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountPermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountPermissionGroupListCall.html) +* [account permissions](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountPermission.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountPermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountPermissionListCall.html) +* [account user profiles](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountUserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountUserProfileGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountUserProfileInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountUserProfileListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountUserProfilePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountUserProfileUpdateCall.html) +* [accounts](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Account.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountGetCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AccountUpdateCall.html) +* [ads](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Ad.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdUpdateCall.html) +* [advertiser groups](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserGroup.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserGroupDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserGroupUpdateCall.html) +* [advertisers](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Advertiser.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.AdvertiserUpdateCall.html) +* [browsers](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Browser.html) + * [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.BrowserListCall.html) +* [campaign creative associations](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CampaignCreativeAssociation.html) + * [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CampaignCreativeAssociationInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CampaignCreativeAssociationListCall.html) +* [campaigns](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Campaign.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CampaignGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CampaignInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CampaignListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CampaignPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CampaignUpdateCall.html) +* [change logs](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ChangeLog.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ChangeLogGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ChangeLogListCall.html) +* [cities](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.City.html) + * [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CityListCall.html) +* [connection types](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ConnectionType.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ConnectionTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ConnectionTypeListCall.html) +* [content categories](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ContentCategory.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ContentCategoryDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ContentCategoryGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ContentCategoryInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ContentCategoryListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ContentCategoryPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ContentCategoryUpdateCall.html) +* [conversions](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Conversion.html) + * [*batchinsert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ConversionBatchinsertCall.html) +* [countries](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Country.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CountryGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CountryListCall.html) +* [creative assets](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeAsset.html) + * [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeAssetInsertCall.html) +* [creative field values](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldValue.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldValueDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldValueGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldValueInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldValueListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldValuePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldValueUpdateCall.html) +* [creative fields](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeField.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeFieldUpdateCall.html) +* [creative groups](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeGroupUpdateCall.html) +* [creatives](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Creative.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeUpdateCall.html) +* [dimension values](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DimensionValue.html) + * [*query*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DimensionValueQueryCall.html) +* [directory site contacts](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DirectorySiteContact.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DirectorySiteContactGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DirectorySiteContactListCall.html) +* [directory sites](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DirectorySite.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DirectorySiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DirectorySiteInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DirectorySiteListCall.html) +* [dynamic targeting keys](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DynamicTargetingKey.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DynamicTargetingKeyDeleteCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DynamicTargetingKeyInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.DynamicTargetingKeyListCall.html) +* [event tags](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.EventTag.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.EventTagDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.EventTagGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.EventTagInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.EventTagListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.EventTagPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.EventTagUpdateCall.html) +* [files](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.File.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FileListCall.html) +* [floodlight activities](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivity.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityDeleteCall.html), [*generatetag*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityUpdateCall.html) +* [floodlight activity groups](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightActivityGroupUpdateCall.html) +* [floodlight configurations](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightConfiguration.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightConfigurationGetCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightConfigurationListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightConfigurationPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FloodlightConfigurationUpdateCall.html) +* [inventory items](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.InventoryItem.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.InventoryItemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.InventoryItemListCall.html) +* [landing pages](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.LandingPage.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.LandingPageDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.LandingPageGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.LandingPageInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.LandingPageListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.LandingPagePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.LandingPageUpdateCall.html) +* [languages](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Language.html) + * [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.LanguageListCall.html) +* [metros](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Metro.html) + * [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.MetroListCall.html) +* [mobile carriers](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.MobileCarrier.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.MobileCarrierGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.MobileCarrierListCall.html) +* [operating system versions](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OperatingSystemVersion.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OperatingSystemVersionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OperatingSystemVersionListCall.html) +* [operating systems](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OperatingSystem.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OperatingSystemGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OperatingSystemListCall.html) +* [order documents](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OrderDocument.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OrderDocumentGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OrderDocumentListCall.html) +* [orders](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Order.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OrderGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.OrderListCall.html) +* [placement groups](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementGroupGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementGroupInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementGroupListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementGroupPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementGroupUpdateCall.html) +* [placement strategies](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementStrategy.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementStrategyDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementStrategyGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementStrategyInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementStrategyListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementStrategyPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementStrategyUpdateCall.html) +* [placements](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Placement.html) + * [*generatetags*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementGeneratetagCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlacementUpdateCall.html) +* [platform types](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlatformType.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlatformTypeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PlatformTypeListCall.html) +* [postal codes](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PostalCode.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PostalCodeGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.PostalCodeListCall.html) +* [projects](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Project.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ProjectGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ProjectListCall.html) +* [regions](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Region.html) + * [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RegionListCall.html) +* [remarketing list shares](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RemarketingListShare.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RemarketingListShareGetCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RemarketingListSharePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RemarketingListShareUpdateCall.html) +* [remarketing lists](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RemarketingListGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RemarketingListInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RemarketingListListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RemarketingListPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.RemarketingListUpdateCall.html) +* [reports](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Report.html) + * [*compatible fields query*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportCompatibleFieldQueryCall.html), [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportDeleteCall.html), [*files get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportFileGetCall.html), [*files list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportFileListCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportPatchCall.html), [*run*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportRunCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportUpdateCall.html) +* [sites](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Site.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SiteGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SiteInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SiteListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SitePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SiteUpdateCall.html) +* [sizes](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Size.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SizeGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SizeInsertCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SizeListCall.html) +* [subaccounts](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Subaccount.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SubaccountGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SubaccountInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SubaccountListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SubaccountPatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.SubaccountUpdateCall.html) +* [targetable remarketing lists](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.TargetableRemarketingList.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.TargetableRemarketingListGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.TargetableRemarketingListListCall.html) +* [targeting templates](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.TargetingTemplate.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.TargetingTemplateGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.TargetingTemplateInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.TargetingTemplateListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.TargetingTemplatePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.TargetingTemplateUpdateCall.html) +* [user profiles](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserProfile.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserProfileGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserProfileListCall.html) +* [user role permission groups](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRolePermissionGroup.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRolePermissionGroupGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRolePermissionGroupListCall.html) +* [user role permissions](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRolePermission.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRolePermissionGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRolePermissionListCall.html) +* [user roles](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRole.html) + * [*delete*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRoleDeleteCall.html), [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRoleGetCall.html), [*insert*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRoleInsertCall.html), [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRoleListCall.html), [*patch*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRolePatchCall.html) and [*update*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.UserRoleUpdateCall.html) +* [video formats](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.VideoFormat.html) + * [*get*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.VideoFormatGetCall.html) and [*list*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.VideoFormatListCall.html) Upload supported by ... -* [*insert creative assets*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.CreativeAssetInsertCall.html) +* [*insert creative assets*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.CreativeAssetInsertCall.html) Download supported by ... -* [*get files*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.FileGetCall.html) -* [*files get reports*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.ReportFileGetCall.html) +* [*get files*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.FileGetCall.html) +* [*files get reports*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.ReportFileGetCall.html) @@ -150,17 +150,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/struct.Dfareporting.html)** +* **[Hub](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/struct.Dfareporting.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.Part.html)** + * **[Parts](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -256,17 +256,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.ResponseResult.html), it will return that by default. You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making this call: `.param("alt", "media")`. @@ -276,29 +276,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-dfareporting2d7/1.0.4+20161027/google_dfareporting2d7/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dfareporting2d7/1.0.4+20170428/google_dfareporting2d7/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/dfareporting2d7/src/lib.rs b/gen/dfareporting2d7/src/lib.rs index e02747c193..ae299f3c4a 100644 --- a/gen/dfareporting2d7/src/lib.rs +++ b/gen/dfareporting2d7/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *dfareporting* crate version *1.0.4+20161027*, where *20161027* is the exact revision of the *dfareporting:v2.7* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *dfareporting* crate version *1.0.4+20170428*, where *20170428* is the exact revision of the *dfareporting:v2.7* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *dfareporting* *v2d7* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-advertisers/). @@ -311,7 +311,7 @@ // 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 +// 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)] @@ -449,8 +449,6 @@ pub struct Dfareporting { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Dfareporting {} @@ -463,8 +461,6 @@ impl<'a, C, A> Dfareporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/dfareporting/v2.7/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -658,26 +654,6 @@ impl<'a, C, A> Dfareporting self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/dfareporting/v2.7/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1007,10 +983,10 @@ impl Part for EventTagOverride {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VideoOffset { - /// Duration, as a percentage of video duration. Do not set when offsetSeconds is set. + /// 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. + /// Duration, in seconds. Do not set when offsetPercentage is set. Acceptable values are 0 to 86399, inclusive. #[serde(rename="offsetSeconds")] pub offset_seconds: Option, } @@ -1078,10 +1054,10 @@ impl ResponseResult for AccountActiveAdSummary {} /// #[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. + /// 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. + /// 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, } @@ -1430,7 +1406,7 @@ impl Part for ListPopulationRule {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Account { - /// File size limit in kilobytes of Rich Media teaser creatives. Must be between 1 and 10240. + /// 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. @@ -1477,7 +1453,7 @@ pub struct Account { 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. + /// 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. @@ -1537,7 +1513,8 @@ pub struct Account { /// - "45" for RUB /// - "46" for AED /// - "47" for BGN - /// - "48" for HRK + /// - "48" for HRK + /// - "49" for MXN #[serde(rename="currencyId")] pub currency_id: Option, /// Reporting configuration of this account. @@ -1571,7 +1548,7 @@ pub struct DayPartTargeting { /// - "SATURDAY" #[serde(rename="daysOfWeek")] pub days_of_week: Option>, - /// Hours of the day when the ad will serve. Must be an integer between 0 and 23 (inclusive), 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. + /// 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. @@ -1821,7 +1798,7 @@ impl ResponseResult for FloodlightActivityGroup {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AudienceSegment { - /// Weight allocated to this segment. Must be between 1 and 1000. The weight assigned will be understood in proportion to the weights assigned to other segments in the same segment group. + /// 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, @@ -2180,6 +2157,8 @@ pub struct Placement { /// - "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" @@ -2341,7 +2320,7 @@ pub struct OptimizationActivity { /// 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. Must be greater than 1. The weight assigned will be understood in proportion to the weights assigned to the other optimization activities. + /// 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, } @@ -2434,9 +2413,9 @@ impl Part for CompanionClickThroughOverride {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FrequencyCap { - /// Duration of time, in seconds, for this frequency cap. The maximum duration is 90 days in seconds, or 7,776,000. + /// 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. The maximum allowed is 15. + /// 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, } @@ -2704,15 +2683,16 @@ impl Part for DirectorySiteContactAssignment {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreativeAssignment { - /// Weight of the creative assignment, applicable when the rotation type is CREATIVE_ROTATION_TYPE_RANDOM. + /// 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. + /// 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 @@ -2721,7 +2701,6 @@ pub struct CreativeAssignment { /// - RICH_MEDIA_MOBILE_IN_APP /// - RICH_MEDIA_MULTI_FLOATING /// - RICH_MEDIA_PEEL_DOWN - /// - ADVANCED_BANNER /// - VPAID_LINEAR /// - VPAID_NON_LINEAR #[serde(rename="richMediaExitOverrides")] @@ -3098,7 +3077,7 @@ pub struct CreativeAsset { /// 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. + /// 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")] @@ -3171,7 +3150,7 @@ pub struct CreativeAsset { /// 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. This is a read-only field. 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. + /// zIndex value of an asset. Applicable to the following creative types: all RICH_MEDIA.Additionally, only applicable to assets whose displayType is NOT one of the following types: ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable values are -999999999 to 999999999, inclusive. #[serde(rename="zIndex")] pub z_index: Option, /// Rich media child asset type. This is a read-only field. Applicable to the following creative types: all VPAID. @@ -3183,7 +3162,7 @@ pub struct CreativeAsset { /// 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. Must be between 0 and 9.99. 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. + /// 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. @@ -3196,7 +3175,7 @@ pub struct CreativeAsset { 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. + /// 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. @@ -3493,14 +3472,14 @@ impl Part for OrderContact {} 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. + /// Country ID of this directory site. This is a read-only field. #[serde(rename="countryId")] pub country_id: Option, - /// Description of this directory site. + /// 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. + /// Currency ID of this directory site. This is a read-only field. /// Possible values are: /// - "1" for USD /// - "2" for GBP @@ -3548,7 +3527,8 @@ pub struct DirectorySite { /// - "45" for RUB /// - "46" for AED /// - "47" for BGN - /// - "48" for HRK + /// - "48" for HRK + /// - "49" for MXN #[serde(rename="currencyId")] pub currency_id: Option, /// Tag types for regular placements. @@ -4557,7 +4537,7 @@ pub struct DeliverySchedule { /// 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. Must be between 1 and 10. + /// 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, } @@ -4931,10 +4911,10 @@ pub struct TagData { /// Tag string for serving an ad. #[serde(rename="impressionTag")] pub impression_tag: Option, - /// Creative associated with this placement tag. + /// 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. + /// 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. @@ -5113,7 +5093,7 @@ pub struct RemarketingList { /// 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. + /// 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. @@ -5169,7 +5149,7 @@ pub struct FloodlightActivity { /// Advertiser ID of this floodlight activity. If this field is left blank, the value will be copied over either from the activity group's advertiser or the existing activity's advertiser. #[serde(rename="advertiserId")] pub advertiser_id: Option, - /// Code type used for cache busting in the generated tag. + /// Code type used for cache busting in the generated tag. Applicable only when floodlightActivityGroupType is COUNTER and countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING. #[serde(rename="cacheBustingType")] pub cache_busting_type: Option, /// Dimension value for the ID of the advertiser. This is a read-only, auto-generated field. @@ -5661,11 +5641,11 @@ impl ResponseResult for LandingPage {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Size { - /// Width of this 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. + /// 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, @@ -5990,10 +5970,7 @@ pub struct CreativeGroup { 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 one of the following subgroups 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 - /// - 2 + /// 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. @@ -6601,7 +6578,7 @@ impl Part for ReportFloodlightCriteriaReportProperties {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ConversionsBatchInsertResponse { - /// The status of each conversion's insertion status. The status is returned in the same order that conversions are inserted. + /// 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")] @@ -7106,12 +7083,12 @@ impl ResponseResult for Ad {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PricingSchedulePricingPeriod { - /// Units of this pricing period. + /// 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. + /// 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. @@ -8948,7 +8925,7 @@ impl<'a, C, A> ReportMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a report file. + /// Retrieves a report file. This method supports media download. /// /// # Arguments /// @@ -11462,7 +11439,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Retrieves a report file by its report ID and file ID. + /// Retrieves a report file by its report ID and file ID. This method supports media download. /// /// # Arguments /// @@ -14330,7 +14307,7 @@ impl<'a, C, A> ConversionBatchinsertCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupGetCall<'a, C, A> where C: BorrowMut UserRolePermissionGroupListCall<'a, C, A> where C: BorrowMut PlatformTypeGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/platformTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15318,7 +15295,7 @@ impl<'a, C, A> PlatformTypeListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/platformTypes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/platformTypes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15557,7 +15534,7 @@ impl<'a, C, A> OrderDocumentGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15865,7 +15842,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orderDocuments"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/orderDocuments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -15988,7 +15965,7 @@ impl<'a, C, A> OrderDocumentListCall<'a, C, A> where C: BorrowMut self._project_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -16183,7 +16160,7 @@ impl<'a, C, A> CreativeFieldUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creativeFields".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -16594,7 +16571,7 @@ impl<'a, C, A> CreativeFieldListCall<'a, C, A> where C: BorrowMut self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -16768,7 +16745,7 @@ impl<'a, C, A> CreativeFieldDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeFields/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creativeFields/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -17257,7 +17234,7 @@ impl<'a, C, A> CreativeFieldInsertCall<'a, C, A> where C: BorrowMut CreativeFieldPatchCall<'a, C, A> where C: BorrowMut UserRoleInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18062,7 +18039,7 @@ impl<'a, C, A> UserRoleGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18314,7 +18291,7 @@ impl<'a, C, A> UserRoleUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18574,7 +18551,7 @@ impl<'a, C, A> UserRoleDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -18818,7 +18795,7 @@ impl<'a, C, A> UserRolePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19129,7 +19106,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/userRoles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/userRoles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -19249,7 +19226,7 @@ impl<'a, C, A> UserRoleListCall<'a, C, A> where C: BorrowMut, A: self._subaccount_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -19423,7 +19400,7 @@ impl<'a, C, A> OperatingSystemVersionGetCall<'a, C, A> where C: BorrowMut OperatingSystemVersionListCall<'a, C, A> where C: BorrowMut LandingPageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20171,7 +20148,7 @@ impl<'a, C, A> LandingPageUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20442,7 +20419,7 @@ impl<'a, C, A> LandingPageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20696,7 +20673,7 @@ impl<'a, C, A> LandingPageInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -20976,7 +20953,7 @@ impl<'a, C, A> LandingPagePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21258,7 +21235,7 @@ impl<'a, C, A> LandingPageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -21516,9 +21493,9 @@ impl<'a, C, A> CreativeAssetInsertCall<'a, C, A> where C: BorrowMut CampaignCreativeAssociationInsertCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22190,7 +22167,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22313,7 +22290,7 @@ impl<'a, C, A> CampaignCreativeAssociationListCall<'a, C, A> where C: BorrowMut< self._campaign_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -22512,7 +22489,7 @@ impl<'a, C, A> ChangeLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/changeLogs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -22822,7 +22799,7 @@ impl<'a, C, A> ChangeLogGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/changeLogs/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/changeLogs/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -23069,7 +23046,7 @@ impl<'a, C, A> RemarketingListShareGetCall<'a, C, A> where C: BorrowMut RemarketingListSharePatchCall<'a, C, A> where C: BorrowMut RemarketingListShareUpdateCall<'a, C, A> where C: BorrowMut ReportRunCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/run"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}/run".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24126,7 +24103,7 @@ impl<'a, C, A> ReportPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24417,7 +24394,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24540,7 +24517,7 @@ impl<'a, C, A> ReportFileListCall<'a, C, A> where C: BorrowMut, A self._report_id = new_value.to_string(); self } - /// Order of sorted results, default is 'DESCENDING'. + /// 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> { @@ -24697,7 +24674,7 @@ impl<'a, C, A> ReportInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24963,7 +24940,7 @@ impl<'a, C, A> ReportCompatibleFieldQueryCall<'a, C, A> where C: BorrowMut ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25399,7 +25376,7 @@ impl<'a, C, A> ReportGetCall<'a, C, A> where C: BorrowMut, A: oau } -/// Retrieves a report file. +/// 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")`. @@ -25494,7 +25471,7 @@ impl<'a, C, A> ReportFileGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25750,7 +25727,7 @@ impl<'a, C, A> ReportDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25994,7 +25971,7 @@ impl<'a, C, A> ReportUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports/{reportId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26288,7 +26265,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/reports"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -26401,7 +26378,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is 'DESCENDING'. + /// 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> { @@ -26415,7 +26392,7 @@ impl<'a, C, A> ReportListCall<'a, C, A> where C: BorrowMut, A: oa self._sort_field = Some(new_value.to_string()); self } - /// The scope that defines which results are returned, default is 'MINE'. + /// 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> { @@ -26565,7 +26542,7 @@ impl<'a, C, A> AdvertiserInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -26833,7 +26810,7 @@ impl<'a, C, A> AdvertiserPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27168,7 +27145,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27295,7 +27272,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A self._status = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -27497,7 +27474,7 @@ impl<'a, C, A> AdvertiserUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/advertisers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -27758,7 +27735,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/advertisers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/advertisers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -28020,7 +27997,7 @@ impl<'a, C, A> DimensionValueQueryCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupGetCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupListCall<'a, C, A> { @@ -29171,7 +29148,7 @@ impl<'a, C, A> FloodlightActivityGroupInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityGroupUpdateCall<'a, C, A> where C: BorrowMut MetroListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/metros"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/metros".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -29972,7 +29949,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/orders"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/orders".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30095,7 +30072,7 @@ impl<'a, C, A> OrderListCall<'a, C, A> where C: BorrowMut, A: oau self._project_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -30272,7 +30249,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() + "userprofiles/{profileId}/projects/{projectId}/orders/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/orders/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30527,7 +30504,7 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/languages"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/languages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -30764,7 +30741,7 @@ impl<'a, C, A> DirectorySiteContactGetCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> where C: BorrowMut DirectorySiteContactListCall<'a, C, A> { @@ -31332,7 +31309,7 @@ impl<'a, C, A> UserProfileListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31536,7 +31513,7 @@ impl<'a, C, A> UserProfileGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -31780,7 +31757,7 @@ impl<'a, C, A> AdPatchCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32056,7 +32033,7 @@ impl<'a, C, A> AdInsertCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32450,7 +32427,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -32585,7 +32562,7 @@ impl<'a, C, A> AdListCall<'a, C, A> where C: BorrowMut, A: oauth2 self._ssl_compliant = Some(new_value); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -32858,7 +32835,7 @@ impl<'a, C, A> AdGetCall<'a, C, A> where C: BorrowMut, A: oauth2: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/ads/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33110,7 +33087,7 @@ impl<'a, C, A> AdUpdateCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/ads"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/ads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -33371,7 +33348,7 @@ impl<'a, C, A> AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut ConnectionTypeListCall<'a, C, A> where C: BorrowMut ConnectionTypeGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/connectionTypes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/connectionTypes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -34365,7 +34342,7 @@ impl<'a, C, A> TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> where C: BorrowMut TargetableRemarketingListListCall<'a, C, A> { @@ -34654,7 +34631,7 @@ impl<'a, C, A> TargetableRemarketingListGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupGetCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> where C: BorrowMut AdvertiserGroupListCall<'a, C, A> { @@ -35463,7 +35440,7 @@ impl<'a, C, A> AdvertiserGroupInsertCall<'a, C, A> where C: BorrowMut AdvertiserGroupUpdateCall<'a, C, A> where C: BorrowMut AdvertiserGroupPatchCall<'a, C, A> where C: BorrowMut AdvertiserGroupDeleteCall<'a, C, A> where C: BorrowMut SiteInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -36770,7 +36747,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37096,7 +37073,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37223,7 +37200,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut self._subaccount_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -37446,7 +37423,7 @@ impl<'a, C, A> SiteUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37714,7 +37691,7 @@ impl<'a, C, A> SitePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -37985,7 +37962,7 @@ impl<'a, C, A> FloodlightActivityGetCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> where C: BorrowMut FloodlightActivityListCall<'a, C, A> { @@ -38634,7 +38611,7 @@ impl<'a, C, A> FloodlightActivityInsertCall<'a, C, A> where C: BorrowMut FloodlightActivityDeleteCall<'a, C, A> where C: BorrowMut FloodlightActivityPatchCall<'a, C, A> where C: BorrowMut FloodlightActivityGeneratetagCall<'a, C, A> where C: BorrowMut FloodlightActivityUpdateCall<'a, C, A> where C: BorrowMut RegionListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/regions"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/regions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40162,7 +40139,7 @@ impl<'a, C, A> CreativeGroupInsertCall<'a, C, A> where C: BorrowMut CreativeGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creativeGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -40675,7 +40652,7 @@ impl<'a, C, A> CreativeGroupUpdateCall<'a, C, A> where C: BorrowMut CreativeGroupListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creativeGroups"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creativeGroups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -41091,7 +41068,7 @@ impl<'a, C, A> CreativeGroupListCall<'a, C, A> where C: BorrowMut self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -41280,7 +41257,7 @@ impl<'a, C, A> CreativeGroupPatchCall<'a, C, A> where C: BorrowMut TargetingTemplatePatchCall<'a, C, A> where C: BorrowMut TargetingTemplateListCall<'a, C, A> where C: BorrowMut TargetingTemplateListCall<'a, C, A> where C: BorrowMut TargetingTemplateListCall<'a, C, A> { @@ -42151,7 +42128,7 @@ impl<'a, C, A> TargetingTemplateGetCall<'a, C, A> where C: BorrowMut TargetingTemplateInsertCall<'a, C, A> where C: BorrowMut TargetingTemplateUpdateCall<'a, C, A> where C: BorrowMut SubaccountPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43213,7 +43190,7 @@ impl<'a, C, A> SubaccountInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43479,7 +43456,7 @@ impl<'a, C, A> SubaccountUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43770,7 +43747,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/subaccounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -43883,7 +43860,7 @@ impl<'a, C, A> SubaccountListCall<'a, C, A> where C: BorrowMut, A self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -44050,7 +44027,7 @@ impl<'a, C, A> SubaccountGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/subaccounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/subaccounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44297,7 +44274,7 @@ impl<'a, C, A> MobileCarrierGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/mobileCarriers/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44542,7 +44519,7 @@ impl<'a, C, A> MobileCarrierListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/mobileCarriers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/mobileCarriers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -44779,7 +44756,7 @@ impl<'a, C, A> FloodlightConfigurationGetCall<'a, C, A> where C: BorrowMut FloodlightConfigurationUpdateCall<'a, C, A> where C: BorrowMut FloodlightConfigurationPatchCall<'a, C, A> where C: BorrowMut FloodlightConfigurationListCall<'a, C, A> where C: BorrowMut OperatingSystemListCall<'a, C, A> where C: BorrowMut OperatingSystemGetCall<'a, C, A> where C: BorrowMut FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/files"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -46438,7 +46415,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is 'DESCENDING'. + /// 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> { @@ -46452,7 +46429,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut self._sort_field = Some(new_value.to_string()); self } - /// The scope that defines which results are returned, default is 'MINE'. + /// 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> { @@ -46525,7 +46502,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut } -/// Retrieves a report file by its report ID and file ID. +/// 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")`. @@ -46618,7 +46595,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{fileId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/reports/{reportId}/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -46974,7 +46951,7 @@ impl<'a, C, A> PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupListCall<'a, C, A> where C: BorrowMut PlacementGroupListCall<'a, C, A> { @@ -47357,7 +47334,7 @@ impl<'a, C, A> PlacementGroupUpdateCall<'a, C, A> where C: BorrowMut PlacementGroupInsertCall<'a, C, A> where C: BorrowMut PlacementGroupGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placementGroups/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placementGroups/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -48138,7 +48115,7 @@ impl<'a, C, A> PlacementGroupPatchCall<'a, C, A> where C: BorrowMut InventoryItemListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/inventoryItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -48590,7 +48567,7 @@ impl<'a, C, A> InventoryItemListCall<'a, C, A> where C: BorrowMut self._type_ = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -48775,7 +48752,7 @@ impl<'a, C, A> InventoryItemGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -49032,7 +49009,7 @@ impl<'a, C, A> UserRolePermissionGetCall<'a, C, A> where C: BorrowMut UserRolePermissionListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupListCall<'a, C, A> where C: BorrowMut AccountPermissionGroupGetCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> where C: BorrowMut ContentCategoryListCall<'a, C, A> { @@ -50326,7 +50303,7 @@ impl<'a, C, A> ContentCategoryUpdateCall<'a, C, A> where C: BorrowMut ContentCategoryInsertCall<'a, C, A> where C: BorrowMut ContentCategoryDeleteCall<'a, C, A> where C: BorrowMut ContentCategoryGetCall<'a, C, A> where C: BorrowMut ContentCategoryPatchCall<'a, C, A> where C: BorrowMut CreativeUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -51885,7 +51862,7 @@ impl<'a, C, A> CreativeInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52146,7 +52123,7 @@ impl<'a, C, A> CreativeGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creatives/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52483,7 +52460,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -52611,7 +52588,7 @@ impl<'a, C, A> CreativeListCall<'a, C, A> where C: BorrowMut, A: self._studio_creative_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -52845,7 +52822,7 @@ impl<'a, C, A> CreativePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/creatives"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/creatives".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53116,7 +53093,7 @@ impl<'a, C, A> CampaignGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53372,7 +53349,7 @@ impl<'a, C, A> CampaignInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53660,7 +53637,7 @@ impl<'a, C, A> CampaignPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -53936,7 +53913,7 @@ impl<'a, C, A> CampaignUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54268,7 +54245,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/campaigns"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/campaigns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54388,7 +54365,7 @@ impl<'a, C, A> CampaignListCall<'a, C, A> where C: BorrowMut, A: self._subaccount_id = Some(new_value.to_string()); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -54599,7 +54576,7 @@ impl<'a, C, A> EventTagDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -54888,7 +54865,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55001,7 +54978,7 @@ impl<'a, C, A> EventTagListCall<'a, C, A> where C: BorrowMut, A: self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -55202,7 +55179,7 @@ impl<'a, C, A> EventTagInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55470,7 +55447,7 @@ impl<'a, C, A> EventTagPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -55746,7 +55723,7 @@ impl<'a, C, A> EventTagUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56007,7 +55984,7 @@ impl<'a, C, A> EventTagGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/eventTags/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/eventTags/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -56254,7 +56231,7 @@ impl<'a, C, A> RemarketingListGetCall<'a, C, A> where C: BorrowMut RemarketingListUpdateCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> where C: BorrowMut RemarketingListListCall<'a, C, A> { @@ -57105,7 +57082,7 @@ impl<'a, C, A> RemarketingListPatchCall<'a, C, A> where C: BorrowMut RemarketingListInsertCall<'a, C, A> where C: BorrowMut CityListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/cities"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/cities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -57939,7 +57916,7 @@ impl<'a, C, A> PlacementStrategyUpdateCall<'a, C, A> where C: BorrowMut PlacementStrategyGetCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> where C: BorrowMut PlacementStrategyListCall<'a, C, A> { @@ -58756,7 +58733,7 @@ impl<'a, C, A> PlacementStrategyDeleteCall<'a, C, A> where C: BorrowMut PlacementStrategyInsertCall<'a, C, A> where C: BorrowMut PlacementStrategyPatchCall<'a, C, A> where C: BorrowMut ProjectListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -59687,7 +59664,7 @@ impl<'a, C, A> ProjectListCall<'a, C, A> where C: BorrowMut, A: o self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -59862,7 +59839,7 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/projects/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/projects/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60114,7 +60091,7 @@ impl<'a, C, A> DirectorySiteInsertCall<'a, C, A> where C: BorrowMut DirectorySiteListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/directorySites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -60553,7 +60530,7 @@ impl<'a, C, A> DirectorySiteListCall<'a, C, A> where C: BorrowMut self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -60769,7 +60746,7 @@ impl<'a, C, A> DirectorySiteGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/directorySites/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/directorySites/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61016,7 +60993,7 @@ impl<'a, C, A> VideoFormatGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/videoFormats/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/videoFormats/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61261,7 +61238,7 @@ impl<'a, C, A> VideoFormatListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/videoFormats"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/videoFormats".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -61501,7 +61478,7 @@ impl<'a, C, A> DynamicTargetingKeyDeleteCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyListCall<'a, C, A> where C: BorrowMut DynamicTargetingKeyInsertCall<'a, C, A> where C: BorrowMut SizeInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62596,7 +62573,7 @@ impl<'a, C, A> SizeListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sizes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -62862,7 +62839,7 @@ impl<'a, C, A> SizeGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/sizes/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/sizes/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -63109,7 +63086,7 @@ impl<'a, C, A> AccountActiveAdSummaryGetCall<'a, C, A> where C: BorrowMut AccountUserProfileUpdateCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> where C: BorrowMut AccountUserProfileListCall<'a, C, A> { @@ -63973,7 +63950,7 @@ impl<'a, C, A> AccountUserProfileInsertCall<'a, C, A> where C: BorrowMut AccountUserProfilePatchCall<'a, C, A> where C: BorrowMut AccountUserProfileGetCall<'a, C, A> where C: BorrowMut CountryListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/countries".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -64994,7 +64971,7 @@ impl<'a, C, A> CountryGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/countries/{dartId}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/countries/{dartId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -65250,7 +65227,7 @@ impl<'a, C, A> CreativeFieldValuePatchCall<'a, C, A> where C: BorrowMut CreativeFieldValueGetCall<'a, C, A> where C: BorrowMut CreativeFieldValueDeleteCall<'a, C, A> where C: BorrowMut CreativeFieldValueInsertCall<'a, C, A> where C: BorrowMut CreativeFieldValueUpdateCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> where C: BorrowMut CreativeFieldValueListCall<'a, C, A> { @@ -66916,7 +66893,7 @@ impl<'a, C, A> PostalCodeGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes/{code}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/postalCodes/{code}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67161,7 +67138,7 @@ impl<'a, C, A> PostalCodeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/postalCodes"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/postalCodes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67396,7 +67373,7 @@ impl<'a, C, A> BrowserListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/browsers"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/browsers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67633,7 +67610,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/accounts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -67915,7 +67892,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68028,7 +68005,7 @@ impl<'a, C, A> AccountListCall<'a, C, A> where C: BorrowMut, A: o self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -68207,7 +68184,7 @@ impl<'a, C, A> AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68475,7 +68452,7 @@ impl<'a, C, A> AccountPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/accounts"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -68753,7 +68730,7 @@ impl<'a, C, A> PlacementPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69154,7 +69131,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69267,7 +69244,7 @@ impl<'a, C, A> PlacementListCall<'a, C, A> where C: BorrowMut, A: self._profile_id = new_value.to_string(); self } - /// Order of sorted results, default is ASCENDING. + /// 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> { @@ -69556,7 +69533,7 @@ impl<'a, C, A> PlacementGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements/{id}"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placements/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -69808,7 +69785,7 @@ impl<'a, C, A> PlacementInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -70074,7 +70051,7 @@ impl<'a, C, A> PlacementUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "userprofiles/{profileId}/placements"; + let mut url = "https://www.googleapis.com/dfareporting/v2.7/userprofiles/{profileId}/placements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Dfatrafficking.as_ref().to_string(), ()); } @@ -70352,7 +70329,7 @@ impl<'a, C, A> PlacementGeneratetagCall<'a, C, A> where C: BorrowMut PlacementGeneratetagCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Discovery {} @@ -287,8 +285,6 @@ impl<'a, C, A> Discovery client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/discovery/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -305,26 +301,6 @@ impl<'a, C, A> Discovery self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/discovery/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -977,7 +953,7 @@ impl<'a, C, A> ApiGetRestCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "apis/{api}/{version}/rest"; + let mut url = "https://www.googleapis.com/discovery/v1/apis/{api}/{version}/rest".to_string(); for &(find_this, param_name) in [("{api}", "api"), ("{version}", "version")].iter() { let mut replace_with: Option<&str> = None; @@ -1196,7 +1172,7 @@ impl<'a, C, A> ApiListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "apis"; + let mut url = "https://www.googleapis.com/discovery/v1/apis".to_string(); if params.len() > 0 { @@ -1311,3 +1287,4 @@ impl<'a, C, A> ApiListCall<'a, C, A> where C: BorrowMut, A: oauth } + diff --git a/gen/dns1-cli/Cargo.toml b/gen/dns1-cli/Cargo.toml index 8871601ce9..d32e03be37 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.4+20161130" +version = "1.0.4+20170512" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-dns1] path = "../dns1" -version = "1.0.4+20161130" +version = "1.0.4+20170512" diff --git a/gen/dns1-cli/README.md b/gen/dns1-cli/README.md index c7adf852fb..a72b4c30f0 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 *20161130*. The CLI is at version *1.0.4*. +This documentation was generated from the *dns* API at revision *20170512*. The CLI is at version *1.0.4*. ```bash dns1 [options] diff --git a/gen/dns1-cli/mkdocs.yml b/gen/dns1-cli/mkdocs.yml index efe59b435f..6a98315bce 100644 --- a/gen/dns1-cli/mkdocs.yml +++ b/gen/dns1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: dns v1.0.4+20161130 +site_name: dns v1.0.4+20170512 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 4039e1d5d8..d2a826b006 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.4+20161130") + .version("1.0.4+20170512") .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 8507a6f167..6010bb5723 100644 --- a/gen/dns1/Cargo.toml +++ b/gen/dns1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-dns1" -version = "1.0.4+20161130" +version = "1.0.4+20170512" 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.4+20161130" +documentation = "https://docs.rs/google-dns1/1.0.4+20170512" license = "MIT" keywords = ["dns", "google", "protocol", "web", "api"] diff --git a/gen/dns1/README.md b/gen/dns1/README.md index 0e63871b78..85bece4436 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.4+20161130*, where *20161130* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *dns* crate version *1.0.4+20170512*, where *20170512* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161130/google_dns1/struct.Dns.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.Dns.html) ... -* [changes](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.Change.html) - * [*create*](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ChangeCreateCall.html), [*get*](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ChangeGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ChangeListCall.html) -* [managed zones](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ManagedZone.html) - * [*create*](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ManagedZoneCreateCall.html), [*delete*](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ManagedZoneDeleteCall.html), [*get*](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ManagedZoneGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ManagedZoneListCall.html) -* [projects](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.Project.html) - * [*get*](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ProjectGetCall.html) -* [resource record sets](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ResourceRecordSet.html) - * [*list*](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/struct.ResourceRecordSetListCall.html) +* [changes](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.Change.html) + * [*create*](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.ChangeCreateCall.html), [*get*](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.ChangeGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.ChangeListCall.html) +* [managed zones](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.ManagedZone.html) + * [*create*](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.ManagedZoneCreateCall.html), [*delete*](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.ManagedZoneDeleteCall.html), [*get*](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.ManagedZoneGetCall.html) and [*list*](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.ManagedZoneListCall.html) +* [projects](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.Project.html) + * [*get*](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.ProjectGetCall.html) +* [resource record sets](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/struct.ResourceRecordSet.html) + * [*list*](https://docs.rs/google-dns1/1.0.4+20170512/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.4+20161130/google_dns1/struct.Dns.html)** +* **[Hub](https://docs.rs/google-dns1/1.0.4+20170512/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.4+20161130/google_dns1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-dns1/1.0.4+20170512/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.4+20161130/google_dns1/trait.Part.html)** + * **[Parts](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-dns1/1.0.4+20161130/google_dns1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-dns1/1.0.4+20170512/google_dns1/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-dns1/1.0.4+20161130/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.4+20170512/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.4+20161130/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.4+20170512/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.4+20161130/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.4+20170512/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.4+20161130/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.4+20170512/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")`. @@ -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-dns1/1.0.4+20161130/google_dns1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-dns1/1.0.4+20161130/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.4+20170512/google_dns1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-dns1/1.0.4+20170512/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.4+20161130/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.4+20170512/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.4+20161130/google_dns1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-dns1/1.0.4+20161130/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.4+20170512/google_dns1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-dns1/1.0.4+20170512/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.4+20161130/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.4+20170512/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.4+20161130/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.4+20170512/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.4+20161130/google_dns1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-dns1/1.0.4+20170512/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 900e6ef4fa..f7bac7f808 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.4+20161130*, where *20161130* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *dns* crate version *1.0.4+20170512*, where *20170512* is the exact revision of the *dns:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *dns* *v1* API can be found at the //! [official documentation site](https://developers.google.com/cloud-dns). @@ -182,7 +182,7 @@ // 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 +// 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)] @@ -322,8 +322,6 @@ pub struct Dns { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Dns {} @@ -336,8 +334,6 @@ impl<'a, C, A> Dns client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/dns/v1/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -363,26 +359,6 @@ impl<'a, C, A> Dns self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/dns/v1/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1058,7 +1034,7 @@ impl<'a, C, A> ChangeCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}/changes"; + let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managedZone}/changes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1349,7 +1325,7 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}/changes"; + let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managedZone}/changes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); } @@ -1626,7 +1602,7 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}/changes/{changeId}"; + let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managedZone}/changes/{changeId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); } @@ -1888,7 +1864,7 @@ impl<'a, C, A> ManagedZoneCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/managedZones"; + let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2148,7 +2124,7 @@ impl<'a, C, A> ManagedZoneDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}"; + let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managedZone}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2385,7 +2361,7 @@ impl<'a, C, A> ManagedZoneGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/managedZones/{managedZone}"; + let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones/{managedZone}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); } @@ -2645,7 +2621,7 @@ impl<'a, C, A> ManagedZoneListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/managedZones"; + let mut url = "https://www.googleapis.com/dns/v1/projects/{project}/managedZones".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); } @@ -2923,7 +2899,7 @@ impl<'a, C, A> ResourceRecordSetListCall<'a, C, A> where C: BorrowMut ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}"; + let mut url = "https://www.googleapis.com/dns/v1/projects/{project}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevClouddnReadonly.as_ref().to_string(), ()); } @@ -3361,3 +3337,4 @@ impl<'a, C, A> ProjectGetCall<'a, C, A> where C: BorrowMut, A: oa } + diff --git a/gen/doubleclickbidmanager1-cli/Cargo.toml b/gen/doubleclickbidmanager1-cli/Cargo.toml index 5076c8f993..570ff518d6 100644 --- a/gen/doubleclickbidmanager1-cli/Cargo.toml +++ b/gen/doubleclickbidmanager1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-doubleclickbidmanager1-cli" -version = "1.0.4+20161010" +version = "1.0.4+20170224" authors = ["Sebastian Thiel "] description = "A complete library to interact with DoubleClick Bid Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclickbidmanager1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-doubleclickbidmanager1] path = "../doubleclickbidmanager1" -version = "1.0.4+20161010" +version = "1.0.4+20170224" diff --git a/gen/doubleclickbidmanager1-cli/README.md b/gen/doubleclickbidmanager1-cli/README.md index 7f29003a2e..d6d16abb05 100644 --- a/gen/doubleclickbidmanager1-cli/README.md +++ b/gen/doubleclickbidmanager1-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *DoubleClick Bid Manager* API at revision *20161010*. The CLI is at version *1.0.4*. +This documentation was generated from the *DoubleClick Bid Manager* API at revision *20170224*. The CLI is at version *1.0.4*. ```bash doubleclickbidmanager1 [options] @@ -45,6 +45,10 @@ doubleclickbidmanager1 [options] doubleclickbidmanager1 --help Configuration: + [--scope ]... + Specify the authentication a method should be executed in. Each scope + requires the user to grant this application permission to use it. + If unset, it defaults to the shortest scope url for a particular method. --config-dir A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation. diff --git a/gen/doubleclickbidmanager1-cli/mkdocs.yml b/gen/doubleclickbidmanager1-cli/mkdocs.yml index 6bebbc3ef3..0745fe057d 100644 --- a/gen/doubleclickbidmanager1-cli/mkdocs.yml +++ b/gen/doubleclickbidmanager1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: DoubleClick Bid Manager v1.0.4+20161010 +site_name: DoubleClick Bid Manager v1.0.4+20170224 site_url: http://byron.github.io/google-apis-rs/google-doubleclickbidmanager1-cli site_description: A complete library to interact with DoubleClick Bid Manager (protocol v1) diff --git a/gen/doubleclickbidmanager1-cli/src/main.rs b/gen/doubleclickbidmanager1-cli/src/main.rs index b633d73da3..8cded1d852 100644 --- a/gen/doubleclickbidmanager1-cli/src/main.rs +++ b/gen/doubleclickbidmanager1-cli/src/main.rs @@ -111,6 +111,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -195,6 +198,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -300,6 +306,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -349,6 +358,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } match match protocol { CallType::Standard => call.doit(), _ => unreachable!() @@ -390,6 +402,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -439,6 +454,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -524,6 +542,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } match match protocol { CallType::Standard => call.doit(), _ => unreachable!() @@ -565,6 +586,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -650,6 +674,9 @@ impl<'n> Engine<'n> { Ok(()) } else { assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } let mut ostream = match writer_from_opts(opt.value_of("out")) { Ok(mut f) => f, Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), @@ -1018,9 +1045,14 @@ fn main() { let mut app = App::new("doubleclickbidmanager1") .author("Sebastian Thiel ") - .version("1.0.4+20161010") + .version("1.0.4+20170224") .about("API for viewing and managing your reports in DoubleClick Bid Manager.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_doubleclickbidmanager1_cli") + .arg(Arg::with_name("url") + .long("scope") + .help("Specify the authentication a method should be executed in. Each scope requires the user to grant this application permission to use it.If unset, it defaults to the shortest scope url for a particular method.") + .multiple(true) + .takes_value(true)) .arg(Arg::with_name("folder") .long("config-dir") .help("A directory into which we will store our persistent data. Defaults to a user-writable directory that we will create during the first invocation.[default: ~/.google-service-cli") diff --git a/gen/doubleclickbidmanager1/Cargo.toml b/gen/doubleclickbidmanager1/Cargo.toml index 304c42e776..3608b0bac3 100644 --- a/gen/doubleclickbidmanager1/Cargo.toml +++ b/gen/doubleclickbidmanager1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-doubleclickbidmanager1" -version = "1.0.4+20161010" +version = "1.0.4+20170224" authors = ["Sebastian Thiel "] description = "A complete library to interact with DoubleClick Bid Manager (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/doubleclickbidmanager1" homepage = "https://developers.google.com/bid-manager/" -documentation = "https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010" +documentation = "https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224" license = "MIT" keywords = ["doubleclickbidmanage", "google", "protocol", "web", "api"] diff --git a/gen/doubleclickbidmanager1/README.md b/gen/doubleclickbidmanager1/README.md index 3d1b70de8d..0d58a0878e 100644 --- a/gen/doubleclickbidmanager1/README.md +++ b/gen/doubleclickbidmanager1/README.md @@ -5,22 +5,22 @@ DO NOT EDIT ! --> The `google-doubleclickbidmanager1` library allows access to all features of the *Google DoubleClick Bid Manager* service. -This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.4+20161010*, where *20161010* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.4+20170224*, where *20170224* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the [official documentation site](https://developers.google.com/bid-manager/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html) ... * lineitems - * [*downloadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.LineitemDownloadlineitemCall.html) and [*uploadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.LineitemUploadlineitemCall.html) -* [queries](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.Query.html) - * [*createquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.QueryCreatequeryCall.html), [*deletequery*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.QueryDeletequeryCall.html), [*getquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.QueryGetqueryCall.html), [*listqueries*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.QueryListqueryCall.html) and [*runquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.QueryRunqueryCall.html) -* [reports](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.Report.html) - * [*listreports*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.ReportListreportCall.html) + * [*downloadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.LineitemDownloadlineitemCall.html) and [*uploadlineitems*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.LineitemUploadlineitemCall.html) +* [queries](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.Query.html) + * [*createquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.QueryCreatequeryCall.html), [*deletequery*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.QueryDeletequeryCall.html), [*getquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.QueryGetqueryCall.html), [*listqueries*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.QueryListqueryCall.html) and [*runquery*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.QueryRunqueryCall.html) +* [reports](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.Report.html) + * [*listreports*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.ReportListreportCall.html) * sdf - * [*download*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.SdfDownloadCall.html) + * [*download*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.SdfDownloadCall.html) @@ -29,17 +29,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html)** +* **[Hub](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/struct.DoubleClickBidManager.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.Part.html)** + * **[Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/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-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.ResponseResult.html), it will return that by default. You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making this call: `.param("alt", "media")`. @@ -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-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20161010/google_doubleclickbidmanager1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-doubleclickbidmanager1/1.0.4+20170224/google_doubleclickbidmanager1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/doubleclickbidmanager1/src/lib.rs b/gen/doubleclickbidmanager1/src/lib.rs index 6769288a4a..1eaa4f6463 100644 --- a/gen/doubleclickbidmanager1/src/lib.rs +++ b/gen/doubleclickbidmanager1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.4+20161010*, where *20161010* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *DoubleClick Bid Manager* crate version *1.0.4+20170224*, where *20170224* is the exact revision of the *doubleclickbidmanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *DoubleClick Bid Manager* *v1* API can be found at the //! [official documentation site](https://developers.google.com/bid-manager/). @@ -177,7 +177,7 @@ // 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 +// 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)] @@ -217,6 +217,28 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, // UTILITIES ### // ############ +/// Identifies the an OAuth2 authorization scope. +/// A scope is needed when requesting an +/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). +#[derive(PartialEq, Eq, Hash)] +pub enum Scope { + /// View and manage your reports in DoubleClick Bid Manager + Full, +} + +impl AsRef for Scope { + fn as_ref(&self) -> &str { + match *self { + Scope::Full => "https://www.googleapis.com/auth/doubleclickbidmanager", + } + } +} + +impl Default for Scope { + fn default() -> Scope { + Scope::Full + } +} @@ -280,8 +302,6 @@ pub struct DoubleClickBidManager { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for DoubleClickBidManager {} @@ -294,8 +314,6 @@ impl<'a, C, A> DoubleClickBidManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/doubleclickbidmanager/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -321,26 +339,6 @@ impl<'a, C, A> DoubleClickBidManager self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/doubleclickbidmanager/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -665,7 +663,7 @@ pub struct DownloadRequest { /// Filter type used to filter line items to fetch. #[serde(rename="filterType")] pub filter_type: Option, - /// The IDs of the specified filter type. This is used to filter entities to fetch. At least one ID must be specified. Only one ID is allowed for the ADVERTISER_ID filter type. For INSERTION_ORDER_ID or LINE_ITEM_ID filter types all IDs must be from the same Advertiser. + /// The IDs of the specified filter type. This is used to filter entities to fetch. At least one ID must be specified. Only one ID is allowed for the ADVERTISER_ID filter type. For INSERTION_ORDER_ID or LINE_ITEM_ID filter types, all IDs must be from the same Advertiser. #[serde(rename="filterIds")] pub filter_ids: Option>, } @@ -892,6 +890,7 @@ impl<'a, C, A> SdfMethods<'a, C, A> { hub: self.hub, _request: request, _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -949,6 +948,7 @@ impl<'a, C, A> LineitemMethods<'a, C, A> { hub: self.hub, _request: request, _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -965,6 +965,7 @@ impl<'a, C, A> LineitemMethods<'a, C, A> { hub: self.hub, _request: request, _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -1022,6 +1023,7 @@ impl<'a, C, A> ReportMethods<'a, C, A> { hub: self.hub, _query_id: query_id.to_string(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -1074,6 +1076,7 @@ impl<'a, C, A> QueryMethods<'a, C, A> { QueryListqueryCall { hub: self.hub, _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -1090,6 +1093,7 @@ impl<'a, C, A> QueryMethods<'a, C, A> { hub: self.hub, _query_id: query_id.to_string(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -1106,6 +1110,7 @@ impl<'a, C, A> QueryMethods<'a, C, A> { hub: self.hub, _request: request, _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -1122,6 +1127,7 @@ impl<'a, C, A> QueryMethods<'a, C, A> { hub: self.hub, _query_id: query_id.to_string(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -1140,6 +1146,7 @@ impl<'a, C, A> QueryMethods<'a, C, A> { _request: request, _query_id: query_id.to_string(), _delegate: Default::default(), + _scopes: Default::default(), _additional_params: Default::default(), } } @@ -1196,6 +1203,7 @@ pub struct SdfDownloadCall<'a, C, A> _request: DownloadRequest, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for SdfDownloadCall<'a, C, A> {} @@ -1227,18 +1235,9 @@ impl<'a, C, A> SdfDownloadCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "sdf/download"; - - 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) - } + let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/sdf/download".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1261,11 +1260,25 @@ impl<'a, C, A> SdfDownloadCall<'a, C, A> where C: BorrowMut, A: o loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) .header(ContentLength(request_size as u64)) .body(&mut request_value_reader); @@ -1361,6 +1374,22 @@ impl<'a, C, A> SdfDownloadCall<'a, C, A> where C: BorrowMut, A: o self } + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SdfDownloadCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } } @@ -1407,6 +1436,7 @@ pub struct LineitemUploadlineitemCall<'a, C, A> _request: UploadLineItemsRequest, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for LineitemUploadlineitemCall<'a, C, A> {} @@ -1438,18 +1468,9 @@ impl<'a, C, A> LineitemUploadlineitemCall<'a, C, A> where C: BorrowMut params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } + let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/lineitems/uploadlineitems".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1472,11 +1493,25 @@ impl<'a, C, A> LineitemUploadlineitemCall<'a, C, A> where C: BorrowMut token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) .header(ContentLength(request_size as u64)) .body(&mut request_value_reader); @@ -1572,6 +1607,22 @@ impl<'a, C, A> LineitemUploadlineitemCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> LineitemUploadlineitemCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } } @@ -1618,6 +1669,7 @@ pub struct LineitemDownloadlineitemCall<'a, C, A> _request: DownloadLineItemsRequest, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for LineitemDownloadlineitemCall<'a, C, A> {} @@ -1649,18 +1701,9 @@ impl<'a, C, A> LineitemDownloadlineitemCall<'a, C, A> where C: BorrowMut params.push(("key", value)), - None => { - dlg.finished(false); - return Err(Error::MissingAPIKey) - } + let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/lineitems/downloadlineitems".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1683,11 +1726,25 @@ impl<'a, C, A> LineitemDownloadlineitemCall<'a, C, A> where C: BorrowMut token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) .header(ContentLength(request_size as u64)) .body(&mut request_value_reader); @@ -1783,6 +1840,22 @@ impl<'a, C, A> LineitemDownloadlineitemCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> LineitemDownloadlineitemCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } } @@ -1823,6 +1896,7 @@ pub struct ReportListreportCall<'a, C, A> _query_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for ReportListreportCall<'a, C, A> {} @@ -1855,18 +1929,9 @@ impl<'a, C, A> ReportListreportCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "queries/{queryId}/reports"; - - 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) - } + let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/queries/{queryId}/reports".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{queryId}", "queryId")].iter() { @@ -1899,10 +1964,24 @@ impl<'a, C, A> ReportListreportCall<'a, C, A> where C: BorrowMut, loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())); + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -1996,6 +2075,22 @@ impl<'a, C, A> ReportListreportCall<'a, C, A> where C: BorrowMut, self } + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReportListreportCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } } @@ -2035,6 +2130,7 @@ pub struct QueryListqueryCall<'a, C, A> hub: &'a DoubleClickBidManager, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for QueryListqueryCall<'a, C, A> {} @@ -2066,18 +2162,9 @@ impl<'a, C, A> QueryListqueryCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "queries"; - - 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) - } + let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/queries".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2089,10 +2176,24 @@ impl<'a, C, A> QueryListqueryCall<'a, C, A> where C: BorrowMut, A loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())); + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -2176,6 +2277,22 @@ impl<'a, C, A> QueryListqueryCall<'a, C, A> where C: BorrowMut, A self } + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> QueryListqueryCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } } @@ -2216,6 +2333,7 @@ pub struct QueryGetqueryCall<'a, C, A> _query_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for QueryGetqueryCall<'a, C, A> {} @@ -2248,18 +2366,9 @@ impl<'a, C, A> QueryGetqueryCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "query/{queryId}"; - - 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) - } + let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/query/{queryId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{queryId}", "queryId")].iter() { @@ -2292,10 +2401,24 @@ impl<'a, C, A> QueryGetqueryCall<'a, C, A> where C: BorrowMut, A: loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())); + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -2389,6 +2512,22 @@ impl<'a, C, A> QueryGetqueryCall<'a, C, A> where C: BorrowMut, A: self } + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> QueryGetqueryCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } } @@ -2435,6 +2574,7 @@ pub struct QueryCreatequeryCall<'a, C, A> _request: Query, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for QueryCreatequeryCall<'a, C, A> {} @@ -2466,18 +2606,9 @@ impl<'a, C, A> QueryCreatequeryCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "query"; - - 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) - } + let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/query".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2500,11 +2631,25 @@ impl<'a, C, A> QueryCreatequeryCall<'a, C, A> where C: BorrowMut, loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) .header(ContentLength(request_size as u64)) .body(&mut request_value_reader); @@ -2600,6 +2745,22 @@ impl<'a, C, A> QueryCreatequeryCall<'a, C, A> where C: BorrowMut, self } + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> QueryCreatequeryCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } } @@ -2640,6 +2801,7 @@ pub struct QueryDeletequeryCall<'a, C, A> _query_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for QueryDeletequeryCall<'a, C, A> {} @@ -2671,18 +2833,9 @@ impl<'a, C, A> QueryDeletequeryCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "query/{queryId}"; - - 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) - } + let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/query/{queryId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{queryId}", "queryId")].iter() { @@ -2715,10 +2868,24 @@ impl<'a, C, A> QueryDeletequeryCall<'a, C, A> where C: BorrowMut, loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) - .header(UserAgent(self.hub._user_agent.clone())); + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); dlg.pre_request(); req.send() @@ -2802,6 +2969,22 @@ impl<'a, C, A> QueryDeletequeryCall<'a, C, A> where C: BorrowMut, self } + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> QueryDeletequeryCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } } @@ -2849,6 +3032,7 @@ pub struct QueryRunqueryCall<'a, C, A> _query_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, + _scopes: BTreeMap } impl<'a, C, A> CallBuilder for QueryRunqueryCall<'a, C, A> {} @@ -2880,18 +3064,9 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "query/{queryId}"; - - 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) - } + let mut url = "https://www.googleapis.com/doubleclickbidmanager/v1/query/{queryId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{queryId}", "queryId")].iter() { @@ -2935,11 +3110,25 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut, A: loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) .header(ContentType(json_mime_type.clone())) .header(ContentLength(request_size as u64)) .body(&mut request_value_reader); @@ -3035,6 +3224,23 @@ impl<'a, C, A> QueryRunqueryCall<'a, C, A> where C: BorrowMut, A: self } + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> QueryRunqueryCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } } + diff --git a/gen/doubleclicksearch2-cli/Cargo.toml b/gen/doubleclicksearch2-cli/Cargo.toml index 306edca9e8..2f28589409 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.4+20161108" +version = "1.0.4+20170509" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-doubleclicksearch2] path = "../doubleclicksearch2" -version = "1.0.4+20161108" +version = "1.0.4+20170509" diff --git a/gen/doubleclicksearch2-cli/README.md b/gen/doubleclicksearch2-cli/README.md index c4a34be97a..6dc3735dc7 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 *20161108*. The CLI is at version *1.0.4*. +This documentation was generated from the *doubleclicksearch* API at revision *20170509*. The CLI is at version *1.0.4*. ```bash doubleclicksearch2 [options] diff --git a/gen/doubleclicksearch2-cli/mkdocs.yml b/gen/doubleclicksearch2-cli/mkdocs.yml index 8e85699104..bc182d63c4 100644 --- a/gen/doubleclicksearch2-cli/mkdocs.yml +++ b/gen/doubleclicksearch2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: doubleclicksearch v1.0.4+20161108 +site_name: doubleclicksearch v1.0.4+20170509 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 41bb61b213..fe63825ad6 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.4+20161108") + .version("1.0.4+20170509") .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 3eec67292a..a9427570e9 100644 --- a/gen/doubleclicksearch2/Cargo.toml +++ b/gen/doubleclicksearch2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-doubleclicksearch2" -version = "1.0.4+20161108" +version = "1.0.4+20170509" 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.4+20161108" +documentation = "https://docs.rs/google-doubleclicksearch2/1.0.4+20170509" license = "MIT" keywords = ["doubleclicksearch", "google", "protocol", "web", "api"] diff --git a/gen/doubleclicksearch2/README.md b/gen/doubleclicksearch2/README.md index 1250da697f..261b87cbb4 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.4+20161108*, where *20161108* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *doubleclicksearch* crate version *1.0.4+20170509*, where *20170509* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161108/google_doubleclicksearch2/struct.Doubleclicksearch.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.Doubleclicksearch.html) ... -* [conversion](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.Conversion.html) - * [*get*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.ConversionGetCall.html), [*insert*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.ConversionInsertCall.html), [*patch*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.ConversionPatchCall.html), [*update*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.ConversionUpdateCall.html) and [*update availability*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.ConversionUpdateAvailabilityCall.html) -* [reports](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.Report.html) - * [*generate*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.ReportGenerateCall.html), [*get*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.ReportGetCall.html), [*get file*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.ReportGetFileCall.html) and [*request*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.ReportRequestCall.html) -* [saved columns](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.SavedColumn.html) - * [*list*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.SavedColumnListCall.html) +* [conversion](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.Conversion.html) + * [*get*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.ConversionGetCall.html), [*insert*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.ConversionInsertCall.html), [*patch*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.ConversionPatchCall.html), [*update*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.ConversionUpdateCall.html) and [*update availability*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.ConversionUpdateAvailabilityCall.html) +* [reports](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.Report.html) + * [*generate*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.ReportGenerateCall.html), [*get*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.ReportGetCall.html), [*get file*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.ReportGetFileCall.html) and [*request*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.ReportRequestCall.html) +* [saved columns](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.SavedColumn.html) + * [*list*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/struct.SavedColumnListCall.html) Download supported by ... -* [*get file reports*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/struct.ReportGetFileCall.html) +* [*get file reports*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/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.4+20161108/google_doubleclicksearch2/struct.Doubleclicksearch.html)** +* **[Hub](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/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.4+20161108/google_doubleclicksearch2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/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.4+20161108/google_doubleclicksearch2/trait.Part.html)** + * **[Parts](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/google_doubleclicksearch2/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-doubleclicksearch2/1.0.4+20161108/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.4+20170509/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.4+20161108/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.4+20170509/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.4+20161108/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.4+20170509/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.4+20161108/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.4+20170509/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")`. @@ -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-doubleclicksearch2/1.0.4+20161108/google_doubleclicksearch2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/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.4+20170509/google_doubleclicksearch2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/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.4+20161108/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.4+20170509/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.4+20161108/google_doubleclicksearch2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-doubleclicksearch2/1.0.4+20161108/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.4+20170509/google_doubleclicksearch2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/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.4+20161108/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.4+20170509/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.4+20161108/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.4+20170509/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.4+20161108/google_doubleclicksearch2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-doubleclicksearch2/1.0.4+20170509/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 428669853a..47598f682c 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.4+20161108*, where *20161108* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *doubleclicksearch* crate version *1.0.4+20170509*, where *20170509* is the exact revision of the *doubleclicksearch:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *doubleclicksearch* *v2* API can be found at the //! [official documentation site](https://developers.google.com/doubleclick-search/). @@ -181,7 +181,7 @@ // 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 +// 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)] @@ -306,8 +306,6 @@ pub struct Doubleclicksearch { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Doubleclicksearch {} @@ -320,8 +318,6 @@ impl<'a, C, A> Doubleclicksearch client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/doubleclicksearch/v2/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -344,26 +340,6 @@ impl<'a, C, A> Doubleclicksearch self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/doubleclicksearch/v2/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -450,7 +426,8 @@ pub struct Conversion { /// DS ad ID. #[serde(rename="adId")] pub ad_id: Option, - /// For offline conversions, this is an ID that advertisers are required to provide. Advertisers can specify any ID that is meaningful to them. For online conversions, DS copies the dsConversionId or floodlightOrderId into this property depending on the advertiser's Floodlight instructions. + /// For offline conversions, advertisers provide this ID. Advertisers can specify any ID that is meaningful to them. Each conversion in a request must specify a unique ID, and the combination of ID and timestamp must be unique amongst all conversions within the advertiser. + /// For online conversions, DS copies the dsConversionId or floodlightOrderId into this property depending on the advertiser's Floodlight instructions. #[serde(rename="conversionId")] pub conversion_id: Option, /// The time at which the conversion was last modified, in epoch millis UTC. @@ -1318,7 +1295,7 @@ impl<'a, C, A> ConversionInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "conversion"; + let mut url = "https://www.googleapis.com/doubleclicksearch/v2/conversion".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1578,7 +1555,7 @@ impl<'a, C, A> ConversionGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion"; + let mut url = "https://www.googleapis.com/doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/engine/{engineAccountId}/conversion".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1906,7 +1883,7 @@ impl<'a, C, A> ConversionUpdateAvailabilityCall<'a, C, A> where C: BorrowMut ConversionPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "conversion"; + let mut url = "https://www.googleapis.com/doubleclicksearch/v2/conversion".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2456,7 +2433,7 @@ impl<'a, C, A> ConversionUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "conversion"; + let mut url = "https://www.googleapis.com/doubleclicksearch/v2/conversion".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2686,7 +2663,7 @@ impl<'a, C, A> SavedColumnListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "agency/{agencyId}/advertiser/{advertiserId}/savedcolumns"; + let mut url = "https://www.googleapis.com/doubleclicksearch/v2/agency/{agencyId}/advertiser/{advertiserId}/savedcolumns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2935,7 +2912,7 @@ impl<'a, C, A> ReportGetFileCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "reports/{reportId}/files/{reportFragment}"; + let mut url = "https://www.googleapis.com/doubleclicksearch/v2/reports/{reportId}/files/{reportFragment}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3175,7 +3152,7 @@ impl<'a, C, A> ReportGenerateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "reports/generate"; + let mut url = "https://www.googleapis.com/doubleclicksearch/v2/reports/generate".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3403,7 +3380,7 @@ impl<'a, C, A> ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "reports/{reportId}"; + let mut url = "https://www.googleapis.com/doubleclicksearch/v2/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3643,7 +3620,7 @@ impl<'a, C, A> ReportRequestCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "reports"; + let mut url = "https://www.googleapis.com/doubleclicksearch/v2/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3801,3 +3778,4 @@ impl<'a, C, A> ReportRequestCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/drive2-cli/Cargo.toml b/gen/drive2-cli/Cargo.toml index 7a0e00d098..5cbc1ca589 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.4+20161212" +version = "1.0.4+20170512" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-drive2] path = "../drive2" -version = "1.0.4+20161212" +version = "1.0.4+20170512" diff --git a/gen/drive2-cli/README.md b/gen/drive2-cli/README.md index 493200c44c..06200a587f 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 *20161212*. The CLI is at version *1.0.4*. +This documentation was generated from the *drive* API at revision *20170512*. The CLI is at version *1.0.4*. ```bash drive2 [options] @@ -36,6 +36,7 @@ drive2 [options] list [-p ]... [-o ] changes get [-p ]... [-o ] + get-start-page-token [-p ]... [-o ] list [-p ]... [-o ] watch (-r )... [-p ]... [-o ] channels @@ -103,6 +104,12 @@ drive2 [options] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] + teamdrives + delete [-p ]... + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] + update (-r )... [-p ]... [-o ] drive2 --help Configuration: diff --git a/gen/drive2-cli/mkdocs.yml b/gen/drive2-cli/mkdocs.yml index 449425e792..6b0e895263 100644 --- a/gen/drive2-cli/mkdocs.yml +++ b/gen/drive2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: drive v1.0.4+20161212 +site_name: drive v1.0.4+20170512 site_url: http://byron.github.io/google-apis-rs/google-drive2-cli site_description: A complete library to interact with drive (protocol v2) @@ -13,6 +13,7 @@ pages: - ['apps_get.md', 'Apps', 'Get'] - ['apps_list.md', 'Apps', 'List'] - ['changes_get.md', 'Changes', 'Get'] +- ['changes_get-start-page-token.md', 'Changes', 'Get Start Page Token'] - ['changes_list.md', 'Changes', 'List'] - ['changes_watch.md', 'Changes', 'Watch'] - ['channels_stop.md', 'Channels', 'Stop'] @@ -70,6 +71,11 @@ pages: - ['revisions_list.md', 'Revisions', 'List'] - ['revisions_patch.md', 'Revisions', 'Patch'] - ['revisions_update.md', 'Revisions', 'Update'] +- ['teamdrives_delete.md', 'Teamdrives', 'Delete'] +- ['teamdrives_get.md', 'Teamdrives', 'Get'] +- ['teamdrives_insert.md', 'Teamdrives', 'Insert'] +- ['teamdrives_list.md', 'Teamdrives', 'List'] +- ['teamdrives_update.md', 'Teamdrives', 'Update'] theme: readthedocs diff --git a/gen/drive2-cli/src/main.rs b/gen/drive2-cli/src/main.rs index b2a89c01a5..88f65a33f8 100644 --- a/gen/drive2-cli/src/main.rs +++ b/gen/drive2-cli/src/main.rs @@ -228,6 +228,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 { + "team-drive-id" => { + call = call.team_drive_id(value.unwrap_or("")); + }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -241,6 +247,66 @@ 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(["team-drive-id", "supports-team-drives"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _changes_get_start_page_token(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.changes().get_start_page_token(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "team-drive-id" => { + call = call.team_drive_id(value.unwrap_or("")); + }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "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(["team-drive-id", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -280,6 +346,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 { + "team-drive-id" => { + call = call.team_drive_id(value.unwrap_or("")); + }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "start-change-id" => { call = call.start_change_id(value.unwrap_or("")); }, @@ -292,12 +364,18 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-team-drive-items" => { + call = call.include_team_drive_items(arg_from_str(value.unwrap_or("false"), err, "include-team-drive-items", "boolean")); + }, "include-subscribed" => { call = call.include_subscribed(arg_from_str(value.unwrap_or("false"), err, "include-subscribed", "boolean")); }, "include-deleted" => { call = call.include_deleted(arg_from_str(value.unwrap_or("false"), err, "include-deleted", "boolean")); }, + "include-corpus-removals" => { + call = call.include_corpus_removals(arg_from_str(value.unwrap_or("false"), err, "include-corpus-removals", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -311,7 +389,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(["include-subscribed", "include-deleted", "max-results", "page-token", "spaces", "start-change-id"].iter().map(|v|*v)); + v.extend(["include-subscribed", "include-deleted", "include-team-drive-items", "max-results", "page-token", "spaces", "supports-team-drives", "start-change-id", "team-drive-id", "include-corpus-removals"].iter().map(|v|*v)); v } )); } } @@ -393,6 +471,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 { + "team-drive-id" => { + call = call.team_drive_id(value.unwrap_or("")); + }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "start-change-id" => { call = call.start_change_id(value.unwrap_or("")); }, @@ -405,12 +489,18 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-team-drive-items" => { + call = call.include_team_drive_items(arg_from_str(value.unwrap_or("false"), err, "include-team-drive-items", "boolean")); + }, "include-subscribed" => { call = call.include_subscribed(arg_from_str(value.unwrap_or("false"), err, "include-subscribed", "boolean")); }, "include-deleted" => { call = call.include_deleted(arg_from_str(value.unwrap_or("false"), err, "include-deleted", "boolean")); }, + "include-corpus-removals" => { + call = call.include_corpus_removals(arg_from_str(value.unwrap_or("false"), err, "include-corpus-removals", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -424,7 +514,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(["include-subscribed", "include-deleted", "max-results", "page-token", "spaces", "start-change-id"].iter().map(|v|*v)); + v.extend(["include-subscribed", "include-deleted", "include-team-drive-items", "max-results", "page-token", "spaces", "supports-team-drives", "start-change-id", "team-drive-id", "include-corpus-removals"].iter().map(|v|*v)); v } )); } } @@ -682,6 +772,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -695,6 +788,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 } )); } } @@ -1295,6 +1389,7 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "has-thumbnail" => Some(("hasThumbnail", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "mime-type" => Some(("mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "app-data-contents" => Some(("appDataContents", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "thumbnail-link" => Some(("thumbnailLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels.restricted" => Some(("labels.restricted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1305,7 +1400,7 @@ impl<'n> Engine<'n> { "labels.trashed" => Some(("labels.trashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "indexable-text.text" => Some(("indexableText.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "thumbnail-version" => Some(("thumbnailVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "explicitly-trashed" => Some(("explicitlyTrashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-app-authorized" => Some(("isAppAuthorized", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "last-modifying-user-name" => Some(("lastModifyingUserName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writers-can-share" => Some(("writersCanShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1317,6 +1412,12 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.is-authenticated-user" => Some(("sharingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.height" => Some(("videoMediaMetadata.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1328,14 +1429,33 @@ impl<'n> Engine<'n> { "last-modifying-user.email-address" => Some(("lastModifyingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "copyable" => Some(("copyable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "folder-color-rgb" => Some(("folderColorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner-names" => Some(("ownerNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-untrash" => Some(("capabilities.canUntrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-restricted-download" => Some(("capabilities.canChangeRestrictedDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-item-into-team-drive" => Some(("capabilities.canMoveItemIntoTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-read-team-drive" => Some(("capabilities.canReadTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "shared-with-me-date" => Some(("sharedWithMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-view-link" => Some(("webViewLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-viewed-by-me-date" => Some(("lastViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "export-links" => Some(("exportLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "shared" => Some(("shared", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "open-with-links" => Some(("openWithLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashed-date" => Some(("trashedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-read-revisions" => Some(("canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "image-media-metadata.exposure-bias" => Some(("imageMediaMetadata.exposureBias", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "image-media-metadata.exposure-time" => Some(("imageMediaMetadata.exposureTime", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), @@ -1362,18 +1482,17 @@ impl<'n> Engine<'n> { "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "last-viewed-by-me-date" => Some(("lastViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "icon-link" => Some(("iconLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-open-with-link" => Some(("defaultOpenWithLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1384,6 +1503,7 @@ impl<'n> Engine<'n> { "user-permission.with-link" => Some(("userPermission.withLink", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "user-permission.domain" => Some(("userPermission.domain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.name" => Some(("userPermission.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-permission.deleted" => Some(("userPermission.deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "user-permission.kind" => Some(("userPermission.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.value" => Some(("userPermission.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.id" => Some(("userPermission.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1396,15 +1516,16 @@ impl<'n> Engine<'n> { "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.photo-link" => Some(("userPermission.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "explicitly-trashed" => Some(("explicitlyTrashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "shareable" => Some(("shareable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-comment", "can-read-revisions", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1427,6 +1548,9 @@ impl<'n> Engine<'n> { "timed-text-language" => { call = call.timed_text_language(value.unwrap_or("")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "pinned" => { call = call.pinned(arg_from_str(value.unwrap_or("false"), err, "pinned", "boolean")); }, @@ -1452,7 +1576,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(["convert", "ocr-language", "visibility", "pinned", "ocr", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); + v.extend(["convert", "ocr-language", "supports-team-drives", "pinned", "visibility", "ocr", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); v } )); } } @@ -1492,6 +1616,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1505,6 +1632,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 } )); } } @@ -1700,6 +1828,9 @@ impl<'n> Engine<'n> { "update-viewed-date" => { call = call.update_viewed_date(arg_from_str(value.unwrap_or("false"), err, "update-viewed-date", "boolean")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "revision-id" => { call = call.revision_id(value.unwrap_or("")); }, @@ -1725,7 +1856,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(["revision-id", "update-viewed-date", "acknowledge-abuse", "projection"].iter().map(|v|*v)); + v.extend(["revision-id", "update-viewed-date", "acknowledge-abuse", "projection", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -1789,6 +1920,7 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "has-thumbnail" => Some(("hasThumbnail", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "mime-type" => Some(("mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "app-data-contents" => Some(("appDataContents", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "thumbnail-link" => Some(("thumbnailLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels.restricted" => Some(("labels.restricted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1799,7 +1931,7 @@ impl<'n> Engine<'n> { "labels.trashed" => Some(("labels.trashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "indexable-text.text" => Some(("indexableText.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "thumbnail-version" => Some(("thumbnailVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "explicitly-trashed" => Some(("explicitlyTrashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-app-authorized" => Some(("isAppAuthorized", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "last-modifying-user-name" => Some(("lastModifyingUserName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writers-can-share" => Some(("writersCanShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1811,6 +1943,12 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.is-authenticated-user" => Some(("sharingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.height" => Some(("videoMediaMetadata.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1822,14 +1960,33 @@ impl<'n> Engine<'n> { "last-modifying-user.email-address" => Some(("lastModifyingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "copyable" => Some(("copyable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "folder-color-rgb" => Some(("folderColorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner-names" => Some(("ownerNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-untrash" => Some(("capabilities.canUntrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-restricted-download" => Some(("capabilities.canChangeRestrictedDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-item-into-team-drive" => Some(("capabilities.canMoveItemIntoTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-read-team-drive" => Some(("capabilities.canReadTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "shared-with-me-date" => Some(("sharedWithMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-view-link" => Some(("webViewLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-viewed-by-me-date" => Some(("lastViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "export-links" => Some(("exportLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "shared" => Some(("shared", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "open-with-links" => Some(("openWithLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashed-date" => Some(("trashedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-read-revisions" => Some(("canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "image-media-metadata.exposure-bias" => Some(("imageMediaMetadata.exposureBias", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "image-media-metadata.exposure-time" => Some(("imageMediaMetadata.exposureTime", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), @@ -1856,18 +2013,17 @@ impl<'n> Engine<'n> { "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "last-viewed-by-me-date" => Some(("lastViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "icon-link" => Some(("iconLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-open-with-link" => Some(("defaultOpenWithLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1878,6 +2034,7 @@ impl<'n> Engine<'n> { "user-permission.with-link" => Some(("userPermission.withLink", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "user-permission.domain" => Some(("userPermission.domain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.name" => Some(("userPermission.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-permission.deleted" => Some(("userPermission.deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "user-permission.kind" => Some(("userPermission.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.value" => Some(("userPermission.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.id" => Some(("userPermission.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1890,15 +2047,16 @@ impl<'n> Engine<'n> { "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.photo-link" => Some(("userPermission.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "explicitly-trashed" => Some(("explicitlyTrashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "shareable" => Some(("shareable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-comment", "can-read-revisions", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1924,6 +2082,9 @@ impl<'n> Engine<'n> { "timed-text-language" => { call = call.timed_text_language(value.unwrap_or("")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "pinned" => { call = call.pinned(arg_from_str(value.unwrap_or("false"), err, "pinned", "boolean")); }, @@ -1949,7 +2110,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(["convert", "use-content-as-indexable-text", "ocr-language", "visibility", "pinned", "ocr", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); + v.extend(["convert", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "pinned", "visibility", "ocr", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); v } )); } } @@ -1993,6 +2154,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 { + "team-drive-id" => { + call = call.team_drive_id(value.unwrap_or("")); + }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "spaces" => { call = call.spaces(value.unwrap_or("")); }, @@ -2011,9 +2178,15 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-team-drive-items" => { + call = call.include_team_drive_items(arg_from_str(value.unwrap_or("false"), err, "include-team-drive-items", "boolean")); + }, "corpus" => { call = call.corpus(value.unwrap_or("")); }, + "corpora" => { + call = call.corpora(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2027,7 +2200,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "projection", "max-results", "q", "page-token", "spaces", "corpus"].iter().map(|v|*v)); + v.extend(["order-by", "projection", "include-team-drive-items", "corpora", "supports-team-drives", "q", "page-token", "spaces", "max-results", "team-drive-id", "corpus"].iter().map(|v|*v)); v } )); } } @@ -2086,6 +2259,7 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "has-thumbnail" => Some(("hasThumbnail", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "mime-type" => Some(("mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "app-data-contents" => Some(("appDataContents", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "thumbnail-link" => Some(("thumbnailLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels.restricted" => Some(("labels.restricted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2096,7 +2270,7 @@ impl<'n> Engine<'n> { "labels.trashed" => Some(("labels.trashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "indexable-text.text" => Some(("indexableText.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "thumbnail-version" => Some(("thumbnailVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "explicitly-trashed" => Some(("explicitlyTrashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-app-authorized" => Some(("isAppAuthorized", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "last-modifying-user-name" => Some(("lastModifyingUserName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writers-can-share" => Some(("writersCanShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2108,6 +2282,12 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.is-authenticated-user" => Some(("sharingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.height" => Some(("videoMediaMetadata.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2119,14 +2299,33 @@ impl<'n> Engine<'n> { "last-modifying-user.email-address" => Some(("lastModifyingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "copyable" => Some(("copyable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "folder-color-rgb" => Some(("folderColorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner-names" => Some(("ownerNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-untrash" => Some(("capabilities.canUntrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-restricted-download" => Some(("capabilities.canChangeRestrictedDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-item-into-team-drive" => Some(("capabilities.canMoveItemIntoTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-read-team-drive" => Some(("capabilities.canReadTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "shared-with-me-date" => Some(("sharedWithMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-view-link" => Some(("webViewLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-viewed-by-me-date" => Some(("lastViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "export-links" => Some(("exportLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "shared" => Some(("shared", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "open-with-links" => Some(("openWithLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashed-date" => Some(("trashedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-read-revisions" => Some(("canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "image-media-metadata.exposure-bias" => Some(("imageMediaMetadata.exposureBias", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "image-media-metadata.exposure-time" => Some(("imageMediaMetadata.exposureTime", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), @@ -2153,18 +2352,17 @@ impl<'n> Engine<'n> { "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "last-viewed-by-me-date" => Some(("lastViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "icon-link" => Some(("iconLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-open-with-link" => Some(("defaultOpenWithLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2175,6 +2373,7 @@ impl<'n> Engine<'n> { "user-permission.with-link" => Some(("userPermission.withLink", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "user-permission.domain" => Some(("userPermission.domain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.name" => Some(("userPermission.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-permission.deleted" => Some(("userPermission.deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "user-permission.kind" => Some(("userPermission.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.value" => Some(("userPermission.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.id" => Some(("userPermission.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2187,15 +2386,16 @@ impl<'n> Engine<'n> { "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.photo-link" => Some(("userPermission.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "explicitly-trashed" => Some(("explicitlyTrashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "shareable" => Some(("shareable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-comment", "can-read-revisions", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2221,6 +2421,9 @@ impl<'n> Engine<'n> { "timed-text-language" => { call = call.timed_text_language(value.unwrap_or("")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "set-modified-date" => { call = call.set_modified_date(arg_from_str(value.unwrap_or("false"), err, "set-modified-date", "boolean")); }, @@ -2261,7 +2464,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(["add-parents", "convert", "ocr", "set-modified-date", "modified-date-behavior", "use-content-as-indexable-text", "ocr-language", "new-revision", "pinned", "remove-parents", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); + v.extend(["add-parents", "new-revision", "ocr", "remove-parents", "convert", "modified-date-behavior", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "pinned", "set-modified-date", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); v } )); } } @@ -2301,6 +2504,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2314,6 +2520,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 } )); } } @@ -2353,6 +2560,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2366,6 +2576,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 } )); } } @@ -2405,6 +2616,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2418,6 +2632,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 } )); } } @@ -2476,6 +2691,7 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "has-thumbnail" => Some(("hasThumbnail", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "mime-type" => Some(("mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "app-data-contents" => Some(("appDataContents", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "thumbnail-link" => Some(("thumbnailLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "labels.restricted" => Some(("labels.restricted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2486,7 +2702,7 @@ impl<'n> Engine<'n> { "labels.trashed" => Some(("labels.trashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "indexable-text.text" => Some(("indexableText.text", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "thumbnail-version" => Some(("thumbnailVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "explicitly-trashed" => Some(("explicitlyTrashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "is-app-authorized" => Some(("isAppAuthorized", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "last-modifying-user-name" => Some(("lastModifyingUserName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "writers-can-share" => Some(("writersCanShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -2498,6 +2714,12 @@ impl<'n> Engine<'n> { "sharing-user.permission-id" => Some(("sharingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "sharing-user.is-authenticated-user" => Some(("sharingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "sharing-user.email-address" => Some(("sharingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.picture.url" => Some(("trashingUser.picture.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.is-authenticated-user" => Some(("trashingUser.isAuthenticatedUser", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.width" => Some(("videoMediaMetadata.width", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "video-media-metadata.duration-millis" => Some(("videoMediaMetadata.durationMillis", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "video-media-metadata.height" => Some(("videoMediaMetadata.height", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2509,14 +2731,33 @@ impl<'n> Engine<'n> { "last-modifying-user.email-address" => Some(("lastModifyingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "copyable" => Some(("copyable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "folder-color-rgb" => Some(("folderColorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner-names" => Some(("ownerNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-untrash" => Some(("capabilities.canUntrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-restricted-download" => Some(("capabilities.canChangeRestrictedDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-item-into-team-drive" => Some(("capabilities.canMoveItemIntoTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-read-team-drive" => Some(("capabilities.canReadTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "shared-with-me-date" => Some(("sharedWithMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-view-link" => Some(("webViewLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "last-viewed-by-me-date" => Some(("lastViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "export-links" => Some(("exportLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "shared" => Some(("shared", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "open-with-links" => Some(("openWithLinks", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "full-file-extension" => Some(("fullFileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashed-date" => Some(("trashedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-read-revisions" => Some(("canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "image-media-metadata.exposure-bias" => Some(("imageMediaMetadata.exposureBias", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "image-media-metadata.exposure-time" => Some(("imageMediaMetadata.exposureTime", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), @@ -2543,18 +2784,17 @@ impl<'n> Engine<'n> { "image-media-metadata.camera-model" => Some(("imageMediaMetadata.cameraModel", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "editable" => Some(("editable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "marked-viewed-by-me-date" => Some(("markedViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "can-comment" => Some(("canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-date" => Some(("createdDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "last-viewed-by-me-date" => Some(("lastViewedByMeDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "icon-link" => Some(("iconLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "default-open-with-link" => Some(("defaultOpenWithLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "embed-link" => Some(("embedLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "alternate-link" => Some(("alternateLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "title" => Some(("title", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2565,6 +2805,7 @@ impl<'n> Engine<'n> { "user-permission.with-link" => Some(("userPermission.withLink", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "user-permission.domain" => Some(("userPermission.domain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.name" => Some(("userPermission.name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "user-permission.deleted" => Some(("userPermission.deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "user-permission.kind" => Some(("userPermission.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.value" => Some(("userPermission.value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.id" => Some(("userPermission.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2577,15 +2818,16 @@ impl<'n> Engine<'n> { "user-permission.additional-roles" => Some(("userPermission.additionalRoles", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "user-permission.self-link" => Some(("userPermission.selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-permission.photo-link" => Some(("userPermission.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "explicitly-trashed" => Some(("explicitlyTrashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "shareable" => Some(("shareable", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "original-filename" => Some(("originalFilename", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "modified-date" => Some(("modifiedDate", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "file-size" => Some(("fileSize", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-comment", "can-read-revisions", "color-space", "copyable", "created-date", "date", "default-open-with-link", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "alternate-link", "altitude", "aperture", "app-data-contents", "auth-key", "camera-make", "camera-model", "can-add-children", "can-change-restricted-download", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "copyable", "created-date", "date", "default-open-with-link", "deleted", "description", "display-name", "domain", "download-url", "duration-millis", "editable", "email-address", "embed-link", "etag", "expiration-date", "explicitly-trashed", "export-links", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "file-size", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "hidden", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "is-authenticated-user", "iso-speed", "kind", "labels", "last-modifying-user", "last-modifying-user-name", "last-viewed-by-me-date", "latitude", "lens", "location", "longitude", "marked-viewed-by-me-date", "max-aperture-value", "md5-checksum", "metering-mode", "mime-type", "modified", "modified-by-me-date", "modified-date", "name", "open-with-links", "original-filename", "owned-by-me", "owner-names", "permission-id", "photo-link", "picture", "quota-bytes-used", "restricted", "role", "rotation", "self-link", "sensor", "shareable", "shared", "shared-with-me-date", "sharing-user", "spaces", "starred", "subject-distance", "team-drive-id", "text", "thumbnail", "thumbnail-link", "thumbnail-version", "title", "trashed", "trashed-date", "trashing-user", "type", "url", "user-permission", "value", "version", "video-media-metadata", "viewed", "web-content-link", "web-view-link", "white-balance", "width", "with-link", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2611,6 +2853,9 @@ impl<'n> Engine<'n> { "timed-text-language" => { call = call.timed_text_language(value.unwrap_or("")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "set-modified-date" => { call = call.set_modified_date(arg_from_str(value.unwrap_or("false"), err, "set-modified-date", "boolean")); }, @@ -2651,7 +2896,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(["add-parents", "convert", "ocr", "set-modified-date", "modified-date-behavior", "use-content-as-indexable-text", "ocr-language", "new-revision", "pinned", "remove-parents", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); + v.extend(["add-parents", "new-revision", "ocr", "remove-parents", "convert", "modified-date-behavior", "use-content-as-indexable-text", "ocr-language", "supports-team-drives", "pinned", "set-modified-date", "update-viewed-date", "timed-text-track-name", "timed-text-language"].iter().map(|v|*v)); v } )); } } @@ -2741,6 +2986,9 @@ impl<'n> Engine<'n> { "update-viewed-date" => { call = call.update_viewed_date(arg_from_str(value.unwrap_or("false"), err, "update-viewed-date", "boolean")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "revision-id" => { call = call.revision_id(value.unwrap_or("")); }, @@ -2766,7 +3014,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(["revision-id", "update-viewed-date", "acknowledge-abuse", "projection"].iter().map(|v|*v)); + v.extend(["revision-id", "update-viewed-date", "acknowledge-abuse", "projection", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -2944,6 +3192,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -2957,6 +3208,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 } )); } } @@ -3048,6 +3300,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -3061,6 +3316,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 } )); } } @@ -3092,6 +3348,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -3105,6 +3364,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 } )); } } @@ -3216,6 +3476,7 @@ impl<'n> Engine<'n> { "with-link" => Some(("withLink", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "domain" => Some(("domain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deleted" => Some(("deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "value" => Some(("value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3229,7 +3490,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "photo-link" => Some(("photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "auth-key", "domain", "email-address", "etag", "expiration-date", "id", "kind", "name", "photo-link", "role", "self-link", "type", "value", "with-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "auth-key", "deleted", "domain", "email-address", "etag", "expiration-date", "id", "kind", "name", "photo-link", "role", "self-link", "type", "value", "with-link"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3243,6 +3504,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "send-notification-emails" => { call = call.send_notification_emails(arg_from_str(value.unwrap_or("false"), err, "send-notification-emails", "boolean")); }, @@ -3262,7 +3526,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"].iter().map(|v|*v)); + v.extend(["email-message", "send-notification-emails", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -3302,6 +3566,15 @@ 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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, + "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 { @@ -3315,6 +3588,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 } )); } } @@ -3374,6 +3648,7 @@ impl<'n> Engine<'n> { "with-link" => Some(("withLink", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "domain" => Some(("domain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deleted" => Some(("deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "value" => Some(("value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3387,7 +3662,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "photo-link" => Some(("photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "auth-key", "domain", "email-address", "etag", "expiration-date", "id", "kind", "name", "photo-link", "role", "self-link", "type", "value", "with-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "auth-key", "deleted", "domain", "email-address", "etag", "expiration-date", "id", "kind", "name", "photo-link", "role", "self-link", "type", "value", "with-link"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3404,6 +3679,9 @@ impl<'n> Engine<'n> { "transfer-ownership" => { call = call.transfer_ownership(arg_from_str(value.unwrap_or("false"), err, "transfer-ownership", "boolean")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "remove-expiration" => { call = call.remove_expiration(arg_from_str(value.unwrap_or("false"), err, "remove-expiration", "boolean")); }, @@ -3420,7 +3698,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", "remove-expiration"].iter().map(|v|*v)); + v.extend(["transfer-ownership", "supports-team-drives", "remove-expiration"].iter().map(|v|*v)); v } )); } } @@ -3480,6 +3758,7 @@ impl<'n> Engine<'n> { "with-link" => Some(("withLink", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "domain" => Some(("domain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "deleted" => Some(("deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "value" => Some(("value", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3493,7 +3772,7 @@ impl<'n> Engine<'n> { "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "photo-link" => Some(("photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "auth-key", "domain", "email-address", "etag", "expiration-date", "id", "kind", "name", "photo-link", "role", "self-link", "type", "value", "with-link"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-roles", "auth-key", "deleted", "domain", "email-address", "etag", "expiration-date", "id", "kind", "name", "photo-link", "role", "self-link", "type", "value", "with-link"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3510,6 +3789,9 @@ impl<'n> Engine<'n> { "transfer-ownership" => { call = call.transfer_ownership(arg_from_str(value.unwrap_or("false"), err, "transfer-ownership", "boolean")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "remove-expiration" => { call = call.remove_expiration(arg_from_str(value.unwrap_or("false"), err, "remove-expiration", "boolean")); }, @@ -3526,7 +3808,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", "remove-expiration"].iter().map(|v|*v)); + v.extend(["transfer-ownership", "supports-team-drives", "remove-expiration"].iter().map(|v|*v)); v } )); } } @@ -4932,6 +5214,377 @@ impl<'n> Engine<'n> { } } + fn _teamdrives_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.teamdrives().delete(opt.value_of("team-drive-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.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 _teamdrives_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.teamdrives().get(opt.value_of("team-drive-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _teamdrives_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 })), + "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 })), + "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 })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-manage-members" => Some(("capabilities.canManageMembers", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-team-drive-background" => Some(("capabilities.canChangeTeamDriveBackground", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete-team-drive" => Some(("capabilities.canDeleteTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename-team-drive" => Some(("capabilities.canRenameTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "background-image-file.width" => Some(("backgroundImageFile.width", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "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 })), + "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"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TeamDrive = json::value::from_value(object).unwrap(); + let mut call = self.hub.teamdrives().insert(request, opt.value_of("request-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _teamdrives_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.teamdrives().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("")); + }, + "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 _teamdrives_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 })), + "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 })), + "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 })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-manage-members" => Some(("capabilities.canManageMembers", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-team-drive-background" => Some(("capabilities.canChangeTeamDriveBackground", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete-team-drive" => Some(("capabilities.canDeleteTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename-team-drive" => Some(("capabilities.canRenameTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "background-image-file.width" => Some(("backgroundImageFile.width", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "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 })), + "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"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TeamDrive = json::value::from_value(object).unwrap(); + let mut call = self.hub.teamdrives().update(request, opt.value_of("team-drive-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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(()); @@ -4967,6 +5620,9 @@ impl<'n> Engine<'n> { ("get", Some(opt)) => { call_result = self._changes_get(opt, dry_run, &mut err); }, + ("get-start-page-token", Some(opt)) => { + call_result = self._changes_get_start_page_token(opt, dry_run, &mut err); + }, ("list", Some(opt)) => { call_result = self._changes_list(opt, dry_run, &mut err); }, @@ -5224,6 +5880,29 @@ impl<'n> Engine<'n> { } } }, + ("teamdrives", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._teamdrives_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._teamdrives_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._teamdrives_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._teamdrives_list(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._teamdrives_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("teamdrives".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); @@ -5367,7 +6046,7 @@ fn main() { ]), ]), - ("changes", "methods: 'get', 'list' and 'watch'", vec![ + ("changes", "methods: 'get', 'get-start-page-token', 'list' and 'watch'", vec![ ("get", Some(r##"Gets a specific change."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/changes_get", @@ -5384,6 +6063,22 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get-start-page-token", + Some(r##"Gets the starting pageToken for listing future changes."##), + "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/changes_get-start-page-token", + 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"##), @@ -5391,7 +6086,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists the changes for a user."##), + Some(r##"Lists the changes for a user or Team Drive."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/changes_list", vec![ (Some(r##"v"##), @@ -5753,7 +6448,7 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file."##), + Some(r##"Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/files_delete", vec![ (Some(r##"file-id"##), @@ -5939,7 +6634,7 @@ fn main() { Some(false)), ]), ("trash", - Some(r##"Moves a file to the trash. The currently authenticated user must own the file."##), + Some(r##"Moves a file to the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/files_trash", vec![ (Some(r##"file-id"##), @@ -6151,12 +6846,12 @@ fn main() { ("permissions", "methods: 'delete', 'get', 'get-id-for-email', 'insert', 'list', 'patch' and 'update'", vec![ ("delete", - Some(r##"Deletes a permission from a file."##), + Some(r##"Deletes a permission from a file or Team Drive."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/permissions_delete", vec![ (Some(r##"file-id"##), None, - Some(r##"The ID for the file."##), + Some(r##"The ID for the file or Team Drive."##), Some(true), Some(false)), @@ -6178,7 +6873,7 @@ fn main() { vec![ (Some(r##"file-id"##), None, - Some(r##"The ID for the file."##), + Some(r##"The ID for the file or Team Drive."##), Some(true), Some(false)), @@ -6223,12 +6918,12 @@ fn main() { Some(false)), ]), ("insert", - Some(r##"Inserts a permission for a file."##), + Some(r##"Inserts a permission for a file or Team Drive."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/permissions_insert", vec![ (Some(r##"file-id"##), None, - Some(r##"The ID for the file."##), + Some(r##"The ID for the file or Team Drive."##), Some(true), Some(false)), @@ -6251,12 +6946,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists a file's permissions."##), + Some(r##"Lists a file's or Team Drive's permissions."##), "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/permissions_list", vec![ (Some(r##"file-id"##), None, - Some(r##"The ID for the file."##), + Some(r##"The ID for the file or Team Drive."##), Some(true), Some(false)), @@ -6278,7 +6973,7 @@ fn main() { vec![ (Some(r##"file-id"##), None, - Some(r##"The ID for the file."##), + Some(r##"The ID for the file or Team Drive."##), Some(true), Some(false)), @@ -6312,7 +7007,7 @@ fn main() { vec![ (Some(r##"file-id"##), None, - Some(r##"The ID for the file."##), + Some(r##"The ID for the file or Team Drive."##), Some(true), Some(false)), @@ -6910,11 +7605,124 @@ fn main() { ]), ]), + ("teamdrives", "methods: 'delete', 'get', 'insert', 'list' and 'update'", vec![ + ("delete", + Some(r##"Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items."##), + "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/teamdrives_delete", + vec![ + (Some(r##"team-drive-id"##), + None, + Some(r##"The ID of the Team Drive"##), + Some(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 a Team Drive's metadata by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/teamdrives_get", + vec![ + (Some(r##"team-drive-id"##), + None, + Some(r##"The ID of the Team Drive"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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 new Team Drive."##), + "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/teamdrives_insert", + vec![ + (Some(r##"request-id"##), + None, + Some(r##"An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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 user's Team Drives."##), + "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/teamdrives_list", + vec![ + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update", + Some(r##"Updates a Team Drive's metadata"##), + "Details at http://byron.github.io/google-apis-rs/google_drive2_cli/teamdrives_update", + vec![ + (Some(r##"team-drive-id"##), + None, + Some(r##"The ID of the Team Drive"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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("drive2") .author("Sebastian Thiel ") - .version("1.0.4+20161212") + .version("1.0.4+20170512") .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 4e4fb57cb4..75727fd7b2 100644 --- a/gen/drive2/Cargo.toml +++ b/gen/drive2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-drive2" -version = "1.0.4+20161212" +version = "1.0.4+20170512" 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.4+20161212" +documentation = "https://docs.rs/google-drive2/1.0.4+20170512" license = "MIT" keywords = ["drive", "google", "protocol", "web", "api"] diff --git a/gen/drive2/README.md b/gen/drive2/README.md index 7808c00194..d50b5ed09f 100644 --- a/gen/drive2/README.md +++ b/gen/drive2/README.md @@ -5,62 +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.4+20161212*, where *20161212* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *drive* crate version *1.0.4+20170512*, where *20170512* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161212/google_drive2/struct.Drive.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.Drive.html) ... -* [about](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.About.html) - * [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.AboutGetCall.html) -* [apps](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.App.html) - * [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.AppGetCall.html) and [*list*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.AppListCall.html) -* [changes](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.Change.html) - * [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ChangeGetCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ChangeWatchCall.html) -* [channels](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.Channel.html) - * [*stop*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ChannelStopCall.html) +* [about](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.About.html) + * [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.AboutGetCall.html) +* [apps](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.App.html) + * [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.AppGetCall.html) and [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.AppListCall.html) +* [changes](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.Change.html) + * [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChangeGetCall.html), [*get start page token*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChangeWatchCall.html) +* [channels](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.Channel.html) + * [*stop*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChannelStopCall.html) * children - * [*delete*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ChildrenDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ChildrenGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ChildrenInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ChildrenListCall.html) -* [comments](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.Comment.html) - * [*delete*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.CommentListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.CommentPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.CommentUpdateCall.html) -* [files](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.File.html) - * [*copy*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileCopyCall.html), [*delete*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FilePatchCall.html), [*touch*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileTouchCall.html), [*trash*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileTrashCall.html), [*untrash*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileUntrashCall.html), [*update*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileWatchCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChildrenDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChildrenGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChildrenInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChildrenListCall.html) +* [comments](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.Comment.html) + * [*delete*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.CommentListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.CommentPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.CommentUpdateCall.html) +* [files](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.File.html) + * [*copy*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileCopyCall.html), [*delete*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FilePatchCall.html), [*touch*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileTouchCall.html), [*trash*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileTrashCall.html), [*untrash*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileUntrashCall.html), [*update*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileWatchCall.html) * parents - * [*delete*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ParentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ParentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ParentInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ParentListCall.html) -* [permissions](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.Permission.html) - * [*delete*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PermissionGetCall.html), [*get id for email*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PermissionGetIdForEmailCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PermissionInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PermissionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PermissionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PermissionUpdateCall.html) -* [properties](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.Property.html) - * [*delete*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PropertyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PropertyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PropertyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PropertyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PropertyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.PropertyUpdateCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ParentDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ParentGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ParentInsertCall.html) and [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ParentListCall.html) +* [permissions](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.Permission.html) + * [*delete*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PermissionGetCall.html), [*get id for email*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PermissionGetIdForEmailCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PermissionInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PermissionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PermissionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PermissionUpdateCall.html) +* [properties](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.Property.html) + * [*delete*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PropertyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PropertyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PropertyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PropertyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PropertyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.PropertyUpdateCall.html) * realtime - * [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.RealtimeGetCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.RealtimeUpdateCall.html) + * [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.RealtimeGetCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.RealtimeUpdateCall.html) * replies - * [*delete*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ReplyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ReplyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ReplyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ReplyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ReplyUpdateCall.html) -* [revisions](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.Revision.html) - * [*delete*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.RevisionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.RevisionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.RevisionUpdateCall.html) + * [*delete*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ReplyGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ReplyInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ReplyListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ReplyPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ReplyUpdateCall.html) +* [revisions](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.Revision.html) + * [*delete*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.RevisionListCall.html), [*patch*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.RevisionPatchCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.RevisionUpdateCall.html) +* teamdrives + * [*delete*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.TeamdriveGetCall.html), [*insert*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.TeamdriveInsertCall.html), [*list*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.TeamdriveUpdateCall.html) Upload supported by ... -* [*insert files*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileInsertCall.html) -* [*update realtime*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.RealtimeUpdateCall.html) -* [*update files*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileUpdateCall.html) +* [*update files*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileUpdateCall.html) +* [*insert files*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileInsertCall.html) +* [*update realtime*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.RealtimeUpdateCall.html) Download supported by ... -* [*watch files*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileWatchCall.html) -* [*get realtime*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.RealtimeGetCall.html) -* [*export files*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileExportCall.html) -* [*get files*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileGetCall.html) +* [*watch files*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileWatchCall.html) +* [*get realtime*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.RealtimeGetCall.html) +* [*get files*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileGetCall.html) +* [*export files*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileExportCall.html) Subscription supported by ... -* [*watch files*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileWatchCall.html) -* [*watch changes*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ChangeWatchCall.html) -* [*insert files*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileInsertCall.html) -* [*list changes*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.ChangeListCall.html) -* [*get files*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.FileGetCall.html) +* [*watch files*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileWatchCall.html) +* [*insert files*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileInsertCall.html) +* [*get files*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.FileGetCall.html) +* [*watch changes*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChangeWatchCall.html) +* [*list changes*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/struct.ChangeListCall.html) @@ -68,17 +70,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/struct.Drive.html)** +* **[Hub](https://docs.rs/google-drive2/1.0.4+20170512/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.4+20161212/google_drive2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-drive2/1.0.4+20170512/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.4+20161212/google_drive2/trait.Part.html)** + * **[Parts](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-drive2/1.0.4+20161212/google_drive2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-drive2/1.0.4+20170512/google_drive2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -161,15 +163,16 @@ let result = hub.files().patch(req, "fileId") .update_viewed_date(false) .timed_text_track_name("sed") .timed_text_language("et") - .set_modified_date(true) - .remove_parents("kasd") + .supports_team_drives(true) + .set_modified_date(false) + .remove_parents("accusam") .pinned(true) - .ocr_language("takimata") - .ocr(false) - .new_revision(true) - .modified_date_behavior("erat") + .ocr_language("justo") + .ocr(true) + .new_revision(false) + .modified_date_behavior("labore") .convert(true) - .add_parents("sea") + .add_parents("nonumy") .doit(); match result { @@ -192,17 +195,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-drive2/1.0.4+20161212/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.4+20170512/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.4+20161212/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.4+20170512/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.4+20161212/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.4+20170512/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.4+20161212/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.4+20170512/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")`. @@ -212,29 +215,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.4+20161212/google_drive2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-drive2/1.0.4+20161212/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.4+20170512/google_drive2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-drive2/1.0.4+20170512/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.4+20161212/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.4+20170512/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.4+20161212/google_drive2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-drive2/1.0.4+20161212/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.4+20170512/google_drive2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-drive2/1.0.4+20170512/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.4+20161212/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.4+20170512/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.4+20161212/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.4+20170512/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.4+20161212/google_drive2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-drive2/1.0.4+20170512/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 90117fb6cf..c45605c4b7 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.4+20161212*, where *20161212* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *drive* crate version *1.0.4+20170512*, where *20170512* is the exact revision of the *drive:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *drive* *v2* API can be found at the //! [official documentation site](https://developers.google.com/drive/). @@ -16,7 +16,7 @@ //! * [apps](struct.App.html) //! * [*get*](struct.AppGetCall.html) and [*list*](struct.AppListCall.html) //! * [changes](struct.Change.html) -//! * [*get*](struct.ChangeGetCall.html), [*list*](struct.ChangeListCall.html) and [*watch*](struct.ChangeWatchCall.html) +//! * [*get*](struct.ChangeGetCall.html), [*get start page token*](struct.ChangeGetStartPageTokenCall.html), [*list*](struct.ChangeListCall.html) and [*watch*](struct.ChangeWatchCall.html) //! * [channels](struct.Channel.html) //! * [*stop*](struct.ChannelStopCall.html) //! * children @@ -37,28 +37,30 @@ //! * [*delete*](struct.ReplyDeleteCall.html), [*get*](struct.ReplyGetCall.html), [*insert*](struct.ReplyInsertCall.html), [*list*](struct.ReplyListCall.html), [*patch*](struct.ReplyPatchCall.html) and [*update*](struct.ReplyUpdateCall.html) //! * [revisions](struct.Revision.html) //! * [*delete*](struct.RevisionDeleteCall.html), [*get*](struct.RevisionGetCall.html), [*list*](struct.RevisionListCall.html), [*patch*](struct.RevisionPatchCall.html) and [*update*](struct.RevisionUpdateCall.html) +//! * teamdrives +//! * [*delete*](struct.TeamdriveDeleteCall.html), [*get*](struct.TeamdriveGetCall.html), [*insert*](struct.TeamdriveInsertCall.html), [*list*](struct.TeamdriveListCall.html) and [*update*](struct.TeamdriveUpdateCall.html) //! //! //! Upload supported by ... //! +//! * [*update files*](struct.FileUpdateCall.html) //! * [*insert files*](struct.FileInsertCall.html) //! * [*update realtime*](struct.RealtimeUpdateCall.html) -//! * [*update files*](struct.FileUpdateCall.html) //! //! Download supported by ... //! //! * [*watch files*](struct.FileWatchCall.html) //! * [*get realtime*](struct.RealtimeGetCall.html) -//! * [*export files*](struct.FileExportCall.html) //! * [*get files*](struct.FileGetCall.html) +//! * [*export files*](struct.FileExportCall.html) //! //! Subscription supported by ... //! //! * [*watch files*](struct.FileWatchCall.html) -//! * [*watch changes*](struct.ChangeWatchCall.html) //! * [*insert files*](struct.FileInsertCall.html) -//! * [*list changes*](struct.ChangeListCall.html) //! * [*get files*](struct.FileGetCall.html) +//! * [*watch changes*](struct.ChangeWatchCall.html) +//! * [*list changes*](struct.ChangeListCall.html) //! //! //! @@ -158,19 +160,20 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.files().patch(req, "fileId") -//! .use_content_as_indexable_text(true) +//! .use_content_as_indexable_text(false) //! .update_viewed_date(false) -//! .timed_text_track_name("sadipscing") -//! .timed_text_language("aliquyam") -//! .set_modified_date(false) -//! .remove_parents("no") +//! .timed_text_track_name("aliquyam") +//! .timed_text_language("ea") +//! .supports_team_drives(false) +//! .set_modified_date(true) +//! .remove_parents("justo") //! .pinned(true) -//! .ocr_language("justo") +//! .ocr_language("et") //! .ocr(true) -//! .new_revision(true) -//! .modified_date_behavior("diam") -//! .convert(false) -//! .add_parents("Lorem") +//! .new_revision(false) +//! .modified_date_behavior("Lorem") +//! .convert(true) +//! .add_parents("duo") //! .doit(); //! //! match result { @@ -247,7 +250,7 @@ // 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 +// 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)] @@ -386,19 +389,20 @@ impl Default for Scope { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().patch(req, "fileId") -/// .use_content_as_indexable_text(false) -/// .update_viewed_date(true) -/// .timed_text_track_name("sea") -/// .timed_text_language("Lorem") -/// .set_modified_date(false) -/// .remove_parents("erat") -/// .pinned(false) -/// .ocr_language("dolor") -/// .ocr(true) +/// .use_content_as_indexable_text(true) +/// .update_viewed_date(false) +/// .timed_text_track_name("eos") +/// .timed_text_language("erat") +/// .supports_team_drives(false) +/// .set_modified_date(true) +/// .remove_parents("eirmod") +/// .pinned(true) +/// .ocr_language("amet") +/// .ocr(false) /// .new_revision(true) -/// .modified_date_behavior("amet") -/// .convert(false) -/// .add_parents("labore") +/// .modified_date_behavior("eirmod") +/// .convert(true) +/// .add_parents("invidunt") /// .doit(); /// /// match result { @@ -423,8 +427,6 @@ pub struct Drive { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Drive {} @@ -437,8 +439,6 @@ impl<'a, C, A> Drive client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/drive/v2/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -481,6 +481,9 @@ impl<'a, C, A> Drive pub fn revisions(&'a self) -> RevisionMethods<'a, C, A> { RevisionMethods { hub: &self } } + pub fn teamdrives(&'a self) -> TeamdriveMethods<'a, C, A> { + TeamdriveMethods { 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.4`. @@ -491,476 +494,64 @@ impl<'a, C, A> Drive self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/drive/v2/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// A reference to a file's parent. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 parents](struct.ParentGetCall.html) (response) -/// * [insert parents](struct.ParentInsertCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ParentReference { - /// Whether or not the parent is the root folder. - #[serde(rename="isRoot")] - pub is_root: Option, - /// This is always drive#parentReference. - pub kind: Option, - /// The ID of the parent. - pub id: Option, - /// A link back to this reference. - #[serde(rename="selfLink")] - pub self_link: Option, - /// A link to the parent. - #[serde(rename="parentLink")] - pub parent_link: Option, -} - -impl RequestValue for ParentReference {} -impl ResponseResult for ParentReference {} - - -/// A comment on a file in Google Drive. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 comments](struct.CommentUpdateCall.html) (request|response) -/// * [insert comments](struct.CommentInsertCall.html) (request|response) -/// * [delete comments](struct.CommentDeleteCall.html) (none) -/// * [patch comments](struct.CommentPatchCall.html) (request|response) -/// * [get comments](struct.CommentGetCall.html) (response) -/// * [list comments](struct.CommentListCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Comment { - /// The status of this comment. Status can be changed by posting a reply to a comment with the desired status. - /// - "open" - The comment is still open. - /// - "resolved" - The comment has been resolved by one of its replies. - pub status: Option, - /// A link back to this comment. - #[serde(rename="selfLink")] - pub self_link: Option, - /// This is always drive#comment. - pub kind: Option, - /// The user who wrote this comment. - pub author: Option, - /// Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed. - pub deleted: Option, - /// The date when this comment was first created. - #[serde(rename="createdDate")] - pub created_date: Option, - /// HTML formatted content for this comment. - #[serde(rename="htmlContent")] - pub html_content: Option, - /// The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content. - pub content: Option, - /// The date when this comment or any of its replies were last modified. - #[serde(rename="modifiedDate")] - pub modified_date: Option, - /// The context of the file which is being commented on. - pub context: Option, - /// Replies to this post. - pub replies: Option>, - /// The ID of the comment. - #[serde(rename="commentId")] - pub comment_id: Option, - /// A region of the document represented as a JSON string. See anchor documentation for details on how to define and interpret anchor properties. - pub anchor: Option, - /// The title of the file which this comment is addressing. - #[serde(rename="fileTitle")] - pub file_title: Option, - /// The file which this comment is addressing. - #[serde(rename="fileId")] - pub file_id: Option, -} - -impl RequestValue for Comment {} -impl Resource for Comment {} -impl ResponseResult for Comment {} - - -/// An item with user information and settings. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 about](struct.AboutGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct About { - /// The user's language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/). - #[serde(rename="languageCode")] - pub language_code: Option, - /// The amount of storage quota used by different Google services. - #[serde(rename="quotaBytesByService")] - pub quota_bytes_by_service: Option>, - /// List of additional features enabled on this account. - pub features: Option>, - /// The number of quota bytes used by Google Drive. - #[serde(rename="quotaBytesUsed")] - pub quota_bytes_used: Option, - /// This is always drive#about. - pub kind: Option, - /// Information about supported additional roles per file type. The most specific type takes precedence. - #[serde(rename="additionalRoleInfo")] - pub additional_role_info: Option>, - /// The palette of allowable folder colors as RGB hex strings. - #[serde(rename="folderColorPalette")] - pub folder_color_palette: Option>, - /// The authenticated user. - pub user: Option, - /// The type of the user's storage quota. Possible values are: - /// - LIMITED - /// - UNLIMITED - #[serde(rename="quotaType")] - pub quota_type: Option, - /// The number of quota bytes used by all Google apps (Drive, Picasa, etc.). - #[serde(rename="quotaBytesUsedAggregate")] - pub quota_bytes_used_aggregate: Option, - /// List of max upload sizes for each file type. The most specific type takes precedence. - #[serde(rename="maxUploadSizes")] - pub max_upload_sizes: Option>, - /// The current user's ID as visible in the permissions collection. - #[serde(rename="permissionId")] - pub permission_id: Option, - /// The name of the current user. - pub name: Option, - /// The total number of quota bytes. - #[serde(rename="quotaBytesTotal")] - pub quota_bytes_total: Option, - /// The number of remaining change ids, limited to no more than 2500. - #[serde(rename="remainingChangeIds")] - pub remaining_change_ids: Option, - /// The ETag of the item. - pub etag: Option, - /// The allowable import formats. - #[serde(rename="importFormats")] - pub import_formats: Option>, - /// The id of the root folder. - #[serde(rename="rootFolderId")] - pub root_folder_id: Option, - /// The largest change id. - #[serde(rename="largestChangeId")] - pub largest_change_id: Option, - /// The number of quota bytes used by trashed items. - #[serde(rename="quotaBytesUsedInTrash")] - pub quota_bytes_used_in_trash: Option, - /// The allowable export formats. - #[serde(rename="exportFormats")] - pub export_formats: Option>, - /// The domain sharing policy for the current user. Possible values are: - /// - allowed - /// - allowedWithWarning - /// - incomingOnly - /// - disallowed - #[serde(rename="domainSharingPolicy")] - pub domain_sharing_policy: Option, - /// A link back to this item. - #[serde(rename="selfLink")] - pub self_link: Option, - /// A boolean indicating whether the authenticated app is installed by the authenticated user. - #[serde(rename="isCurrentAppInstalled")] - pub is_current_app_installed: Option, -} - -impl ResponseResult for About {} - - -/// A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail. +/// Capabilities the current user has on this Team Drive. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FileThumbnail { - /// The MIME type of the thumbnail. - #[serde(rename="mimeType")] - pub mime_type: Option, - /// The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. - pub image: Option, -} - -impl NestedType for FileThumbnail {} -impl Part for FileThumbnail {} - - -/// The metadata for a file. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 files](struct.FileWatchCall.html) (none) -/// * [empty trash files](struct.FileEmptyTrashCall.html) (none) -/// * [generate ids files](struct.FileGenerateIdCall.html) (none) -/// * [copy files](struct.FileCopyCall.html) (request|response) -/// * [list files](struct.FileListCall.html) (none) -/// * [delete files](struct.FileDeleteCall.html) (none) -/// * [patch files](struct.FilePatchCall.html) (request|response) -/// * [update files](struct.FileUpdateCall.html) (request|response) -/// * [insert files](struct.FileInsertCall.html) (request|response) -/// * [untrash files](struct.FileUntrashCall.html) (response) -/// * [trash files](struct.FileTrashCall.html) (response) -/// * [touch files](struct.FileTouchCall.html) (response) -/// * [get files](struct.FileGetCall.html) (response) -/// * [export files](struct.FileExportCall.html) (none) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct File { - /// Whether this file has a thumbnail. - #[serde(rename="hasThumbnail")] - pub has_thumbnail: Option, - /// The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type. - #[serde(rename="mimeType")] - pub mime_type: Option, - /// Whether this file is in the Application Data folder. - #[serde(rename="appDataContents")] - pub app_data_contents: Option, - /// A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. - #[serde(rename="thumbnailLink")] - pub thumbnail_link: Option, - /// A group of labels for the file. - pub labels: Option, - /// Indexable text attributes for the file (can only be written) - #[serde(rename="indexableText")] - pub indexable_text: Option, - /// The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation. - #[serde(rename="thumbnailVersion")] - pub thumbnail_version: Option, - /// Whether this file has been explicitly trashed, as opposed to recursively trashed. - #[serde(rename="explicitlyTrashed")] - pub explicitly_trashed: Option, - /// Whether the file was created or opened by the requesting app. - #[serde(rename="isAppAuthorized")] - pub is_app_authorized: Option, - /// Name of the last user to modify this file. - #[serde(rename="lastModifyingUserName")] - pub last_modifying_user_name: Option, - /// Whether writers can share the document with other users. - #[serde(rename="writersCanShare")] - pub writers_can_share: Option, - /// Whether the file is owned by the current user. - #[serde(rename="ownedByMe")] - pub owned_by_me: Option, - /// Time at which this file was shared with the user (formatted RFC 3339 timestamp). - #[serde(rename="sharedWithMeDate")] - pub shared_with_me_date: Option, - /// User that shared the item with the current user, if available. - #[serde(rename="sharingUser")] - pub sharing_user: Option, - /// Metadata about video media. This will only be present for video types. - #[serde(rename="videoMediaMetadata")] - pub video_media_metadata: Option, - /// The last user to modify this file. - #[serde(rename="lastModifyingUser")] - pub last_modifying_user: Option, - /// Whether the file can be copied by the current user. - pub copyable: Option, - /// Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. - #[serde(rename="folderColorRgb")] - pub folder_color_rgb: Option, - /// Name(s) of the owner(s) of this file. - #[serde(rename="ownerNames")] - pub owner_names: Option>, - /// The type of file. This is always drive#file. - pub kind: Option, - /// The ID of the file. - pub id: Option, - /// A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting. - #[serde(rename="webViewLink")] - pub web_view_link: Option, - /// A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user. - pub version: Option, - /// Collection of parent folders which contain this file. - /// Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder. - pub parents: Option>, - /// Links for exporting Google Docs to specific formats. - #[serde(rename="exportLinks")] - pub export_links: Option>, - /// Whether the file has been shared. - pub shared: Option, - /// A link to the file's icon. - #[serde(rename="iconLink")] - pub icon_link: Option, - /// The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files. - #[serde(rename="fullFileExtension")] - pub full_file_extension: Option, - /// A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used. - #[serde(rename="openWithLinks")] - pub open_with_links: Option>, - /// Whether the current user has read access to the Revisions resource of the file. +pub struct TeamDriveCapabilities { + /// Whether the current user can read the revisions resource of files in this Team Drive. #[serde(rename="canReadRevisions")] pub can_read_revisions: Option, - /// A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. - #[serde(rename="defaultOpenWithLink")] - pub default_open_with_link: Option, - /// A short description of the file. - pub description: Option, - /// A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. - #[serde(rename="webContentLink")] - pub web_content_link: Option, - /// Whether the file can be edited by the current user. - pub editable: Option, - /// Deprecated. - #[serde(rename="markedViewedByMeDate")] - pub marked_viewed_by_me_date: Option, - /// A link for embedding the file. - #[serde(rename="embedLink")] - pub embed_link: Option, - /// Whether the current user can comment on the file. + /// Whether the current user can copy files in this Team Drive. + #[serde(rename="canCopy")] + pub can_copy: Option, + /// Whether the current user can edit files in this Team Drive + #[serde(rename="canEdit")] + pub can_edit: Option, + /// Whether the current user can add children to folders in this Team Drive. + #[serde(rename="canAddChildren")] + pub can_add_children: Option, + /// Whether the current user can share files or folders in this Team Drive. + #[serde(rename="canShare")] + pub can_share: Option, + /// Whether the current user can add members to this Team Drive or remove them or change their role. + #[serde(rename="canManageMembers")] + pub can_manage_members: Option, + /// Whether the current user can download files in this Team Drive. + #[serde(rename="canDownload")] + pub can_download: Option, + /// Whether the current user can comment on files in this Team Drive. #[serde(rename="canComment")] pub can_comment: Option, - /// The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files. - #[serde(rename="fileExtension")] - pub file_extension: Option, - /// Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set. - #[serde(rename="modifiedDate")] - pub modified_date: Option, - /// Create time for this file (formatted RFC 3339 timestamp). - #[serde(rename="createdDate")] - pub created_date: Option, - /// Last time this file was viewed by the user (formatted RFC 3339 timestamp). - #[serde(rename="lastViewedByMeDate")] - pub last_viewed_by_me_date: Option, - /// The list of properties. - pub properties: Option>, - /// An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files. - #[serde(rename="md5Checksum")] - pub md5_checksum: Option, - /// The list of permissions for users with access to this file. - pub permissions: Option>, - /// Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content. - #[serde(rename="imageMediaMetadata")] - pub image_media_metadata: Option, - /// The owner(s) of this file. - pub owners: Option>, - /// ETag of the file. - pub etag: Option, - /// A link for opening the file in a relevant Google editor or viewer. - #[serde(rename="alternateLink")] - pub alternate_link: Option, - /// The title of this file. - pub title: Option, - /// Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. - #[serde(rename="modifiedByMeDate")] - pub modified_by_me_date: Option, - /// A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail. - pub thumbnail: Option, - /// no description provided - #[serde(rename="downloadUrl")] - pub download_url: Option, - /// The permissions for the authenticated user on this file. - #[serde(rename="userPermission")] - pub user_permission: Option, - /// The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. - pub spaces: Option>, - /// Whether the file's sharing settings can be modified by the current user. - pub shareable: Option, - /// The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive. - #[serde(rename="originalFilename")] - pub original_filename: Option, - /// The number of quota bytes used by this file. - #[serde(rename="quotaBytesUsed")] - pub quota_bytes_used: Option, - /// The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files. - #[serde(rename="headRevisionId")] - pub head_revision_id: Option, - /// A link back to this file. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files. - #[serde(rename="fileSize")] - pub file_size: Option, + /// Whether the current user can change the background of this Team Drive. + #[serde(rename="canChangeTeamDriveBackground")] + pub can_change_team_drive_background: Option, + /// Whether the current user can delete this Team Drive. Attempting to delete the Team Drive may still fail if there are untrashed items inside the Team Drive. + #[serde(rename="canDeleteTeamDrive")] + pub can_delete_team_drive: Option, + /// Whether the current user can rename this Team Drive. + #[serde(rename="canRenameTeamDrive")] + pub can_rename_team_drive: Option, + /// Whether the current user can remove children from folders in this Team Drive. + #[serde(rename="canRemoveChildren")] + pub can_remove_children: Option, + /// Whether the current user can list the children of folders in this Team Drive. + #[serde(rename="canListChildren")] + pub can_list_children: Option, + /// Whether the current user can rename files or folders in this Team Drive. + #[serde(rename="canRename")] + pub can_rename: Option, } -impl RequestValue for File {} -impl Resource for File {} -impl ResponseResult for File {} - - -/// Information about supported additional roles per file type. The most specific type takes precedence. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AboutAdditionalRoleInfo { - /// The supported additional roles per primary role. - #[serde(rename="roleSets")] - pub role_sets: Option>, - /// The content type that this additional role info applies to. - #[serde(rename="type")] - pub type_: Option, -} - -impl NestedType for AboutAdditionalRoleInfo {} -impl Part for AboutAdditionalRoleInfo {} - - -/// A list of changes for a user. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list changes](struct.ChangeListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChangeList { - /// The page token for the next page of changes. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// This is always drive#changeList. - pub kind: Option, - /// The ETag of the list. - pub etag: Option, - /// The current largest change ID. - #[serde(rename="largestChangeId")] - pub largest_change_id: Option, - /// The actual list of changes. - pub items: Option>, - /// A link back to this list. - #[serde(rename="selfLink")] - pub self_link: Option, - /// A link to the next page of changes. - #[serde(rename="nextLink")] - pub next_link: Option, -} - -impl ResponseResult for ChangeList {} +impl NestedType for TeamDriveCapabilities {} +impl Part for TeamDriveCapabilities {} /// A collection of properties, key-value pairs that are either public or private to an application. @@ -988,83 +579,6 @@ pub struct PropertyList { impl ResponseResult for PropertyList {} -/// An ID for a user or group as seen in Permission items. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [get id for email permissions](struct.PermissionGetIdForEmailCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PermissionId { - /// This is always drive#permissionId. - pub kind: Option, - /// The permission ID. - pub id: Option, -} - -impl ResponseResult for PermissionId {} - - -/// A list of permissions associated with a file. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 permissions](struct.PermissionListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PermissionList { - /// The actual list of permissions. - pub items: Option>, - /// This is always drive#permissionList. - pub kind: Option, - /// The ETag of the list. - pub etag: Option, - /// A link back to this list. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for PermissionList {} - - -/// Indexable text attributes for the file (can only be written) -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FileIndexableText { - /// The text to be indexed for this file. - pub text: Option, -} - -impl NestedType for FileIndexableText {} -impl Part for FileIndexableText {} - - -/// The supported additional roles per primary 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 AboutAdditionalRoleInfoRoleSets { - /// A primary permission role. - #[serde(rename="primaryRole")] - pub primary_role: Option, - /// The supported additional roles with the primary role. - #[serde(rename="additionalRoles")] - pub additional_roles: Option>, -} - -impl NestedType for AboutAdditionalRoleInfoRoleSets {} -impl Part for AboutAdditionalRoleInfoRoleSets {} - - /// A list of replies to a comment on a file in Google Drive. /// /// # Activities @@ -1076,10 +590,10 @@ impl Part for AboutAdditionalRoleInfoRoleSets {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CommentReplyList { - /// The token to use to request the next page of results. + /// The page token for the next page of replies. This will be absent if the end of the replies list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// List of reply. + /// The list of replies. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. pub items: Option>, /// This is always drive#commentReplyList. pub kind: Option, @@ -1110,195 +624,22 @@ impl NestedType for AboutImportFormats {} impl Part for AboutImportFormats {} -/// A list of revisions of a file. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 revisions](struct.RevisionListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RevisionList { - /// The page token for the next page of revisions. This field will be absent if the end of the revisions list has been reached. If the token is rejected for any reason, it should be discarded and pagination should be restarted from the first page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The actual list of revisions. - pub items: Option>, - /// This is always drive#revisionList. - pub kind: Option, - /// The ETag of the list. - pub etag: Option, - /// A link back to this list. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl ResponseResult for RevisionList {} - - -/// List of max upload sizes for each file type. The most specific type takes precedence. +/// Information about supported additional roles per file type. The most specific type takes precedence. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AboutMaxUploadSizes { - /// The file type. +pub struct AboutAdditionalRoleInfo { + /// The supported additional roles per primary role. + #[serde(rename="roleSets")] + pub role_sets: Option>, + /// The content type that this additional role info applies to. #[serde(rename="type")] pub type_: Option, - /// The max upload size for this type. - pub size: Option, } -impl NestedType for AboutMaxUploadSizes {} -impl Part for AboutMaxUploadSizes {} - - -/// A group of labels for the 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 FileLabels { - /// Whether this file is starred by the user. - pub starred: Option, - /// Whether this file has been viewed by this user. - pub viewed: Option, - /// Whether viewers and commenters are prevented from downloading, printing, and copying this file. - pub restricted: Option, - /// Deprecated. - pub hidden: Option, - /// Whether the file has been modified by this user. - pub modified: Option, - /// Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files. - pub trashed: Option, -} - -impl NestedType for FileLabels {} -impl Part for FileLabels {} - - -/// A list of generated IDs which can be provided in insert 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*). -/// -/// * [generate ids files](struct.FileGenerateIdCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GeneratedIds { - /// This is always drive#generatedIds - pub kind: Option, - /// The IDs generated for the requesting user in the specified space. - pub ids: Option>, - /// The type of file that can be created with these IDs. - pub space: Option, -} - -impl ResponseResult for GeneratedIds {} - - -/// 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 changes](struct.ChangeWatchCall.html) (request|response) -/// * [watch files](struct.FileWatchCall.html) (request|response) -/// * [stop channels](struct.ChannelStopCall.html) (request) -/// -#[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 {} - - -/// A reference to a folder's child. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 children](struct.ChildrenInsertCall.html) (request|response) -/// * [get children](struct.ChildrenGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChildReference { - /// This is always drive#childReference. - pub kind: Option, - /// A link to the child. - #[serde(rename="childLink")] - pub child_link: Option, - /// The ID of the child. - pub id: Option, - /// A link back to this reference. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl RequestValue for ChildReference {} -impl ResponseResult for ChildReference {} - - -/// A list of comments on a file in Google Drive. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 comments](struct.CommentListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CommentList { - /// The token to use to request the next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// List of comments. - pub items: Option>, - /// This is always drive#commentList. - pub kind: Option, - /// A link back to this list. - #[serde(rename="selfLink")] - pub self_link: Option, - /// A link to the next page of comments. - #[serde(rename="nextLink")] - pub next_link: Option, -} - -impl ResponseResult for CommentList {} +impl NestedType for AboutAdditionalRoleInfo {} +impl Part for AboutAdditionalRoleInfo {} /// A list of a file's parents. @@ -1312,7 +653,7 @@ impl ResponseResult for CommentList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ParentList { - /// The actual list of parents. + /// The list of parents. pub items: Option>, /// This is always drive#parentList. pub kind: Option, @@ -1326,44 +667,6 @@ pub struct ParentList { impl ResponseResult for ParentList {} -/// A key-value pair attached to a file that is either public or private to an application. -/// The following limits apply to file properties: -/// - Maximum of 100 properties total per file -/// - Maximum of 30 private properties per app -/// - Maximum of 30 public properties -/// - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 properties](struct.PropertyInsertCall.html) (request|response) -/// * [get properties](struct.PropertyGetCall.html) (response) -/// * [patch properties](struct.PropertyPatchCall.html) (request|response) -/// * [update properties](struct.PropertyUpdateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Property { - /// The link back to this property. - #[serde(rename="selfLink")] - pub self_link: Option, - /// This is always drive#property. - pub kind: Option, - /// ETag of the property. - pub etag: Option, - /// The visibility of this property. - pub visibility: Option, - /// The key of this property. - pub key: Option, - /// The value of this property. - pub value: Option, -} - -impl RequestValue for Property {} -impl ResponseResult for Property {} - - /// The amount of storage quota used by different Google services. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1382,75 +685,6 @@ impl NestedType for AboutQuotaBytesByService {} impl Part for AboutQuotaBytesByService {} -/// A permission for a file. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 permissions](struct.PermissionPatchCall.html) (request|response) -/// * [list permissions](struct.PermissionListCall.html) (none) -/// * [insert permissions](struct.PermissionInsertCall.html) (request|response) -/// * [get permissions](struct.PermissionGetCall.html) (response) -/// * [get id for email permissions](struct.PermissionGetIdForEmailCall.html) (none) -/// * [delete permissions](struct.PermissionDeleteCall.html) (none) -/// * [update permissions](struct.PermissionUpdateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Permission { - /// Whether the link is required for this permission. - #[serde(rename="withLink")] - pub with_link: Option, - /// The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain. - pub domain: Option, - /// The name for this permission. - pub name: Option, - /// This is always drive#permission. - pub kind: Option, - /// The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored. - pub value: Option, - /// Additional roles for this user. Only commenter is currently allowed. - #[serde(rename="additionalRoles")] - pub additional_roles: Option>, - /// The authkey parameter required for this permission. - #[serde(rename="authKey")] - pub auth_key: Option, - /// The ETag of the permission. - pub etag: Option, - /// The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group. - #[serde(rename="emailAddress")] - pub email_address: Option, - /// The time at which this permission will expire (RFC 3339 date-time). - #[serde(rename="expirationDate")] - pub expiration_date: Option, - /// The primary role for this user. Allowed values are: - /// - owner - /// - reader - /// - writer - pub role: Option, - /// The account type. Allowed values are: - /// - user - /// - group - /// - domain - /// - anyone - #[serde(rename="type")] - pub type_: Option, - /// The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored. - pub id: Option, - /// A link back to this permission. - #[serde(rename="selfLink")] - pub self_link: Option, - /// A link to the profile photo, if available. - #[serde(rename="photoLink")] - pub photo_link: Option, -} - -impl RequestValue for Permission {} -impl Resource for Permission {} -impl ResponseResult for Permission {} - - /// Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1518,6 +752,1175 @@ impl NestedType for FileImageMediaMetadata {} impl Part for FileImageMediaMetadata {} +/// List of max upload sizes for each file type. The most specific type takes precedence. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AboutMaxUploadSizes { + /// The file type. + #[serde(rename="type")] + pub type_: Option, + /// The max upload size for this type. + pub size: Option, +} + +impl NestedType for AboutMaxUploadSizes {} +impl Part for AboutMaxUploadSizes {} + + +/// Information about a Drive 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 User { + /// The user's profile picture. + pub picture: Option, + /// This is always drive#user. + pub kind: Option, + /// Whether this user is the same as the authenticated user for whom the request was made. + #[serde(rename="isAuthenticatedUser")] + pub is_authenticated_user: Option, + /// A plain text displayable name for this user. + #[serde(rename="displayName")] + pub display_name: Option, + /// The email address of the user. + #[serde(rename="emailAddress")] + pub email_address: Option, + /// The user's ID as visible in the permissions collection. + #[serde(rename="permissionId")] + pub permission_id: Option, +} + +impl Part for User {} + + +/// A list of third-party applications which the user has installed or given access to Google Drive. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 apps](struct.AppListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AppList { + /// The list of apps. + pub items: Option>, + /// This is always drive#appList. + pub kind: Option, + /// The ETag of the list. + pub etag: Option, + /// A link back to this list. + #[serde(rename="selfLink")] + pub self_link: Option, + /// List of app IDs that the user has specified to use by default. The list is in reverse-priority order (lowest to highest). + #[serde(rename="defaultAppIds")] + pub default_app_ids: Option>, +} + +impl ResponseResult for AppList {} + + +/// Representation of a change to a file or Team Drive. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 changes](struct.ChangeListCall.html) (none) +/// * [get start page token changes](struct.ChangeGetStartPageTokenCall.html) (none) +/// * [watch changes](struct.ChangeWatchCall.html) (none) +/// * [get changes](struct.ChangeGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Change { + /// The updated state of the Team Drive. Present if the type is teamDrive, the user is still a member of the Team Drive, and the Team Drive has not been deleted. + #[serde(rename="teamDrive")] + pub team_drive: Option, + /// This is always drive#change. + pub kind: Option, + /// Whether the file or Team Drive has been removed from this list of changes, for example by deletion or loss of access. + pub deleted: Option, + /// The updated state of the file. Present if the type is file and the file has not been removed from this list of changes. + pub file: Option, + /// The time of this modification. + #[serde(rename="modificationDate")] + pub modification_date: Option, + /// The ID of the Team Drive associated with this change. + #[serde(rename="teamDriveId")] + pub team_drive_id: Option, + /// The type of the change. Possible values are file and teamDrive. + #[serde(rename="type")] + pub type_: Option, + /// The ID of the change. + pub id: Option, + /// A link back to this change. + #[serde(rename="selfLink")] + pub self_link: Option, + /// The ID of the file associated with this change. + #[serde(rename="fileId")] + pub file_id: Option, +} + +impl Resource for Change {} +impl ResponseResult for Change {} + + +/// A reference to a file's parent. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 parents](struct.ParentGetCall.html) (response) +/// * [insert parents](struct.ParentInsertCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ParentReference { + /// Whether or not the parent is the root folder. + #[serde(rename="isRoot")] + pub is_root: Option, + /// This is always drive#parentReference. + pub kind: Option, + /// The ID of the parent. + pub id: Option, + /// A link back to this reference. + #[serde(rename="selfLink")] + pub self_link: Option, + /// A link to the parent. + #[serde(rename="parentLink")] + pub parent_link: Option, +} + +impl RequestValue for ParentReference {} +impl ResponseResult for ParentReference {} + + +/// A list of comments on a file in Google Drive. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 comments](struct.CommentListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommentList { + /// The page token for the next page of comments. This will be absent if the end of the comments list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of comments. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. + pub items: Option>, + /// This is always drive#commentList. + pub kind: Option, + /// A link back to this list. + #[serde(rename="selfLink")] + pub self_link: Option, + /// A link to the next page of comments. + #[serde(rename="nextLink")] + pub next_link: Option, +} + +impl ResponseResult for CommentList {} + + +/// A list of revisions of a file. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 revisions](struct.RevisionListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RevisionList { + /// The page token for the next page of revisions. This field will be absent if the end of the revisions list has been reached. If the token is rejected for any reason, it should be discarded and pagination should be restarted from the first page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of revisions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. + pub items: Option>, + /// This is always drive#revisionList. + pub kind: Option, + /// The ETag of the list. + pub etag: Option, + /// A link back to this list. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for RevisionList {} + + +/// A revision of a file. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 revisions](struct.RevisionDeleteCall.html) (none) +/// * [update revisions](struct.RevisionUpdateCall.html) (request|response) +/// * [patch revisions](struct.RevisionPatchCall.html) (request|response) +/// * [list revisions](struct.RevisionListCall.html) (none) +/// * [get revisions](struct.RevisionGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Revision { + /// The MIME type of the revision. + #[serde(rename="mimeType")] + pub mime_type: Option, + /// A link to the published revision. + #[serde(rename="publishedLink")] + pub published_link: Option, + /// Whether this revision is published outside the domain. This is only populated and can only be modified for Google Docs. + #[serde(rename="publishedOutsideDomain")] + pub published_outside_domain: Option, + /// Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Google Docs. + #[serde(rename="publishAuto")] + pub publish_auto: Option, + /// The size of the revision in bytes. This will only be populated on files with content stored in Drive. + #[serde(rename="fileSize")] + pub file_size: Option, + /// Name of the last user to modify this revision. + #[serde(rename="lastModifyingUserName")] + pub last_modifying_user_name: Option, + /// The ID of the revision. + pub id: Option, + /// An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive. + #[serde(rename="md5Checksum")] + pub md5_checksum: Option, + /// Short term download URL for the file. This will only be populated on files with content stored in Drive. + #[serde(rename="downloadUrl")] + pub download_url: Option, + /// This is always drive#revision. + pub kind: Option, + /// The last user to modify this revision. + #[serde(rename="lastModifyingUser")] + pub last_modifying_user: Option, + /// Whether this revision is pinned to prevent automatic purging. This will only be populated and can only be modified on files with content stored in Drive which are not Google Docs. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. + pub pinned: Option, + /// The ETag of the revision. + pub etag: Option, + /// The original filename when this revision was created. This will only be populated on files with content stored in Drive. + #[serde(rename="originalFilename")] + pub original_filename: Option, + /// Links for exporting Google Docs to specific formats. + #[serde(rename="exportLinks")] + pub export_links: Option>, + /// Whether this revision is published. This is only populated and can only be modified for Google Docs. + pub published: Option, + /// A link back to this revision. + #[serde(rename="selfLink")] + pub self_link: Option, + /// Last time this revision was modified (formatted RFC 3339 timestamp). + #[serde(rename="modifiedDate")] + pub modified_date: Option, +} + +impl RequestValue for Revision {} +impl Resource for Revision {} +impl ResponseResult for Revision {} + + +/// List of additional features enabled on this 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 AboutFeatures { + /// The name of the feature. + #[serde(rename="featureName")] + pub feature_name: Option, + /// The request limit rate for this feature, in queries per second. + #[serde(rename="featureRate")] + pub feature_rate: Option, +} + +impl NestedType for AboutFeatures {} +impl Part for AboutFeatures {} + + +/// Geographic location information stored in the image. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileImageMediaMetadataLocation { + /// The latitude stored in the image. + pub latitude: Option, + /// The altitude stored in the image. + pub altitude: Option, + /// The longitude stored in the image. + pub longitude: Option, +} + +impl NestedType for FileImageMediaMetadataLocation {} +impl Part for FileImageMediaMetadataLocation {} + + +/// Metadata about video media. This will only be present for video 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 FileVideoMediaMetadata { + /// The width of the video in pixels. + pub width: Option, + /// The duration of the video in milliseconds. + #[serde(rename="durationMillis")] + pub duration_millis: Option, + /// The height of the video in pixels. + pub height: Option, +} + +impl NestedType for FileVideoMediaMetadata {} +impl Part for FileVideoMediaMetadata {} + + +/// The allowable export formats. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AboutExportFormats { + /// The content type to convert from. + pub source: Option, + /// The possible content types to convert to. + pub targets: Option>, +} + +impl NestedType for AboutExportFormats {} +impl Part for AboutExportFormats {} + + +/// The various icons for 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 AppIcons { + /// Category of the icon. Allowed values are: + /// - application - icon for the application + /// - document - icon for a file associated with the app + /// - documentShared - icon for a shared file associated with the app + pub category: Option, + /// URL for the icon. + #[serde(rename="iconUrl")] + pub icon_url: Option, + /// Size of the icon. Represented as the maximum of the width and height. + pub size: Option, +} + +impl NestedType for AppIcons {} +impl Part for AppIcons {} + + +/// 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. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TeamDriveBackgroundImageFile { + /// The width of the cropped image in the closed range of 0 to 1. This value represents the width of the cropped image divided by the width of the entire image. The height is computed by applying a width to height aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and 144 pixels high. + pub width: Option, + /// The Y coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the vertical distance from the top side of the entire image to the top side of the cropping area divided by the height of the entire image. + #[serde(rename="yCoordinate")] + pub y_coordinate: Option, + /// The ID of an image file in Drive to use for the background image. + pub id: Option, + /// The X coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the horizontal distance from the left side of the entire image to the left side of the cropping area divided by the width of the entire image. + #[serde(rename="xCoordinate")] + pub x_coordinate: Option, +} + +impl NestedType for TeamDriveBackgroundImageFile {} +impl Part for TeamDriveBackgroundImageFile {} + + +/// A list of changes for a user. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list changes](struct.ChangeListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChangeList { + /// The page token for the next page of changes. This will be absent if the end of the changes list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// This is always drive#changeList. + pub kind: Option, + /// The list of changes. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. + pub items: Option>, + /// A link to the next page of changes. + #[serde(rename="nextLink")] + pub next_link: Option, + /// The ETag of the list. + pub etag: Option, + /// The starting page token for future changes. This will be present only if the end of the current changes list has been reached. + #[serde(rename="newStartPageToken")] + pub new_start_page_token: Option, + /// The current largest change ID. + #[serde(rename="largestChangeId")] + pub largest_change_id: Option, + /// A link back to this list. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl ResponseResult for ChangeList {} + + +/// An ID for a user or group as seen in Permission items. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [get id for email permissions](struct.PermissionGetIdForEmailCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PermissionId { + /// This is always drive#permissionId. + pub kind: Option, + /// The permission ID. + pub id: Option, +} + +impl ResponseResult for PermissionId {} + + +/// The supported additional roles per primary 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 AboutAdditionalRoleInfoRoleSets { + /// A primary permission role. + #[serde(rename="primaryRole")] + pub primary_role: Option, + /// The supported additional roles with the primary role. + #[serde(rename="additionalRoles")] + pub additional_roles: Option>, +} + +impl NestedType for AboutAdditionalRoleInfoRoleSets {} +impl Part for AboutAdditionalRoleInfoRoleSets {} + + +/// A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileThumbnail { + /// The MIME type of the thumbnail. + #[serde(rename="mimeType")] + pub mime_type: Option, + /// The URL-safe Base64 encoded bytes of the thumbnail image. It should conform to RFC 4648 section 5. + pub image: Option, +} + +impl NestedType for FileThumbnail {} +impl Part for FileThumbnail {} + + +/// A list of generated IDs which can be provided in insert 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*). +/// +/// * [generate ids files](struct.FileGenerateIdCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GeneratedIds { + /// This is always drive#generatedIds + pub kind: Option, + /// The IDs generated for the requesting user in the specified space. + pub ids: Option>, + /// The type of file that can be created with these IDs. + pub space: Option, +} + +impl ResponseResult for GeneratedIds {} + + +/// 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 changes](struct.ChangeWatchCall.html) (request|response) +/// * [watch files](struct.FileWatchCall.html) (request|response) +/// * [stop channels](struct.ChannelStopCall.html) (request) +/// +#[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 {} + + +/// A group of labels for the 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 FileLabels { + /// Whether this file is starred by the user. + pub starred: Option, + /// Whether this file has been viewed by this user. + pub viewed: Option, + /// Whether viewers and commenters are prevented from downloading, printing, and copying this file. + pub restricted: Option, + /// Deprecated. + pub hidden: Option, + /// Whether the file has been modified by this user. + pub modified: Option, + /// Whether this file has been trashed. This label applies to all users accessing the file; however, only owners are allowed to see and untrash files. + pub trashed: Option, +} + +impl NestedType for FileLabels {} +impl Part for FileLabels {} + + +/// Representation of a Team Drive. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 teamdrives](struct.TeamdriveInsertCall.html) (request|response) +/// * [get teamdrives](struct.TeamdriveGetCall.html) (response) +/// * [update teamdrives](struct.TeamdriveUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TeamDrive { + /// This is always drive#teamDrive + pub kind: Option, + /// A short-lived link to this Team Drive's background image. + #[serde(rename="backgroundImageLink")] + pub background_image_link: Option, + /// The name of this Team Drive. + pub name: Option, + /// 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, + /// 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 ID of this Team Drive which is also the ID of the top level folder for this Team Drive. + pub id: Option, +} + +impl RequestValue for TeamDrive {} +impl Resource for TeamDrive {} +impl ResponseResult for TeamDrive {} + + +/// A permission for a file. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 permissions](struct.PermissionPatchCall.html) (request|response) +/// * [list permissions](struct.PermissionListCall.html) (none) +/// * [insert permissions](struct.PermissionInsertCall.html) (request|response) +/// * [get permissions](struct.PermissionGetCall.html) (response) +/// * [get id for email permissions](struct.PermissionGetIdForEmailCall.html) (none) +/// * [delete permissions](struct.PermissionDeleteCall.html) (none) +/// * [update permissions](struct.PermissionUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Permission { + /// The domain name of the entity this permission refers to. This is an output-only field which is present when the permission type is user, group or domain. + pub domain: Option, + /// Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. + pub deleted: Option, + /// The email address of the user or group this permission refers to. This is an output-only field which is present when the permission type is user or group. + #[serde(rename="emailAddress")] + pub email_address: Option, + /// The time at which this permission will expire (RFC 3339 date-time). Expiration dates have the following restrictions: + /// - They can only be set on user and group permissions + /// - The date must be in the future + /// - The date cannot be more than a year in the future + /// - The date can only be set on drive.permissions.update requests + #[serde(rename="expirationDate")] + pub expiration_date: Option, + /// Additional roles for this user. Only commenter is currently allowed, though more may be supported in the future. + #[serde(rename="additionalRoles")] + pub additional_roles: Option>, + /// Whether the link is required for this permission. + #[serde(rename="withLink")] + pub with_link: Option, + /// This is always drive#permission. + pub kind: Option, + /// The name for this permission. + pub name: Option, + /// The email address or domain name for the entity. This is used during inserts and is not populated in responses. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored. + pub value: Option, + /// The ID of the user this permission refers to, and identical to the permissionId in the About and Files resources. When making a drive.permissions.insert request, exactly one of the id or value fields must be specified unless the permission type is anyone, in which case both id and value are ignored. + pub id: Option, + /// The authkey parameter required for this permission. + #[serde(rename="authKey")] + pub auth_key: Option, + /// The ETag of the permission. + pub etag: Option, + /// The primary role for this user. While new values may be supported in the future, the following are currently allowed: + /// - organizer + /// - owner + /// - reader + /// - writer + pub role: Option, + /// A link to the profile photo, if available. + #[serde(rename="photoLink")] + pub photo_link: Option, + /// Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items. + #[serde(rename="teamDrivePermissionDetails")] + pub team_drive_permission_details: Option>, + /// The account type. Allowed values are: + /// - user + /// - group + /// - domain + /// - anyone + #[serde(rename="type")] + pub type_: Option, + /// A link back to this permission. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for Permission {} +impl Resource for Permission {} +impl ResponseResult for Permission {} + + +/// Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileCapabilities { + /// Whether the current user can read the revisions resource of this file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. + #[serde(rename="canReadRevisions")] + pub can_read_revisions: Option, + /// Whether the current user can restore this file from trash. + #[serde(rename="canUntrash")] + pub can_untrash: Option, + /// Whether the current user can copy this file. For a Team Drive item, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. + #[serde(rename="canCopy")] + pub can_copy: Option, + /// Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem. + #[serde(rename="canMoveItemIntoTeamDrive")] + pub can_move_item_into_team_drive: Option, + /// Whether the current user can comment on this file. + #[serde(rename="canComment")] + pub can_comment: Option, + /// Whether the current user can list the children of this folder. This is always false when the item is not a folder. + #[serde(rename="canListChildren")] + pub can_list_children: Option, + /// Whether the current user can rename this file. + #[serde(rename="canRename")] + pub can_rename: Option, + /// Whether the current user can move this file to trash. + #[serde(rename="canTrash")] + pub can_trash: Option, + /// Whether the current user can delete this file. + #[serde(rename="canDelete")] + pub can_delete: Option, + /// Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files. + #[serde(rename="canMoveTeamDriveItem")] + pub can_move_team_drive_item: Option, + /// Whether the current user can add children to this folder. This is always false when the item is not a folder. + #[serde(rename="canAddChildren")] + pub can_add_children: Option, + /// Whether the current user can change the restricted download label of this file. + #[serde(rename="canChangeRestrictedDownload")] + pub can_change_restricted_download: Option, + /// Whether the current user can modify the sharing settings for this file. + #[serde(rename="canShare")] + pub can_share: Option, + /// Whether the current user can download this file. + #[serde(rename="canDownload")] + pub can_download: Option, + /// Whether the current user can remove children from this folder. This is always false when the item is not a folder. + #[serde(rename="canRemoveChildren")] + pub can_remove_children: Option, + /// Whether the current user can read the Team Drive to which this file belongs. Only populated for Team Drive files. + #[serde(rename="canReadTeamDrive")] + pub can_read_team_drive: Option, + /// Whether the current user can edit this file. + #[serde(rename="canEdit")] + pub can_edit: Option, +} + +impl NestedType for FileCapabilities {} +impl Part for FileCapabilities {} + + +/// Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PermissionTeamDrivePermissionDetails { + /// Whether this permission is inherited. This field is always populated. This is an output-only field. + pub inherited: Option, + /// The Team Drive permission type for this user. While new values may be added in future, the following are currently possible: + /// - file + /// - member + #[serde(rename="teamDrivePermissionType")] + pub team_drive_permission_type: Option, + /// The primary role for this user. While new values may be added in the future, the following are currently possible: + /// - organizer + /// - reader + /// - writer + pub role: Option, + /// Additional roles for this user. Only commenter is currently possible, though more may be supported in the future. + #[serde(rename="additionalRoles")] + pub additional_roles: Option>, + /// The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive. + #[serde(rename="inheritedFrom")] + pub inherited_from: Option, +} + +impl NestedType for PermissionTeamDrivePermissionDetails {} +impl Part for PermissionTeamDrivePermissionDetails {} + + +/// A list of files. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list files](struct.FileListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileList { + /// Whether the search process was incomplete. If true, then some search results may be missing, since all documents were not searched. This may occur when searching multiple Team Drives with the "default,allTeamDrives" corpora, but all corpora could not be searched. When this happens, it is suggested that clients narrow their query by choosing a different corpus such as "default" or "teamDrive". + #[serde(rename="incompleteSearch")] + pub incomplete_search: Option, + /// The page token for the next page of files. This will be absent if the end of the files list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// This is always drive#fileList. + pub kind: Option, + /// The ETag of the list. + pub etag: Option, + /// The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. + pub items: Option>, + /// A link back to this list. + #[serde(rename="selfLink")] + pub self_link: Option, + /// A link to the next page of files. + #[serde(rename="nextLink")] + pub next_link: Option, +} + +impl ResponseResult for FileList {} + + +/// A comment on a file in Google Drive. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 replies](struct.ReplyPatchCall.html) (request|response) +/// * [insert replies](struct.ReplyInsertCall.html) (request|response) +/// * [get replies](struct.ReplyGetCall.html) (response) +/// * [update replies](struct.ReplyUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CommentReply { + /// This is always drive#commentReply. + pub kind: Option, + /// The user who wrote this reply. + pub author: Option, + /// Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed. + pub deleted: Option, + /// HTML formatted content for this reply. + #[serde(rename="htmlContent")] + pub html_content: Option, + /// The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen). + pub content: Option, + /// The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are: + /// - "resolve" - To resolve a comment. + /// - "reopen" - To reopen (un-resolve) a comment. + pub verb: Option, + /// The ID of the reply. + #[serde(rename="replyId")] + pub reply_id: Option, + /// The date when this reply was last modified. + #[serde(rename="modifiedDate")] + pub modified_date: Option, + /// The date when this reply was first created. + #[serde(rename="createdDate")] + pub created_date: Option, +} + +impl RequestValue for CommentReply {} +impl ResponseResult for CommentReply {} + + +/// The user's profile picture. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserPicture { + /// A URL that points to a profile picture of this user. + pub url: Option, +} + +impl NestedType for UserPicture {} +impl Part for UserPicture {} + + +/// The context of the file which is being commented 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 CommentContext { + /// The MIME type of the context snippet. + #[serde(rename="type")] + pub type_: Option, + /// Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about. + pub value: Option, +} + +impl NestedType for CommentContext {} +impl Part for CommentContext {} + + +/// A reference to a folder's child. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 children](struct.ChildrenInsertCall.html) (request|response) +/// * [get children](struct.ChildrenGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChildReference { + /// This is always drive#childReference. + pub kind: Option, + /// A link to the child. + #[serde(rename="childLink")] + pub child_link: Option, + /// The ID of the child. + pub id: Option, + /// A link back to this reference. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for ChildReference {} +impl ResponseResult for ChildReference {} + + +/// Indexable text attributes for the file (can only be written) +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileIndexableText { + /// The text to be indexed for this file. + pub text: Option, +} + +impl NestedType for FileIndexableText {} +impl Part for FileIndexableText {} + + +/// An item with user information and settings. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 about](struct.AboutGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct About { + /// The user's language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/). + #[serde(rename="languageCode")] + pub language_code: Option, + /// The amount of storage quota used by different Google services. + #[serde(rename="quotaBytesByService")] + pub quota_bytes_by_service: Option>, + /// List of additional features enabled on this account. + pub features: Option>, + /// The number of quota bytes used by Google Drive. + #[serde(rename="quotaBytesUsed")] + pub quota_bytes_used: Option, + /// This is always drive#about. + pub kind: Option, + /// Information about supported additional roles per file type. The most specific type takes precedence. + #[serde(rename="additionalRoleInfo")] + pub additional_role_info: Option>, + /// The palette of allowable folder colors as RGB hex strings. + #[serde(rename="folderColorPalette")] + pub folder_color_palette: Option>, + /// The authenticated user. + pub user: Option, + /// The type of the user's storage quota. Possible values are: + /// - LIMITED + /// - UNLIMITED + #[serde(rename="quotaType")] + pub quota_type: Option, + /// The number of quota bytes used by all Google apps (Drive, Picasa, etc.). + #[serde(rename="quotaBytesUsedAggregate")] + pub quota_bytes_used_aggregate: Option, + /// List of max upload sizes for each file type. The most specific type takes precedence. + #[serde(rename="maxUploadSizes")] + pub max_upload_sizes: Option>, + /// The current user's ID as visible in the permissions collection. + #[serde(rename="permissionId")] + pub permission_id: Option, + /// The name of the current user. + pub name: Option, + /// A list of themes that are supported for Team Drives. + #[serde(rename="teamDriveThemes")] + pub team_drive_themes: Option>, + /// The total number of quota bytes. + #[serde(rename="quotaBytesTotal")] + pub quota_bytes_total: Option, + /// The number of remaining change ids, limited to no more than 2500. + #[serde(rename="remainingChangeIds")] + pub remaining_change_ids: Option, + /// The ETag of the item. + pub etag: Option, + /// The allowable import formats. + #[serde(rename="importFormats")] + pub import_formats: Option>, + /// The id of the root folder. + #[serde(rename="rootFolderId")] + pub root_folder_id: Option, + /// The largest change id. + #[serde(rename="largestChangeId")] + pub largest_change_id: Option, + /// The number of quota bytes used by trashed items. + #[serde(rename="quotaBytesUsedInTrash")] + pub quota_bytes_used_in_trash: Option, + /// The allowable export formats. + #[serde(rename="exportFormats")] + pub export_formats: Option>, + /// The domain sharing policy for the current user. Possible values are: + /// - allowed + /// - allowedWithWarning + /// - incomingOnly + /// - disallowed + #[serde(rename="domainSharingPolicy")] + pub domain_sharing_policy: Option, + /// A link back to this item. + #[serde(rename="selfLink")] + pub self_link: Option, + /// A boolean indicating whether the authenticated app is installed by the authenticated user. + #[serde(rename="isCurrentAppInstalled")] + pub is_current_app_installed: Option, +} + +impl ResponseResult for About {} + + +/// A list of themes that are supported for Team Drives. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AboutTeamDriveThemes { + /// The color of this Team Drive theme as an RGB hex string. + #[serde(rename="colorRgb")] + pub color_rgb: Option, + /// A link to this Team Drive theme's background image. + #[serde(rename="backgroundImageLink")] + pub background_image_link: Option, + /// The ID of the theme. + pub id: Option, +} + +impl NestedType for AboutTeamDriveThemes {} +impl Part for AboutTeamDriveThemes {} + + +/// 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 start page token changes](struct.ChangeGetStartPageTokenCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct StartPageToken { + /// Identifies what kind of resource this is. Value: the fixed string "drive#startPageToken". + pub kind: Option, + /// The starting page token for listing changes. + #[serde(rename="startPageToken")] + pub start_page_token: Option, +} + +impl ResponseResult for StartPageToken {} + + +/// A key-value pair attached to a file that is either public or private to an application. +/// The following limits apply to file properties: +/// - Maximum of 100 properties total per file +/// - Maximum of 30 private properties per app +/// - Maximum of 30 public properties +/// - Maximum of 124 bytes size limit on (key + value) string in UTF-8 encoding for a single property. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 properties](struct.PropertyInsertCall.html) (request|response) +/// * [get properties](struct.PropertyGetCall.html) (response) +/// * [patch properties](struct.PropertyPatchCall.html) (request|response) +/// * [update properties](struct.PropertyUpdateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Property { + /// The link back to this property. + #[serde(rename="selfLink")] + pub self_link: Option, + /// This is always drive#property. + pub kind: Option, + /// ETag of the property. + pub etag: Option, + /// The visibility of this property. + pub visibility: Option, + /// The key of this property. + pub key: Option, + /// The value of this property. + pub value: Option, +} + +impl RequestValue for Property {} +impl ResponseResult for Property {} + + +/// A comment on a file in Google Drive. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 comments](struct.CommentUpdateCall.html) (request|response) +/// * [insert comments](struct.CommentInsertCall.html) (request|response) +/// * [delete comments](struct.CommentDeleteCall.html) (none) +/// * [patch comments](struct.CommentPatchCall.html) (request|response) +/// * [get comments](struct.CommentGetCall.html) (response) +/// * [list comments](struct.CommentListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Comment { + /// The status of this comment. Status can be changed by posting a reply to a comment with the desired status. + /// - "open" - The comment is still open. + /// - "resolved" - The comment has been resolved by one of its replies. + pub status: Option, + /// A link back to this comment. + #[serde(rename="selfLink")] + pub self_link: Option, + /// This is always drive#comment. + pub kind: Option, + /// The user who wrote this comment. + pub author: Option, + /// Whether this comment has been deleted. If a comment has been deleted the content will be cleared and this will only represent a comment that once existed. + pub deleted: Option, + /// The date when this comment was first created. + #[serde(rename="createdDate")] + pub created_date: Option, + /// HTML formatted content for this comment. + #[serde(rename="htmlContent")] + pub html_content: Option, + /// The plain text content used to create this comment. This is not HTML safe and should only be used as a starting point to make edits to a comment's content. + pub content: Option, + /// The date when this comment or any of its replies were last modified. + #[serde(rename="modifiedDate")] + pub modified_date: Option, + /// The context of the file which is being commented on. + pub context: Option, + /// Replies to this post. + pub replies: Option>, + /// The ID of the comment. + #[serde(rename="commentId")] + pub comment_id: Option, + /// A region of the document represented as a JSON string. See anchor documentation for details on how to define and interpret anchor properties. + pub anchor: Option, + /// The title of the file which this comment is addressing. + #[serde(rename="fileTitle")] + pub file_title: Option, + /// The file which this comment is addressing. + #[serde(rename="fileId")] + pub file_id: Option, +} + +impl RequestValue for Comment {} +impl Resource for Comment {} +impl ResponseResult for Comment {} + + /// The apps resource provides a list of the apps that a user has installed, with information about each app's supported MIME types, file extensions, and other details. /// /// # Activities @@ -1602,55 +2005,6 @@ impl Resource for App {} impl ResponseResult for App {} -/// Geographic location information stored in the image. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FileImageMediaMetadataLocation { - /// The latitude stored in the image. - pub latitude: Option, - /// The altitude stored in the image. - pub altitude: Option, - /// The longitude stored in the image. - pub longitude: Option, -} - -impl NestedType for FileImageMediaMetadataLocation {} -impl Part for FileImageMediaMetadataLocation {} - - -/// A list of files. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [list files](struct.FileListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FileList { - /// The page token for the next page of files. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// This is always drive#fileList. - pub kind: Option, - /// The ETag of the list. - pub etag: Option, - /// The actual list of files. - pub items: Option>, - /// A link back to this list. - #[serde(rename="selfLink")] - pub self_link: Option, - /// A link to the next page of files. - #[serde(rename="nextLink")] - pub next_link: Option, -} - -impl ResponseResult for FileList {} - - /// A list of children of a file. /// /// # Activities @@ -1662,14 +2016,14 @@ impl ResponseResult for FileList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChildList { - /// The page token for the next page of children. + /// The page token for the next page of children. This will be absent if the end of the children list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// This is always drive#childList. pub kind: Option, /// The ETag of the list. pub etag: Option, - /// The actual list of children. + /// The list of children. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. pub items: Option>, /// A link back to this list. #[serde(rename="selfLink")] @@ -1682,316 +2036,264 @@ pub struct ChildList { impl ResponseResult for ChildList {} -/// A comment on a file in Google Drive. +/// The metadata for a file. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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 replies](struct.ReplyPatchCall.html) (request|response) -/// * [insert replies](struct.ReplyInsertCall.html) (request|response) -/// * [get replies](struct.ReplyGetCall.html) (response) -/// * [update replies](struct.ReplyUpdateCall.html) (request|response) +/// * [watch files](struct.FileWatchCall.html) (none) +/// * [empty trash files](struct.FileEmptyTrashCall.html) (none) +/// * [generate ids files](struct.FileGenerateIdCall.html) (none) +/// * [copy files](struct.FileCopyCall.html) (request|response) +/// * [list files](struct.FileListCall.html) (none) +/// * [delete files](struct.FileDeleteCall.html) (none) +/// * [patch files](struct.FilePatchCall.html) (request|response) +/// * [update files](struct.FileUpdateCall.html) (request|response) +/// * [insert files](struct.FileInsertCall.html) (request|response) +/// * [untrash files](struct.FileUntrashCall.html) (response) +/// * [trash files](struct.FileTrashCall.html) (response) +/// * [touch files](struct.FileTouchCall.html) (response) +/// * [get files](struct.FileGetCall.html) (response) +/// * [export files](struct.FileExportCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CommentReply { - /// This is always drive#commentReply. - pub kind: Option, - /// The user who wrote this reply. - pub author: Option, - /// Whether this reply has been deleted. If a reply has been deleted the content will be cleared and this will only represent a reply that once existed. - pub deleted: Option, - /// HTML formatted content for this reply. - #[serde(rename="htmlContent")] - pub html_content: Option, - /// The plain text content used to create this reply. This is not HTML safe and should only be used as a starting point to make edits to a reply's content. This field is required on inserts if no verb is specified (resolve/reopen). - pub content: Option, - /// The action this reply performed to the parent comment. When creating a new reply this is the action to be perform to the parent comment. Possible values are: - /// - "resolve" - To resolve a comment. - /// - "reopen" - To reopen (un-resolve) a comment. - pub verb: Option, - /// The ID of the reply. - #[serde(rename="replyId")] - pub reply_id: Option, - /// The date when this reply was last modified. +pub struct File { + /// Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. + #[serde(rename="hasThumbnail")] + pub has_thumbnail: Option, + /// Whether this file is in the Application Data folder. + #[serde(rename="appDataContents")] + pub app_data_contents: Option, + /// A short-lived link to the file's thumbnail. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. + #[serde(rename="thumbnailLink")] + pub thumbnail_link: Option, + /// A group of labels for the file. + pub labels: Option, + /// The list of spaces which contain the file. Supported values are 'drive', 'appDataFolder' and 'photos'. + pub spaces: Option>, + /// Whether the file was created or opened by the requesting app. + #[serde(rename="isAppAuthorized")] + pub is_app_authorized: Option, + /// Name of the last user to modify this file. + #[serde(rename="lastModifyingUserName")] + pub last_modifying_user_name: Option, + /// Whether writers can share the document with other users. Not populated for Team Drive files. + #[serde(rename="writersCanShare")] + pub writers_can_share: Option, + /// User that shared the item with the current user, if available. + #[serde(rename="sharingUser")] + pub sharing_user: Option, + /// The last user to modify this file. + #[serde(rename="lastModifyingUser")] + pub last_modifying_user: Option, + /// Deprecated: use capabilities/canCopy. + pub copyable: Option, + /// Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. + pub capabilities: Option, + /// A link only available on public folders for viewing their static web assets (HTML, CSS, JS, etc) via Google Drive's Website Hosting. + #[serde(rename="webViewLink")] + pub web_view_link: Option, + /// Last time this file was viewed by the user (formatted RFC 3339 timestamp). + #[serde(rename="lastViewedByMeDate")] + pub last_viewed_by_me_date: Option, + /// Collection of parent folders which contain this file. + /// Setting this field will put the file in all of the provided folders. On insert, if no folders are provided, the file will be placed in the default root folder. + pub parents: Option>, + /// A link to the file's icon. + #[serde(rename="iconLink")] + pub icon_link: Option, + /// The full file extension; extracted from the title. May contain multiple concatenated extensions, such as "tar.gz". Removing an extension from the title does not clear this field; however, changing the extension on the title does update this field. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files. + #[serde(rename="fullFileExtension")] + pub full_file_extension: Option, + /// The time that the item was trashed (formatted RFC 3339 timestamp). Only populated for Team Drive files. + #[serde(rename="trashedDate")] + pub trashed_date: Option, + /// Deprecated: use capabilities/canReadRevisions. + #[serde(rename="canReadRevisions")] + pub can_read_revisions: Option, + /// A link to open this file with the user's default app for this file. Only populated when the drive.apps.readonly scope is used. + #[serde(rename="defaultOpenWithLink")] + pub default_open_with_link: Option, + /// Deprecated: use capabilities/canEdit. + pub editable: Option, + /// A link for embedding the file. + #[serde(rename="embedLink")] + pub embed_link: Option, + /// Deprecated: use capabilities/canComment. + #[serde(rename="canComment")] + pub can_comment: Option, + /// Last time this file was modified by anyone (formatted RFC 3339 timestamp). This is only mutable on update when the setModifiedDate parameter is set. #[serde(rename="modifiedDate")] pub modified_date: Option, - /// The date when this reply was first created. + /// Create time for this file (formatted RFC 3339 timestamp). #[serde(rename="createdDate")] pub created_date: Option, -} - -impl RequestValue for CommentReply {} -impl ResponseResult for CommentReply {} - - -/// The user's profile picture. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UserPicture { - /// A URL that points to a profile picture of this user. - pub url: Option, -} - -impl NestedType for UserPicture {} -impl Part for UserPicture {} - - -/// List of additional features enabled on this 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 AboutFeatures { - /// The name of the feature. - #[serde(rename="featureName")] - pub feature_name: Option, - /// The request limit rate for this feature, in queries per second. - #[serde(rename="featureRate")] - pub feature_rate: Option, -} - -impl NestedType for AboutFeatures {} -impl Part for AboutFeatures {} - - -/// Information about a Drive 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 User { - /// The user's profile picture. - pub picture: Option, - /// This is always drive#user. + /// ID of the Team Drive the file resides in. + #[serde(rename="teamDriveId")] + pub team_drive_id: Option, + /// An MD5 checksum for the content of this file. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files. + #[serde(rename="md5Checksum")] + pub md5_checksum: Option, + /// The list of permissions for users with access to this file. Not populated for Team Drive files. + pub permissions: Option>, + /// Metadata about image media. This will only be present for image types, and its contents will depend on what can be parsed from the image content. + #[serde(rename="imageMediaMetadata")] + pub image_media_metadata: Option, + /// The type of file. This is always drive#file. pub kind: Option, - /// Whether this user is the same as the authenticated user for whom the request was made. - #[serde(rename="isAuthenticatedUser")] - pub is_authenticated_user: Option, - /// A plain text displayable name for this user. - #[serde(rename="displayName")] - pub display_name: Option, - /// The email address of the user. - #[serde(rename="emailAddress")] - pub email_address: Option, - /// The user's ID as visible in the permissions collection. - #[serde(rename="permissionId")] - pub permission_id: Option, + /// A link for opening the file in a relevant Google editor or viewer. + #[serde(rename="alternateLink")] + pub alternate_link: Option, + /// no description provided + #[serde(rename="downloadUrl")] + pub download_url: Option, + /// The permissions for the authenticated user on this file. + #[serde(rename="userPermission")] + pub user_permission: Option, + /// Deprecated: use capabilities/canShare. + pub shareable: Option, + /// The original filename of the uploaded content if available, or else the original value of the title field. This is only available for files with binary content in Drive. + #[serde(rename="originalFilename")] + pub original_filename: Option, + /// The final component of fullFileExtension with trailing text that does not appear to be part of the extension removed. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files. + #[serde(rename="fileExtension")] + pub file_extension: Option, + /// Whether any users are granted file access directly on this file. This field is only populated for Team Drive files. + #[serde(rename="hasAugmentedPermissions")] + pub has_augmented_permissions: Option, + /// The ID of the file's head revision. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files. + #[serde(rename="headRevisionId")] + pub head_revision_id: Option, + /// The MIME type of the file. This is only mutable on update when uploading new content. This field can be left blank, and the mimetype will be determined from the uploaded content's MIME type. + #[serde(rename="mimeType")] + pub mime_type: Option, + /// Indexable text attributes for the file (can only be written) + #[serde(rename="indexableText")] + pub indexable_text: Option, + /// The thumbnail version for use in thumbnail cache invalidation. + #[serde(rename="thumbnailVersion")] + pub thumbnail_version: Option, + /// Whether this file has been explicitly trashed, as opposed to recursively trashed. + #[serde(rename="explicitlyTrashed")] + pub explicitly_trashed: Option, + /// ETag of the file. + pub etag: Option, + /// Whether the file is owned by the current user. Not populated for Team Drive files. + #[serde(rename="ownedByMe")] + pub owned_by_me: Option, + /// The ID of the file. + pub id: Option, + /// Metadata about video media. This will only be present for video types. + #[serde(rename="videoMediaMetadata")] + pub video_media_metadata: Option, + /// Folder color as an RGB hex string if the file is a folder. The list of supported colors is available in the folderColorPalette field of the About resource. If an unsupported color is specified, it will be changed to the closest color in the palette. Not populated for Team Drive files. + #[serde(rename="folderColorRgb")] + pub folder_color_rgb: Option, + /// Name(s) of the owner(s) of this file. Not populated for Team Drive files. + #[serde(rename="ownerNames")] + pub owner_names: Option>, + /// Time at which this file was shared with the user (formatted RFC 3339 timestamp). + #[serde(rename="sharedWithMeDate")] + pub shared_with_me_date: Option, + /// A monotonically increasing version number for the file. This reflects every change made to the file on the server, even those not visible to the requesting user. + pub version: Option, + /// Links for exporting Google Docs to specific formats. + #[serde(rename="exportLinks")] + pub export_links: Option>, + /// Whether the file has been shared. Not populated for Team Drive files. + pub shared: Option, + /// A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail. + pub thumbnail: Option, + /// A map of the id of each of the user's apps to a link to open this file with that app. Only populated when the drive.apps.readonly scope is used. + #[serde(rename="openWithLinks")] + pub open_with_links: Option>, + /// A short description of the file. + pub description: Option, + /// A link for downloading the content of the file in a browser using cookie based authentication. In cases where the content is shared publicly, the content can be downloaded without any credentials. + #[serde(rename="webContentLink")] + pub web_content_link: Option, + /// Deprecated. + #[serde(rename="markedViewedByMeDate")] + pub marked_viewed_by_me_date: Option, + /// The size of the file in bytes. This field is only populated for files with content stored in Drive; it is not populated for Google Docs or shortcut files. + #[serde(rename="fileSize")] + pub file_size: Option, + /// The list of properties. + pub properties: Option>, + /// The owner(s) of this file. Not populated for Team Drive files. + pub owners: Option>, + /// The title of this file. Note that for immutable items such as the top level folders of Team Drives, My Drive root folder, and Application Data folder the title is constant. + pub title: Option, + /// Last time this file was modified by the user (formatted RFC 3339 timestamp). Note that setting modifiedDate will also update the modifiedByMe date for the user which set the date. + #[serde(rename="modifiedByMeDate")] + pub modified_by_me_date: Option, + /// If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files. + #[serde(rename="trashingUser")] + pub trashing_user: Option, + /// The number of quota bytes used by this file. + #[serde(rename="quotaBytesUsed")] + pub quota_bytes_used: Option, + /// A link back to this file. + #[serde(rename="selfLink")] + pub self_link: Option, } -impl Part for User {} +impl RequestValue for File {} +impl Resource for File {} +impl ResponseResult for File {} -/// A list of third-party applications which the user has installed or given access to Google Drive. +/// A list of permissions associated with a file. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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 apps](struct.AppListCall.html) (response) +/// * [list permissions](struct.PermissionListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AppList { - /// The actual list of apps. - pub items: Option>, - /// This is always drive#appList. +pub struct PermissionList { + /// The page token for the next page of permissions. This field will be absent if the end of the permissions list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of permissions. + pub items: Option>, + /// This is always drive#permissionList. pub kind: Option, /// The ETag of the list. pub etag: Option, /// A link back to this list. #[serde(rename="selfLink")] pub self_link: Option, - /// List of app IDs that the user has specified to use by default. The list is in reverse-priority order (lowest to highest). - #[serde(rename="defaultAppIds")] - pub default_app_ids: Option>, } -impl ResponseResult for AppList {} +impl ResponseResult for PermissionList {} -/// The various icons for 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 AppIcons { - /// Category of the icon. Allowed values are: - /// - application - icon for the application - /// - document - icon for a file associated with the app - /// - documentShared - icon for a shared file associated with the app - pub category: Option, - /// URL for the icon. - #[serde(rename="iconUrl")] - pub icon_url: Option, - /// Size of the icon. Represented as the maximum of the width and height. - pub size: Option, -} - -impl NestedType for AppIcons {} -impl Part for AppIcons {} - - -/// The context of the file which is being commented 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 CommentContext { - /// The MIME type of the context snippet. - #[serde(rename="type")] - pub type_: Option, - /// Data representation of the segment of the file being commented on. In the case of a text file for example, this would be the actual text that the comment is about. - pub value: Option, -} - -impl NestedType for CommentContext {} -impl Part for CommentContext {} - - -/// A revision of a file. +/// A list of Team Drives. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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 revisions](struct.RevisionDeleteCall.html) (none) -/// * [update revisions](struct.RevisionUpdateCall.html) (request|response) -/// * [patch revisions](struct.RevisionPatchCall.html) (request|response) -/// * [list revisions](struct.RevisionListCall.html) (none) -/// * [get revisions](struct.RevisionGetCall.html) (response) +/// * [list teamdrives](struct.TeamdriveListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Revision { - /// The MIME type of the revision. - #[serde(rename="mimeType")] - pub mime_type: Option, - /// A link to the published revision. - #[serde(rename="publishedLink")] - pub published_link: Option, - /// Whether this revision is published outside the domain. This is only populated and can only be modified for Google Docs. - #[serde(rename="publishedOutsideDomain")] - pub published_outside_domain: Option, - /// Whether subsequent revisions will be automatically republished. This is only populated and can only be modified for Google Docs. - #[serde(rename="publishAuto")] - pub publish_auto: Option, - /// The size of the revision in bytes. This will only be populated on files with content stored in Drive. - #[serde(rename="fileSize")] - pub file_size: Option, - /// Name of the last user to modify this revision. - #[serde(rename="lastModifyingUserName")] - pub last_modifying_user_name: Option, - /// The ID of the revision. - pub id: Option, - /// An MD5 checksum for the content of this revision. This will only be populated on files with content stored in Drive. - #[serde(rename="md5Checksum")] - pub md5_checksum: Option, - /// Short term download URL for the file. This will only be populated on files with content stored in Drive. - #[serde(rename="downloadUrl")] - pub download_url: Option, - /// This is always drive#revision. +pub struct TeamDriveList { + /// The page token for the next page of Team Drives. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of Team Drives. + pub items: Option>, + /// This is always drive#teamDriveList pub kind: Option, - /// The last user to modify this revision. - #[serde(rename="lastModifyingUser")] - pub last_modifying_user: Option, - /// Whether this revision is pinned to prevent automatic purging. This will only be populated and can only be modified on files with content stored in Drive which are not Google Docs. Revisions can also be pinned when they are created through the drive.files.insert/update/copy by using the pinned query parameter. - pub pinned: Option, - /// The ETag of the revision. - pub etag: Option, - /// The original filename when this revision was created. This will only be populated on files with content stored in Drive. - #[serde(rename="originalFilename")] - pub original_filename: Option, - /// Links for exporting Google Docs to specific formats. - #[serde(rename="exportLinks")] - pub export_links: Option>, - /// Whether this revision is published. This is only populated and can only be modified for Google Docs. - pub published: Option, - /// A link back to this revision. - #[serde(rename="selfLink")] - pub self_link: Option, - /// Last time this revision was modified (formatted RFC 3339 timestamp). - #[serde(rename="modifiedDate")] - pub modified_date: Option, } -impl RequestValue for Revision {} -impl Resource for Revision {} -impl ResponseResult for Revision {} - - -/// Metadata about video media. This will only be present for video 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 FileVideoMediaMetadata { - /// The width of the video in pixels. - pub width: Option, - /// The duration of the video in milliseconds. - #[serde(rename="durationMillis")] - pub duration_millis: Option, - /// The height of the video in pixels. - pub height: Option, -} - -impl NestedType for FileVideoMediaMetadata {} -impl Part for FileVideoMediaMetadata {} - - -/// The allowable export formats. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct AboutExportFormats { - /// The content type to convert from. - pub source: Option, - /// The possible content types to convert to. - pub targets: Option>, -} - -impl NestedType for AboutExportFormats {} -impl Part for AboutExportFormats {} - - -/// Representation of a change to a file. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 changes](struct.ChangeListCall.html) (none) -/// * [watch changes](struct.ChangeWatchCall.html) (none) -/// * [get changes](struct.ChangeGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Change { - /// The time of this modification. - #[serde(rename="modificationDate")] - pub modification_date: Option, - /// This is always drive#change. - pub kind: Option, - /// The updated state of the file. Present if the file has not been deleted. - pub file: Option, - /// Whether the file has been deleted. - pub deleted: Option, - /// The ID of the change. - pub id: Option, - /// A link back to this change. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The ID of the file associated with this change. - #[serde(rename="fileId")] - pub file_id: Option, -} - -impl Resource for Change {} -impl ResponseResult for Change {} +impl ResponseResult for TeamDriveList {} @@ -2051,6 +2353,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _request: request, _file_id: file_id.to_string(), _update_viewed_date: Default::default(), + _supports_team_drives: Default::default(), _revision_id: Default::default(), _projection: Default::default(), _acknowledge_abuse: Default::default(), @@ -2075,6 +2378,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _use_content_as_indexable_text: Default::default(), _timed_text_track_name: Default::default(), _timed_text_language: Default::default(), + _supports_team_drives: Default::default(), _pinned: Default::default(), _ocr_language: Default::default(), _ocr: Default::default(), @@ -2096,6 +2400,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { FileUntrashCall { hub: self.hub, _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2118,6 +2423,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _visibility: Default::default(), _timed_text_track_name: Default::default(), _timed_text_language: Default::default(), + _supports_team_drives: Default::default(), _pinned: Default::default(), _ocr_language: Default::default(), _ocr: Default::default(), @@ -2130,7 +2436,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Moves a file to the trash. The currently authenticated user must own the file. + /// Moves a file to the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files. /// /// # Arguments /// @@ -2139,6 +2445,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { FileTrashCall { hub: self.hub, _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2182,13 +2489,17 @@ impl<'a, C, A> FileMethods<'a, C, A> { pub fn list(&self) -> FileListCall<'a, C, A> { FileListCall { hub: self.hub, + _team_drive_id: Default::default(), + _supports_team_drives: Default::default(), _spaces: Default::default(), _q: Default::default(), _projection: Default::default(), _page_token: Default::default(), _order_by: Default::default(), _max_results: Default::default(), + _include_team_drive_items: Default::default(), _corpus: Default::default(), + _corpora: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2206,6 +2517,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { FileTouchCall { hub: self.hub, _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2243,6 +2555,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _update_viewed_date: Default::default(), _timed_text_track_name: Default::default(), _timed_text_language: Default::default(), + _supports_team_drives: Default::default(), _set_modified_date: Default::default(), _remove_parents: Default::default(), _pinned: Default::default(), @@ -2260,7 +2573,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file. + /// Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files. /// /// # Arguments /// @@ -2269,6 +2582,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { FileDeleteCall { hub: self.hub, _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2292,6 +2606,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _update_viewed_date: Default::default(), _timed_text_track_name: Default::default(), _timed_text_language: Default::default(), + _supports_team_drives: Default::default(), _set_modified_date: Default::default(), _remove_parents: Default::default(), _pinned: Default::default(), @@ -2319,6 +2634,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { hub: self.hub, _file_id: file_id.to_string(), _update_viewed_date: Default::default(), + _supports_team_drives: Default::default(), _revision_id: Default::default(), _projection: Default::default(), _acknowledge_abuse: Default::default(), @@ -2331,7 +2647,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { -/// A builder providing access to all methods supported on *about* resources. +/// A builder providing access to all methods supported on *teamdrive* resources. /// It is not used directly, but through the `Drive` hub. /// /// # Example @@ -2354,30 +2670,101 @@ impl<'a, C, A> FileMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Drive::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get(...)` +/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)` and `update(...)` /// // to build up your call. -/// let rb = hub.about(); +/// let rb = hub.teamdrives(); /// # } /// ``` -pub struct AboutMethods<'a, C, A> +pub struct TeamdriveMethods<'a, C, A> where C: 'a, A: 'a { hub: &'a Drive, } -impl<'a, C, A> MethodsBuilder for AboutMethods<'a, C, A> {} +impl<'a, C, A> MethodsBuilder for TeamdriveMethods<'a, C, A> {} -impl<'a, C, A> AboutMethods<'a, C, A> { +impl<'a, C, A> TeamdriveMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the information about the current user along with Drive API settings - pub fn get(&self) -> AboutGetCall<'a, C, A> { - AboutGetCall { + /// Creates a new Team Drive. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `requestId` - An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned. + pub fn insert(&self, request: TeamDrive, request_id: &str) -> TeamdriveInsertCall<'a, C, A> { + TeamdriveInsertCall { hub: self.hub, - _start_change_id: Default::default(), - _max_change_id_count: Default::default(), - _include_subscribed: Default::default(), + _request: request, + _request_id: request_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 Team Drive's metadata by ID. + /// + /// # Arguments + /// + /// * `teamDriveId` - The ID of the Team Drive + pub fn get(&self, team_drive_id: &str) -> TeamdriveGetCall<'a, C, A> { + TeamdriveGetCall { + hub: self.hub, + _team_drive_id: team_drive_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the user's Team Drives. + pub fn list(&self) -> TeamdriveListCall<'a, C, A> { + TeamdriveListCall { + hub: self.hub, + _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: + /// + /// Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. + /// + /// # Arguments + /// + /// * `teamDriveId` - The ID of the Team Drive + pub fn delete(&self, team_drive_id: &str) -> TeamdriveDeleteCall<'a, C, A> { + TeamdriveDeleteCall { + hub: self.hub, + _team_drive_id: team_drive_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 Team Drive's metadata + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `teamDriveId` - The ID of the Team Drive + pub fn update(&self, request: TeamDrive, team_drive_id: &str) -> TeamdriveUpdateCall<'a, C, A> { + TeamdriveUpdateCall { + hub: self.hub, + _request: request, + _team_drive_id: team_drive_id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2537,6 +2924,62 @@ impl<'a, C, A> AppMethods<'a, C, A> { +/// A builder providing access to all methods supported on *about* resources. +/// It is not used directly, but through the `Drive` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_drive2 as drive2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use drive2::Drive; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Drive::new(hyper::Client::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.about(); +/// # } +/// ``` +pub struct AboutMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, +} + +impl<'a, C, A> MethodsBuilder for AboutMethods<'a, C, A> {} + +impl<'a, C, A> AboutMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets the information about the current user along with Drive API settings + pub fn get(&self) -> AboutGetCall<'a, C, A> { + AboutGetCall { + hub: self.hub, + _start_change_id: Default::default(), + _max_change_id_count: Default::default(), + _include_subscribed: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *comment* resources. /// It is not used directly, but through the `Drive` hub. /// @@ -2809,6 +3252,7 @@ impl<'a, C, A> ChildrenMethods<'a, C, A> { hub: self.hub, _request: request, _folder_id: folder_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2963,6 +3407,7 @@ impl<'a, C, A> ParentMethods<'a, C, A> { hub: self.hub, _request: request, _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3204,17 +3649,18 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a permission from a file. + /// Deletes a permission from a file or Team Drive. /// /// # Arguments /// - /// * `fileId` - The ID for the file. + /// * `fileId` - The ID for the file or Team Drive. /// * `permissionId` - The ID for the permission. pub fn delete(&self, file_id: &str, permission_id: &str) -> PermissionDeleteCall<'a, C, A> { PermissionDeleteCall { hub: self.hub, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3223,17 +3669,18 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Inserts a permission for a file. + /// Inserts a permission for a file or Team Drive. /// /// # Arguments /// /// * `request` - No description provided. - /// * `fileId` - The ID for the file. + /// * `fileId` - The ID for the file or Team Drive. pub fn insert(&self, request: Permission, file_id: &str) -> PermissionInsertCall<'a, C, A> { PermissionInsertCall { hub: self.hub, _request: request, _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), _send_notification_emails: Default::default(), _email_message: Default::default(), _delegate: Default::default(), @@ -3249,7 +3696,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `fileId` - The ID for the file. + /// * `fileId` - The ID for the file or Team Drive. /// * `permissionId` - The ID for the permission. pub fn patch(&self, request: Permission, file_id: &str, permission_id: &str) -> PermissionPatchCall<'a, C, A> { PermissionPatchCall { @@ -3258,6 +3705,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), _transfer_ownership: Default::default(), + _supports_team_drives: Default::default(), _remove_expiration: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -3267,15 +3715,18 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists a file's permissions. + /// Lists a file's or Team Drive's permissions. /// /// # Arguments /// - /// * `fileId` - The ID for the file. + /// * `fileId` - The ID for the file or Team Drive. pub fn list(&self, file_id: &str) -> PermissionListCall<'a, C, A> { PermissionListCall { hub: self.hub, _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), + _page_token: Default::default(), + _max_results: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3289,7 +3740,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `fileId` - The ID for the file. + /// * `fileId` - The ID for the file or Team Drive. /// * `permissionId` - The ID for the permission. pub fn update(&self, request: Permission, file_id: &str, permission_id: &str) -> PermissionUpdateCall<'a, C, A> { PermissionUpdateCall { @@ -3298,6 +3749,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), _transfer_ownership: Default::default(), + _supports_team_drives: Default::default(), _remove_expiration: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -3311,13 +3763,14 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// /// # Arguments /// - /// * `fileId` - The ID for the file. + /// * `fileId` - The ID for the file or Team Drive. /// * `permissionId` - The ID for the permission. pub fn get(&self, file_id: &str, permission_id: &str) -> PermissionGetCall<'a, C, A> { PermissionGetCall { hub: self.hub, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3367,7 +3820,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Drive::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get(...)`, `list(...)` and `watch(...)` +/// // like `get(...)`, `get_start_page_token(...)`, `list(...)` and `watch(...)` /// // to build up your call. /// let rb = hub.changes(); /// # } @@ -3382,6 +3835,20 @@ impl<'a, C, A> MethodsBuilder for ChangeMethods<'a, C, A> {} impl<'a, C, A> ChangeMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Gets the starting pageToken for listing future changes. + pub fn get_start_page_token(&self) -> ChangeGetStartPageTokenCall<'a, C, A> { + ChangeGetStartPageTokenCall { + hub: self.hub, + _team_drive_id: Default::default(), + _supports_team_drives: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Subscribe to changes for a user. @@ -3393,12 +3860,16 @@ impl<'a, C, A> ChangeMethods<'a, C, A> { ChangeWatchCall { hub: self.hub, _request: request, + _team_drive_id: Default::default(), + _supports_team_drives: Default::default(), _start_change_id: Default::default(), _spaces: Default::default(), _page_token: Default::default(), _max_results: Default::default(), + _include_team_drive_items: Default::default(), _include_subscribed: Default::default(), _include_deleted: Default::default(), + _include_corpus_removals: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3407,16 +3878,20 @@ impl<'a, C, A> ChangeMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the changes for a user. + /// Lists the changes for a user or Team Drive. pub fn list(&self) -> ChangeListCall<'a, C, A> { ChangeListCall { hub: self.hub, + _team_drive_id: Default::default(), + _supports_team_drives: Default::default(), _start_change_id: Default::default(), _spaces: Default::default(), _page_token: Default::default(), _max_results: Default::default(), + _include_team_drive_items: Default::default(), _include_subscribed: Default::default(), _include_deleted: Default::default(), + _include_corpus_removals: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3434,6 +3909,8 @@ impl<'a, C, A> ChangeMethods<'a, C, A> { ChangeGetCall { hub: self.hub, _change_id: change_id.to_string(), + _team_drive_id: Default::default(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -3788,9 +4265,10 @@ impl<'a, C, A> RevisionMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().watch(req, "fileId") -/// .update_viewed_date(true) -/// .revision_id("invidunt") -/// .projection("aliquyam") +/// .update_viewed_date(false) +/// .supports_team_drives(false) +/// .revision_id("sea") +/// .projection("et") /// .acknowledge_abuse(false) /// .doit(); /// # } @@ -3802,6 +4280,7 @@ pub struct FileWatchCall<'a, C, A> _request: Channel, _file_id: String, _update_viewed_date: Option, + _supports_team_drives: Option, _revision_id: Option, _projection: Option, _acknowledge_abuse: Option, @@ -3826,11 +4305,14 @@ impl<'a, C, A> FileWatchCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "drive.files.watch", 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._update_viewed_date { params.push(("updateViewedDate", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._revision_id { params.push(("revisionId", value.to_string())); } @@ -3840,7 +4322,7 @@ impl<'a, C, A> FileWatchCall<'a, C, A> where C: BorrowMut, A: oau if let Some(value) = self._acknowledge_abuse { params.push(("acknowledgeAbuse", value.to_string())); } - for &field in ["fileId", "updateViewedDate", "revisionId", "projection", "acknowledgeAbuse"].iter() { + for &field in ["fileId", "updateViewedDate", "supportsTeamDrives", "revisionId", "projection", "acknowledgeAbuse"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3868,7 +4350,7 @@ impl<'a, C, A> FileWatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "files/{fileId}/watch"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4012,6 +4494,13 @@ impl<'a, C, A> FileWatchCall<'a, C, A> where C: BorrowMut, A: oau self._update_viewed_date = Some(new_value); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileWatchCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. /// /// Sets the *revision id* query property to the given value. @@ -4119,13 +4608,14 @@ impl<'a, C, A> FileWatchCall<'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.files().insert(req) -/// .visibility("Lorem") +/// .visibility("et") /// .use_content_as_indexable_text(true) -/// .timed_text_track_name("et") -/// .timed_text_language("duo") +/// .timed_text_track_name("sanctus") +/// .timed_text_language("et") +/// .supports_team_drives(true) /// .pinned(true) -/// .ocr_language("eirmod") -/// .ocr(false) +/// .ocr_language("consetetur") +/// .ocr(true) /// .convert(true) /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } @@ -4139,6 +4629,7 @@ pub struct FileInsertCall<'a, C, A> _use_content_as_indexable_text: Option, _timed_text_track_name: Option, _timed_text_language: Option, + _supports_team_drives: Option, _pinned: Option, _ocr_language: Option, _ocr: Option, @@ -4165,7 +4656,7 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.insert", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); if let Some(value) = self._visibility { params.push(("visibility", value.to_string())); } @@ -4178,6 +4669,9 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._timed_text_language { params.push(("timedTextLanguage", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._pinned { params.push(("pinned", value.to_string())); } @@ -4190,7 +4684,7 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._convert { params.push(("convert", value.to_string())); } - for &field in ["alt", "visibility", "useContentAsIndexableText", "timedTextTrackName", "timedTextLanguage", "pinned", "ocrLanguage", "ocr", "convert"].iter() { + for &field in ["alt", "visibility", "useContentAsIndexableText", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "pinned", "ocrLanguage", "ocr", "convert"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4204,9 +4698,9 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/drive/v2/files", "multipart") + ("https://www.googleapis.com/upload/drive/v2/files".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/drive/v2/files", "resumable") + ("https://www.googleapis.com/resumable/upload/drive/v2/files".to_string(), "resumable") } else { unreachable!() }; @@ -4448,6 +4942,13 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa self._timed_text_language = Some(new_value.to_string()); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileInsertCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions. /// /// Sets the *pinned* query property to the given value. @@ -4555,6 +5056,7 @@ impl<'a, C, A> FileInsertCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().untrash("fileId") +/// .supports_team_drives(true) /// .doit(); /// # } /// ``` @@ -4563,6 +5065,7 @@ pub struct FileUntrashCall<'a, C, A> hub: &'a Drive, _file_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4584,9 +5087,12 @@ impl<'a, C, A> FileUntrashCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "drive.files.untrash", http_method: hyper::method::Method::Post }); - 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(("fileId", self._file_id.to_string())); - for &field in ["alt", "fileId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["alt", "fileId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4598,7 +5104,7 @@ impl<'a, C, A> FileUntrashCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/untrash"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/untrash".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4711,6 +5217,13 @@ impl<'a, C, A> FileUntrashCall<'a, C, A> where C: BorrowMut, A: o self._file_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileUntrashCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -4796,11 +5309,12 @@ impl<'a, C, A> FileUntrashCall<'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.files().copy(req, "fileId") -/// .visibility("consetetur") -/// .timed_text_track_name("ut") -/// .timed_text_language("ea") -/// .pinned(false) -/// .ocr_language("dolor") +/// .visibility("dolor") +/// .timed_text_track_name("et") +/// .timed_text_language("consetetur") +/// .supports_team_drives(false) +/// .pinned(true) +/// .ocr_language("Lorem") /// .ocr(true) /// .convert(true) /// .doit(); @@ -4815,6 +5329,7 @@ pub struct FileCopyCall<'a, C, A> _visibility: Option, _timed_text_track_name: Option, _timed_text_language: Option, + _supports_team_drives: Option, _pinned: Option, _ocr_language: Option, _ocr: Option, @@ -4840,7 +5355,7 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut }; dlg.begin(MethodInfo { id: "drive.files.copy", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._visibility { params.push(("visibility", value.to_string())); @@ -4851,6 +5366,9 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut if let Some(value) = self._timed_text_language { params.push(("timedTextLanguage", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._pinned { params.push(("pinned", value.to_string())); } @@ -4863,7 +5381,7 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut if let Some(value) = self._convert { params.push(("convert", value.to_string())); } - for &field in ["alt", "fileId", "visibility", "timedTextTrackName", "timedTextLanguage", "pinned", "ocrLanguage", "ocr", "convert"].iter() { + for &field in ["alt", "fileId", "visibility", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "pinned", "ocrLanguage", "ocr", "convert"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4875,7 +5393,7 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/copy"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/copy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5033,6 +5551,13 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut self._timed_text_language = Some(new_value.to_string()); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileCopyCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions. /// /// Sets the *pinned* query property to the given value. @@ -5113,7 +5638,7 @@ impl<'a, C, A> FileCopyCall<'a, C, A> where C: BorrowMut, A: oaut } -/// Moves a file to the trash. The currently authenticated user must own the file. +/// Moves a file to the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files. /// /// A builder for the *trash* method supported by a *file* resource. /// It is not used directly, but through a `FileMethods` instance. @@ -5140,6 +5665,7 @@ impl<'a, C, A> FileCopyCall<'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.files().trash("fileId") +/// .supports_team_drives(true) /// .doit(); /// # } /// ``` @@ -5148,6 +5674,7 @@ pub struct FileTrashCall<'a, C, A> hub: &'a Drive, _file_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -5169,9 +5696,12 @@ impl<'a, C, A> FileTrashCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "drive.files.trash", http_method: hyper::method::Method::Post }); - 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(("fileId", self._file_id.to_string())); - for &field in ["alt", "fileId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["alt", "fileId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5183,7 +5713,7 @@ impl<'a, C, A> FileTrashCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/trash"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/trash".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5296,6 +5826,13 @@ impl<'a, C, A> FileTrashCall<'a, C, A> where C: BorrowMut, A: oau self._file_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileTrashCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -5422,7 +5959,7 @@ impl<'a, C, A> FileExportCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "files/{fileId}/export"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/export".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5654,7 +6191,7 @@ impl<'a, C, A> FileEmptyTrashCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "files/trash"; + let mut url = "https://www.googleapis.com/drive/v2/files/trash".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5805,13 +6342,17 @@ impl<'a, C, A> FileEmptyTrashCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().list() -/// .spaces("voluptua.") -/// .q("Lorem") -/// .projection("gubergren") -/// .page_token("justo") -/// .order_by("sit") -/// .max_results(-26) -/// .corpus("diam") +/// .team_drive_id("consetetur") +/// .supports_team_drives(true) +/// .spaces("vero") +/// .q("sadipscing") +/// .projection("invidunt") +/// .page_token("consetetur") +/// .order_by("dolore") +/// .max_results(-19) +/// .include_team_drive_items(false) +/// .corpus("Lorem") +/// .corpora("et") /// .doit(); /// # } /// ``` @@ -5819,13 +6360,17 @@ pub struct FileListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Drive, + _team_drive_id: Option, + _supports_team_drives: Option, _spaces: Option, _q: Option, _projection: Option, _page_token: Option, _order_by: Option, _max_results: Option, + _include_team_drive_items: Option, _corpus: Option, + _corpora: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -5847,7 +6392,13 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut }; dlg.begin(MethodInfo { id: "drive.files.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((13 + self._additional_params.len())); + if let Some(value) = self._team_drive_id { + params.push(("teamDriveId", value.to_string())); + } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._spaces { params.push(("spaces", value.to_string())); } @@ -5866,10 +6417,16 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } + if let Some(value) = self._include_team_drive_items { + params.push(("includeTeamDriveItems", value.to_string())); + } if let Some(value) = self._corpus { params.push(("corpus", value.to_string())); } - for &field in ["alt", "spaces", "q", "projection", "pageToken", "orderBy", "maxResults", "corpus"].iter() { + if let Some(value) = self._corpora { + params.push(("corpora", value.to_string())); + } + for &field in ["alt", "teamDriveId", "supportsTeamDrives", "spaces", "q", "projection", "pageToken", "orderBy", "maxResults", "includeTeamDriveItems", "corpus", "corpora"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5881,7 +6438,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files"; + let mut url = "https://www.googleapis.com/drive/v2/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppReadonly.as_ref().to_string(), ()); } @@ -5963,6 +6520,20 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut } + /// ID of Team Drive to search. + /// + /// Sets the *team drive id* query property to the given value. + pub fn team_drive_id(mut self, new_value: &str) -> FileListCall<'a, C, A> { + self._team_drive_id = Some(new_value.to_string()); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileListCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'. /// /// Sets the *spaces* query property to the given value. @@ -5998,20 +6569,34 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut self._order_by = Some(new_value.to_string()); self } - /// Maximum number of files to return. + /// The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. /// /// 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 body of items (files/documents) to which the query applies. + /// Whether Team Drive items should be included in results. + /// + /// Sets the *include team drive items* query property to the given value. + pub fn include_team_drive_items(mut self, new_value: bool) -> FileListCall<'a, C, A> { + self._include_team_drive_items = Some(new_value); + self + } + /// The body of items (files/documents) to which the query applies. Deprecated: use 'corpora' instead. /// /// Sets the *corpus* query property to the given value. pub fn corpus(mut self, new_value: &str) -> FileListCall<'a, C, A> { self._corpus = Some(new_value.to_string()); self } + /// Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'default', 'domain', 'teamDrive' and 'allTeamDrives'. 'allTeamDrives' must be combined with 'default'; all other values must be used in isolation. Prefer 'default' or 'teamDrive' to 'allTeamDrives' for efficiency. + /// + /// Sets the *corpora* query property to the given value. + pub fn corpora(mut self, new_value: &str) -> FileListCall<'a, C, A> { + self._corpora = 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. /// @@ -6091,6 +6676,7 @@ impl<'a, C, A> FileListCall<'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.files().touch("fileId") +/// .supports_team_drives(true) /// .doit(); /// # } /// ``` @@ -6099,6 +6685,7 @@ pub struct FileTouchCall<'a, C, A> hub: &'a Drive, _file_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -6120,9 +6707,12 @@ impl<'a, C, A> FileTouchCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "drive.files.touch", http_method: hyper::method::Method::Post }); - 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(("fileId", self._file_id.to_string())); - for &field in ["alt", "fileId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["alt", "fileId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6134,7 +6724,7 @@ impl<'a, C, A> FileTouchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/touch"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/touch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6247,6 +6837,13 @@ impl<'a, C, A> FileTouchCall<'a, C, A> where C: BorrowMut, A: oau self._file_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileTouchCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -6326,8 +6923,8 @@ impl<'a, C, A> FileTouchCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().generate_ids() -/// .space("consetetur") -/// .max_results(-44) +/// .space("takimata") +/// .max_results(-40) /// .doit(); /// # } /// ``` @@ -6377,7 +6974,7 @@ impl<'a, C, A> FileGenerateIdCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/generateIds"; + let mut url = "https://www.googleapis.com/drive/v2/files/generateIds".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6559,19 +7156,20 @@ impl<'a, C, A> FileGenerateIdCall<'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.files().update(req, "fileId") -/// .use_content_as_indexable_text(false) +/// .use_content_as_indexable_text(true) /// .update_viewed_date(false) -/// .timed_text_track_name("consetetur") -/// .timed_text_language("dolore") -/// .set_modified_date(true) -/// .remove_parents("aliquyam") -/// .pinned(true) -/// .ocr_language("et") +/// .timed_text_track_name("At") +/// .timed_text_language("labore") +/// .supports_team_drives(true) +/// .set_modified_date(false) +/// .remove_parents("sadipscing") +/// .pinned(false) +/// .ocr_language("dolore") /// .ocr(true) /// .new_revision(true) -/// .modified_date_behavior("takimata") -/// .convert(true) -/// .add_parents("kasd") +/// .modified_date_behavior("aliquyam") +/// .convert(false) +/// .add_parents("eirmod") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -6585,6 +7183,7 @@ pub struct FileUpdateCall<'a, C, A> _update_viewed_date: Option, _timed_text_track_name: Option, _timed_text_language: Option, + _supports_team_drives: Option, _set_modified_date: Option, _remove_parents: Option, _pinned: Option, @@ -6616,7 +7215,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.update", http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((17 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((18 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._use_content_as_indexable_text { params.push(("useContentAsIndexableText", value.to_string())); @@ -6630,6 +7229,9 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._timed_text_language { params.push(("timedTextLanguage", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._set_modified_date { params.push(("setModifiedDate", value.to_string())); } @@ -6657,7 +7259,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._add_parents { params.push(("addParents", value.to_string())); } - for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "modifiedDateBehavior", "convert", "addParents"].iter() { + for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "modifiedDateBehavior", "convert", "addParents"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6671,9 +7273,9 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/drive/v2/files/{fileId}", "multipart") + ("https://www.googleapis.com/upload/drive/v2/files/{fileId}".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/drive/v2/files/{fileId}", "resumable") + ("https://www.googleapis.com/resumable/upload/drive/v2/files/{fileId}".to_string(), "resumable") } else { unreachable!() }; @@ -6946,6 +7548,13 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa self._timed_text_language = Some(new_value.to_string()); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileUpdateCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Whether to set the modified date with the supplied modified date. /// /// Sets the *set modified date* query property to the given value. @@ -7061,7 +7670,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa } -/// Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file. +/// Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for Team Drive files. /// /// A builder for the *delete* method supported by a *file* resource. /// It is not used directly, but through a `FileMethods` instance. @@ -7088,6 +7697,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().delete("fileId") +/// .supports_team_drives(false) /// .doit(); /// # } /// ``` @@ -7096,6 +7706,7 @@ pub struct FileDeleteCall<'a, C, A> hub: &'a Drive, _file_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -7117,9 +7728,12 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.delete", http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); - for &field in ["fileId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["fileId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7130,7 +7744,7 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "files/{fileId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7233,6 +7847,13 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa self._file_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileDeleteCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -7320,17 +7941,18 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// let result = hub.files().patch(req, "fileId") /// .use_content_as_indexable_text(true) /// .update_viewed_date(false) -/// .timed_text_track_name("invidunt") -/// .timed_text_language("ea") +/// .timed_text_track_name("aliquyam") +/// .timed_text_language("eos") +/// .supports_team_drives(true) /// .set_modified_date(false) -/// .remove_parents("rebum.") -/// .pinned(true) -/// .ocr_language("nonumy") -/// .ocr(true) +/// .remove_parents("labore") +/// .pinned(false) +/// .ocr_language("aliquyam") +/// .ocr(false) /// .new_revision(false) -/// .modified_date_behavior("sit") +/// .modified_date_behavior("diam") /// .convert(true) -/// .add_parents("consetetur") +/// .add_parents("justo") /// .doit(); /// # } /// ``` @@ -7344,6 +7966,7 @@ pub struct FilePatchCall<'a, C, A> _update_viewed_date: Option, _timed_text_track_name: Option, _timed_text_language: Option, + _supports_team_drives: Option, _set_modified_date: Option, _remove_parents: Option, _pinned: Option, @@ -7374,7 +7997,7 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "drive.files.patch", http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((17 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((18 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._use_content_as_indexable_text { params.push(("useContentAsIndexableText", value.to_string())); @@ -7388,6 +8011,9 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau if let Some(value) = self._timed_text_language { params.push(("timedTextLanguage", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._set_modified_date { params.push(("setModifiedDate", value.to_string())); } @@ -7415,7 +8041,7 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau if let Some(value) = self._add_parents { params.push(("addParents", value.to_string())); } - for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "modifiedDateBehavior", "convert", "addParents"].iter() { + for &field in ["alt", "fileId", "useContentAsIndexableText", "updateViewedDate", "timedTextTrackName", "timedTextLanguage", "supportsTeamDrives", "setModifiedDate", "removeParents", "pinned", "ocrLanguage", "ocr", "newRevision", "modifiedDateBehavior", "convert", "addParents"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7427,7 +8053,7 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7592,6 +8218,13 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau self._timed_text_language = Some(new_value.to_string()); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FilePatchCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Whether to set the modified date with the supplied modified date. /// /// Sets the *set modified date* query property to the given value. @@ -7740,8 +8373,9 @@ impl<'a, C, A> FilePatchCall<'a, C, A> where C: BorrowMut, A: oau /// // Values shown here are possibly random and not representative ! /// let result = hub.files().get("fileId") /// .update_viewed_date(true) -/// .revision_id("ea") -/// .projection("gubergren") +/// .supports_team_drives(true) +/// .revision_id("clita") +/// .projection("diam") /// .acknowledge_abuse(false) /// .doit(); /// # } @@ -7752,6 +8386,7 @@ pub struct FileGetCall<'a, C, A> hub: &'a Drive, _file_id: String, _update_viewed_date: Option, + _supports_team_drives: Option, _revision_id: Option, _projection: Option, _acknowledge_abuse: Option, @@ -7776,11 +8411,14 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth }; dlg.begin(MethodInfo { id: "drive.files.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); if let Some(value) = self._update_viewed_date { params.push(("updateViewedDate", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._revision_id { params.push(("revisionId", value.to_string())); } @@ -7790,7 +8428,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth if let Some(value) = self._acknowledge_abuse { params.push(("acknowledgeAbuse", value.to_string())); } - for &field in ["fileId", "updateViewedDate", "revisionId", "projection", "acknowledgeAbuse"].iter() { + for &field in ["fileId", "updateViewedDate", "supportsTeamDrives", "revisionId", "projection", "acknowledgeAbuse"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7818,7 +8456,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "files/{fileId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -7938,6 +8576,13 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth self._update_viewed_date = Some(new_value); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileGetCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified. /// /// Sets the *revision id* query property to the given value. @@ -8011,10 +8656,255 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth } -/// Gets the information about the current user along with Drive API settings +/// Creates a new Team Drive. /// -/// A builder for the *get* method supported by a *about* resource. -/// It is not used directly, but through a `AboutMethods` instance. +/// A builder for the *insert* method supported by a *teamdrive* resource. +/// It is not used directly, but through a `TeamdriveMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive2 as drive2; +/// use drive2::TeamDrive; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive2::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = TeamDrive::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.teamdrives().insert(req, "requestId") +/// .doit(); +/// # } +/// ``` +pub struct TeamdriveInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _request: TeamDrive, + _request_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TeamdriveInsertCall<'a, C, A> {} + +impl<'a, C, A> TeamdriveInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TeamDrive)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "drive.teamdrives.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("requestId", self._request_id.to_string())); + for &field in ["alt", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v2/teamdrives".to_string(); + 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: TeamDrive) -> TeamdriveInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned. + /// + /// Sets the *request 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 request_id(mut self, new_value: &str) -> TeamdriveInsertCall<'a, C, A> { + self._request_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TeamdriveInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TeamdriveInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TeamdriveInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets a Team Drive's metadata by ID. +/// +/// A builder for the *get* method supported by a *teamdrive* resource. +/// It is not used directly, but through a `TeamdriveMethods` instance. /// /// # Example /// @@ -8037,32 +8927,27 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.about().get() -/// .start_change_id("eos") -/// .max_change_id_count(-38) -/// .include_subscribed(false) +/// let result = hub.teamdrives().get("teamDriveId") /// .doit(); /// # } /// ``` -pub struct AboutGetCall<'a, C, A> +pub struct TeamdriveGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Drive, - _start_change_id: Option, - _max_change_id_count: Option, - _include_subscribed: Option, + _team_drive_id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for AboutGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for TeamdriveGetCall<'a, C, A> {} -impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> TeamdriveGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, About)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, TeamDrive)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -8070,19 +8955,11 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "drive.about.get", + dlg.begin(MethodInfo { id: "drive.teamdrives.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - if let Some(value) = self._start_change_id { - params.push(("startChangeId", value.to_string())); - } - if let Some(value) = self._max_change_id_count { - params.push(("maxChangeIdCount", value.to_string())); - } - if let Some(value) = self._include_subscribed { - params.push(("includeSubscribed", value.to_string())); - } - for &field in ["alt", "startChangeId", "maxChangeIdCount", "includeSubscribed"].iter() { + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("teamDriveId", self._team_drive_id.to_string())); + for &field in ["alt", "teamDriveId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8094,9 +8971,252 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "about"; + let mut url = "https://www.googleapis.com/drive/v2/teamdrives/{teamDriveId}".to_string(); if self._scopes.len() == 0 { - self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{teamDriveId}", "teamDriveId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["teamDriveId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 Team Drive + /// + /// Sets the *team drive id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn team_drive_id(mut self, new_value: &str) -> TeamdriveGetCall<'a, C, A> { + self._team_drive_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TeamdriveGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TeamdriveGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TeamdriveGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists the user's Team Drives. +/// +/// A builder for the *list* method supported by a *teamdrive* resource. +/// It is not used directly, but through a `TeamdriveMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive2 as drive2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive2::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.teamdrives().list() +/// .page_token("invidunt") +/// .max_results(-87) +/// .doit(); +/// # } +/// ``` +pub struct TeamdriveListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _page_token: Option, + _max_results: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TeamdriveListCall<'a, C, A> {} + +impl<'a, C, A> TeamdriveListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TeamDriveList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + 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())); + 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() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v2/teamdrives".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8176,25 +9296,18 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut } - /// Change ID to start counting from when calculating number of remaining change IDs + /// Page token for Team Drives. /// - /// Sets the *start change id* query property to the given value. - pub fn start_change_id(mut self, new_value: &str) -> AboutGetCall<'a, C, A> { - self._start_change_id = Some(new_value.to_string()); + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TeamdriveListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); self } - /// Maximum number of remaining change IDs to count + /// Maximum number of Team Drives to return. /// - /// Sets the *max change id count* query property to the given value. - pub fn max_change_id_count(mut self, new_value: i64) -> AboutGetCall<'a, C, A> { - self._max_change_id_count = Some(new_value); - self - } - /// When calculating the number of remaining change IDs, whether to include public files the user has opened and shared files. When set to false, this counts only change IDs for owned files and any shared or public files that the user has explicitly added to a folder they own. - /// - /// Sets the *include subscribed* query property to the given value. - pub fn include_subscribed(mut self, new_value: bool) -> AboutGetCall<'a, C, A> { - self._include_subscribed = Some(new_value); + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> TeamdriveListCall<'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 @@ -8203,7 +9316,7 @@ impl<'a, C, A> AboutGetCall<'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) -> AboutGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TeamdriveListCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8224,7 +9337,7 @@ impl<'a, C, A> AboutGetCall<'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) -> AboutGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> TeamdriveListCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8233,7 +9346,7 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::MetadataReadonly`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -8241,7 +9354,497 @@ impl<'a, C, A> AboutGetCall<'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) -> AboutGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> TeamdriveListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. +/// +/// A builder for the *delete* method supported by a *teamdrive* resource. +/// It is not used directly, but through a `TeamdriveMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive2 as drive2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive2::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.teamdrives().delete("teamDriveId") +/// .doit(); +/// # } +/// ``` +pub struct TeamdriveDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _team_drive_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TeamdriveDeleteCall<'a, C, A> {} + +impl<'a, C, A> TeamdriveDeleteCall<'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: "drive.teamdrives.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("teamDriveId", self._team_drive_id.to_string())); + for &field in ["teamDriveId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = "https://www.googleapis.com/drive/v2/teamdrives/{teamDriveId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{teamDriveId}", "teamDriveId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["teamDriveId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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 Team Drive + /// + /// Sets the *team drive id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn team_drive_id(mut self, new_value: &str) -> TeamdriveDeleteCall<'a, C, A> { + self._team_drive_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TeamdriveDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TeamdriveDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TeamdriveDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a Team Drive's metadata +/// +/// A builder for the *update* method supported by a *teamdrive* resource. +/// It is not used directly, but through a `TeamdriveMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive2 as drive2; +/// use drive2::TeamDrive; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive2::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = TeamDrive::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.teamdrives().update(req, "teamDriveId") +/// .doit(); +/// # } +/// ``` +pub struct TeamdriveUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _request: TeamDrive, + _team_drive_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TeamdriveUpdateCall<'a, C, A> {} + +impl<'a, C, A> TeamdriveUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TeamDrive)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "drive.teamdrives.update", + http_method: hyper::method::Method::Put }); + 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 self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v2/teamdrives/{teamDriveId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{teamDriveId}", "teamDriveId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["teamDriveId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: TeamDrive) -> TeamdriveUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the Team Drive + /// + /// Sets the *team drive id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn team_drive_id(mut self, new_value: &str) -> TeamdriveUpdateCall<'a, C, A> { + self._team_drive_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TeamdriveUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TeamdriveUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TeamdriveUpdateCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -8277,7 +9880,7 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.realtime().update("fileId") -/// .base_revision("ipsum") +/// .base_revision("duo") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -8327,9 +9930,9 @@ impl<'a, C, A> RealtimeUpdateCall<'a, C, A> where C: BorrowMut, A let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/drive/v2/files/{fileId}/realtime", "multipart") + ("https://www.googleapis.com/upload/drive/v2/files/{fileId}/realtime".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/drive/v2/files/{fileId}/realtime", "resumable") + ("https://www.googleapis.com/resumable/upload/drive/v2/files/{fileId}/realtime".to_string(), "resumable") } else { unreachable!() }; @@ -8624,7 +10227,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(-69) +/// .revision(-31) /// .doit(); /// # } /// ``` @@ -8671,7 +10274,7 @@ impl<'a, C, A> RealtimeGetCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "files/{fileId}/realtime"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/realtime".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8903,7 +10506,7 @@ impl<'a, C, A> AppGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "apps/{appId}"; + let mut url = "https://www.googleapis.com/drive/v2/apps/{appId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppReadonly.as_ref().to_string(), ()); } @@ -9095,9 +10698,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("diam") -/// .app_filter_mime_types("ut") -/// .app_filter_extensions("justo") +/// .language_code("ea") +/// .app_filter_mime_types("et") +/// .app_filter_extensions("dolor") /// .doit(); /// # } /// ``` @@ -9151,7 +10754,7 @@ impl<'a, C, A> AppListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "apps"; + let mut url = "https://www.googleapis.com/drive/v2/apps".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppReadonly.as_ref().to_string(), ()); } @@ -9306,6 +10909,244 @@ impl<'a, C, A> AppListCall<'a, C, A> where C: BorrowMut, A: oauth } +/// Gets the information about the current user along with Drive API settings +/// +/// A builder for the *get* method supported by a *about* resource. +/// It is not used directly, but through a `AboutMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive2 as drive2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive2::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.about().get() +/// .start_change_id("diam") +/// .max_change_id_count(-62) +/// .include_subscribed(false) +/// .doit(); +/// # } +/// ``` +pub struct AboutGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _start_change_id: Option, + _max_change_id_count: Option, + _include_subscribed: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for AboutGetCall<'a, C, A> {} + +impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, About)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "drive.about.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + if let Some(value) = self._start_change_id { + params.push(("startChangeId", value.to_string())); + } + if let Some(value) = self._max_change_id_count { + params.push(("maxChangeIdCount", value.to_string())); + } + if let Some(value) = self._include_subscribed { + params.push(("includeSubscribed", value.to_string())); + } + for &field in ["alt", "startChangeId", "maxChangeIdCount", "includeSubscribed"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v2/about".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::MetadataReadonly.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) + } + } + } + } + + + /// Change ID to start counting from when calculating number of remaining change IDs + /// + /// Sets the *start change id* query property to the given value. + pub fn start_change_id(mut self, new_value: &str) -> AboutGetCall<'a, C, A> { + self._start_change_id = Some(new_value.to_string()); + self + } + /// Maximum number of remaining change IDs to count + /// + /// Sets the *max change id count* query property to the given value. + pub fn max_change_id_count(mut self, new_value: i64) -> AboutGetCall<'a, C, A> { + self._max_change_id_count = Some(new_value); + self + } + /// When calculating the number of remaining change IDs, whether to include public files the user has opened and shared files. When set to false, this counts only change IDs for owned files and any shared or public files that the user has explicitly added to a folder they own. + /// + /// Sets the *include subscribed* query property to the given value. + pub fn include_subscribed(mut self, new_value: bool) -> AboutGetCall<'a, C, A> { + self._include_subscribed = 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) -> AboutGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> AboutGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::MetadataReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> AboutGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Deletes a comment. /// /// A builder for the *delete* method supported by a *comment* resource. @@ -9377,7 +11218,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9619,7 +11460,7 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9878,7 +11719,7 @@ impl<'a, C, A> CommentInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10146,7 +11987,7 @@ impl<'a, C, A> CommentPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10424,7 +12265,7 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10650,10 +12491,10 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.comments().list("fileId") -/// .updated_min("eos") -/// .page_token("voluptua.") -/// .max_results(-19) -/// .include_deleted(false) +/// .updated_min("elitr") +/// .page_token("nonumy") +/// .max_results(-15) +/// .include_deleted(true) /// .doit(); /// # } /// ``` @@ -10713,7 +12554,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10933,10 +12774,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("ea") -/// .page_token("ea") -/// .order_by("et") -/// .max_results(-48) +/// .q("diam") +/// .page_token("ut") +/// .order_by("ut") +/// .max_results(-51) /// .doit(); /// # } /// ``` @@ -10996,7 +12837,7 @@ impl<'a, C, A> ChildrenListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{folderId}/children"; + let mut url = "https://www.googleapis.com/drive/v2/files/{folderId}/children".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -11261,7 +13102,7 @@ impl<'a, C, A> ChildrenGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{folderId}/children/{childId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{folderId}/children/{childId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -11507,7 +13348,7 @@ impl<'a, C, A> ChildrenDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "files/{folderId}/children/{childId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{folderId}/children/{childId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11705,6 +13546,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) /// .doit(); /// # } /// ``` @@ -11714,6 +13556,7 @@ pub struct ChildrenInsertCall<'a, C, A> hub: &'a Drive, _request: ChildReference, _folder_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -11735,9 +13578,12 @@ impl<'a, C, A> ChildrenInsertCall<'a, C, A> where C: BorrowMut, A }; dlg.begin(MethodInfo { id: "drive.children.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(("folderId", self._folder_id.to_string())); - for &field in ["alt", "folderId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["alt", "folderId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11749,7 +13595,7 @@ impl<'a, C, A> ChildrenInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{folderId}/children"; + let mut url = "https://www.googleapis.com/drive/v2/files/{folderId}/children".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11886,6 +13732,13 @@ impl<'a, C, A> ChildrenInsertCall<'a, C, A> where C: BorrowMut, A self._folder_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> ChildrenInsertCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -12012,7 +13865,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "channels/stop"; + let mut url = "https://www.googleapis.com/drive/v2/channels/stop".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12230,7 +14083,7 @@ impl<'a, C, A> ParentListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/parents"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/parents".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -12466,7 +14319,7 @@ impl<'a, C, A> ParentDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "files/{fileId}/parents/{parentId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/parents/{parentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12664,6 +14517,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) /// .doit(); /// # } /// ``` @@ -12673,6 +14527,7 @@ pub struct ParentInsertCall<'a, C, A> hub: &'a Drive, _request: ParentReference, _file_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -12694,9 +14549,12 @@ impl<'a, C, A> ParentInsertCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "drive.parents.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(("fileId", self._file_id.to_string())); - for &field in ["alt", "fileId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["alt", "fileId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12708,7 +14566,7 @@ impl<'a, C, A> ParentInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/parents"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/parents".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12845,6 +14703,13 @@ impl<'a, C, A> ParentInsertCall<'a, C, A> where C: BorrowMut, A: self._file_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> ParentInsertCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -12969,7 +14834,7 @@ impl<'a, C, A> ParentGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/parents/{parentId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/parents/{parentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -13225,7 +15090,7 @@ impl<'a, C, A> ReplyPatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13461,9 +15326,9 @@ impl<'a, C, A> ReplyPatchCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.replies().list("fileId", "commentId") -/// .page_token("rebum.") -/// .max_results(-6) -/// .include_deleted(true) +/// .page_token("vero") +/// .max_results(-99) +/// .include_deleted(false) /// .doit(); /// # } /// ``` @@ -13521,7 +15386,7 @@ impl<'a, C, A> ReplyListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13744,7 +15609,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(); /// # } /// ``` @@ -13796,7 +15661,7 @@ impl<'a, C, A> ReplyGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -14067,7 +15932,7 @@ impl<'a, C, A> ReplyInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14339,7 +16204,7 @@ impl<'a, C, A> ReplyDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14595,7 +16460,7 @@ impl<'a, C, A> ReplyUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14804,7 +16669,7 @@ impl<'a, C, A> ReplyUpdateCall<'a, C, A> where C: BorrowMut, A: o } -/// Deletes a permission from a file. +/// Deletes a permission from a file or Team Drive. /// /// A builder for the *delete* method supported by a *permission* resource. /// It is not used directly, but through a `PermissionMethods` instance. @@ -14831,6 +16696,7 @@ 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) /// .doit(); /// # } /// ``` @@ -14840,6 +16706,7 @@ pub struct PermissionDeleteCall<'a, C, A> hub: &'a Drive, _file_id: String, _permission_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -14861,10 +16728,13 @@ 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((3 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); params.push(("permissionId", self._permission_id.to_string())); - for &field in ["fileId", "permissionId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["fileId", "permissionId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -14875,7 +16745,7 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions/{permissionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14968,7 +16838,7 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, } - /// The ID for the file. + /// The ID for the file or Team Drive. /// /// Sets the *file id* path property to the given value. /// @@ -14988,6 +16858,13 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, self._permission_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionDeleteCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -15040,7 +16917,7 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, } -/// Inserts a permission for a file. +/// Inserts a permission for a file or Team Drive. /// /// A builder for the *insert* method supported by a *permission* resource. /// It is not used directly, but through a `PermissionMethods` instance. @@ -15073,8 +16950,9 @@ 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") +/// .supports_team_drives(false) /// .send_notification_emails(true) -/// .email_message("ut") +/// .email_message("dolores") /// .doit(); /// # } /// ``` @@ -15084,6 +16962,7 @@ pub struct PermissionInsertCall<'a, C, A> hub: &'a Drive, _request: Permission, _file_id: String, + _supports_team_drives: Option, _send_notification_emails: Option, _email_message: Option, _delegate: Option<&'a mut Delegate>, @@ -15107,15 +16986,18 @@ 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((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._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._send_notification_emails { params.push(("sendNotificationEmails", value.to_string())); } if let Some(value) = self._email_message { params.push(("emailMessage", value.to_string())); } - for &field in ["alt", "fileId", "sendNotificationEmails", "emailMessage"].iter() { + for &field in ["alt", "fileId", "supportsTeamDrives", "sendNotificationEmails", "emailMessage"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15127,7 +17009,7 @@ impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15254,7 +17136,7 @@ impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID for the file. + /// The ID for the file or Team Drive. /// /// Sets the *file id* path property to the given value. /// @@ -15264,6 +17146,13 @@ impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, self._file_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionInsertCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner. /// /// Sets the *send notification emails* query property to the given value. @@ -15364,6 +17253,7 @@ impl<'a, C, A> PermissionInsertCall<'a, C, A> where C: BorrowMut, /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().patch(req, "fileId", "permissionId") /// .transfer_ownership(false) +/// .supports_team_drives(false) /// .remove_expiration(true) /// .doit(); /// # } @@ -15376,6 +17266,7 @@ pub struct PermissionPatchCall<'a, C, A> _file_id: String, _permission_id: String, _transfer_ownership: Option, + _supports_team_drives: Option, _remove_expiration: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -15398,16 +17289,19 @@ 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((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())); params.push(("permissionId", self._permission_id.to_string())); if let Some(value) = self._transfer_ownership { params.push(("transferOwnership", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._remove_expiration { params.push(("removeExpiration", value.to_string())); } - for &field in ["alt", "fileId", "permissionId", "transferOwnership", "removeExpiration"].iter() { + for &field in ["alt", "fileId", "permissionId", "transferOwnership", "supportsTeamDrives", "removeExpiration"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15419,7 +17313,7 @@ impl<'a, C, A> PermissionPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions/{permissionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15546,7 +17440,7 @@ impl<'a, C, A> PermissionPatchCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID for the file. + /// The ID for the file or Team Drive. /// /// Sets the *file id* path property to the given value. /// @@ -15573,6 +17467,13 @@ impl<'a, C, A> PermissionPatchCall<'a, C, A> where C: BorrowMut, self._transfer_ownership = Some(new_value); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionPatchCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Whether to remove the expiration date. /// /// Sets the *remove expiration* query property to the given value. @@ -15632,7 +17533,7 @@ impl<'a, C, A> PermissionPatchCall<'a, C, A> where C: BorrowMut, } -/// Lists a file's permissions. +/// Lists a file's or Team Drive's permissions. /// /// A builder for the *list* method supported by a *permission* resource. /// It is not used directly, but through a `PermissionMethods` instance. @@ -15659,6 +17560,9 @@ 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) /// .doit(); /// # } /// ``` @@ -15667,6 +17571,9 @@ pub struct PermissionListCall<'a, C, A> hub: &'a Drive, _file_id: String, + _supports_team_drives: Option, + _page_token: Option, + _max_results: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -15688,9 +17595,18 @@ 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((3 + 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())); - for &field in ["alt", "fileId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", 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", "fileId", "supportsTeamDrives", "pageToken", "maxResults"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15702,7 +17618,7 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -15805,7 +17721,7 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A } - /// The ID for the file. + /// The ID for the file or Team Drive. /// /// Sets the *file id* path property to the given value. /// @@ -15815,6 +17731,27 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A self._file_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionListCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } + /// The token for continuing a previous list request on the next page. This should be set 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) -> PermissionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of permissions to return per page. When not set for files in a Team Drive, at most 100 results will be returned. When not set for files that are not in a Team Drive, the entire list will be returned. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: i32) -> PermissionListCall<'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. /// @@ -15900,7 +17837,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().update(req, "fileId", "permissionId") -/// .transfer_ownership(false) +/// .transfer_ownership(true) +/// .supports_team_drives(false) /// .remove_expiration(true) /// .doit(); /// # } @@ -15913,6 +17851,7 @@ pub struct PermissionUpdateCall<'a, C, A> _file_id: String, _permission_id: String, _transfer_ownership: Option, + _supports_team_drives: Option, _remove_expiration: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -15935,16 +17874,19 @@ 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((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())); params.push(("permissionId", self._permission_id.to_string())); if let Some(value) = self._transfer_ownership { params.push(("transferOwnership", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._remove_expiration { params.push(("removeExpiration", value.to_string())); } - for &field in ["alt", "fileId", "permissionId", "transferOwnership", "removeExpiration"].iter() { + for &field in ["alt", "fileId", "permissionId", "transferOwnership", "supportsTeamDrives", "removeExpiration"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -15956,7 +17898,7 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions/{permissionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16083,7 +18025,7 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID for the file. + /// The ID for the file or Team Drive. /// /// Sets the *file id* path property to the given value. /// @@ -16110,6 +18052,13 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, self._transfer_ownership = Some(new_value); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionUpdateCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Whether to remove the expiration date. /// /// Sets the *remove expiration* query property to the given value. @@ -16196,6 +18145,7 @@ 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) /// .doit(); /// # } /// ``` @@ -16205,6 +18155,7 @@ pub struct PermissionGetCall<'a, C, A> hub: &'a Drive, _file_id: String, _permission_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -16226,10 +18177,13 @@ 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((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())); - for &field in ["alt", "fileId", "permissionId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["alt", "fileId", "permissionId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16241,7 +18195,7 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/permissions/{permissionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -16344,7 +18298,7 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: } - /// The ID for the file. + /// The ID for the file or Team Drive. /// /// Sets the *file id* path property to the given value. /// @@ -16364,6 +18318,13 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: self._permission_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionGetCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -16486,7 +18447,7 @@ impl<'a, C, A> PermissionGetIdForEmailCall<'a, C, A> where C: BorrowMut PermissionGetIdForEmailCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.changes().get_start_page_token() +/// .team_drive_id("sadipscing") +/// .supports_team_drives(false) +/// .doit(); +/// # } +/// ``` +pub struct ChangeGetStartPageTokenCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _team_drive_id: Option, + _supports_team_drives: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ChangeGetStartPageTokenCall<'a, C, A> {} + +impl<'a, C, A> ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, StartPageToken)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "drive.changes.getStartPageToken", + 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._team_drive_id { + params.push(("teamDriveId", value.to_string())); + } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["alt", "teamDriveId", "supportsTeamDrives"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v2/changes/startPageToken".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::AppReadonly.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 ID of the Team Drive for which the starting pageToken for listing future changes from that Team Drive will be returned. + /// + /// Sets the *team drive id* query property to the given value. + pub fn team_drive_id(mut self, new_value: &str) -> ChangeGetStartPageTokenCall<'a, C, A> { + self._team_drive_id = Some(new_value.to_string()); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> ChangeGetStartPageTokenCall<'a, C, A> { + self._supports_team_drives = 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) -> ChangeGetStartPageTokenCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ChangeGetStartPageTokenCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::AppReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ChangeGetStartPageTokenCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Subscribe to changes for a user. /// /// A builder for the *watch* method supported by a *change* resource. @@ -16684,12 +18871,16 @@ impl<'a, C, A> PermissionGetIdForEmailCall<'a, C, A> where C: BorrowMut hub: &'a Drive, _request: Channel, + _team_drive_id: Option, + _supports_team_drives: Option, _start_change_id: Option, _spaces: Option, _page_token: Option, _max_results: Option, + _include_team_drive_items: Option, _include_subscribed: Option, _include_deleted: Option, + _include_corpus_removals: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -16725,7 +18920,13 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "drive.changes.watch", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((13 + self._additional_params.len())); + if let Some(value) = self._team_drive_id { + params.push(("teamDriveId", value.to_string())); + } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._start_change_id { params.push(("startChangeId", value.to_string())); } @@ -16738,13 +18939,19 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } + if let Some(value) = self._include_team_drive_items { + params.push(("includeTeamDriveItems", value.to_string())); + } if let Some(value) = self._include_subscribed { params.push(("includeSubscribed", value.to_string())); } if let Some(value) = self._include_deleted { params.push(("includeDeleted", value.to_string())); } - for &field in ["alt", "startChangeId", "spaces", "pageToken", "maxResults", "includeSubscribed", "includeDeleted"].iter() { + if let Some(value) = self._include_corpus_removals { + params.push(("includeCorpusRemovals", value.to_string())); + } + for &field in ["alt", "teamDriveId", "supportsTeamDrives", "startChangeId", "spaces", "pageToken", "maxResults", "includeTeamDriveItems", "includeSubscribed", "includeDeleted", "includeCorpusRemovals"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -16756,7 +18963,7 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "changes/watch"; + let mut url = "https://www.googleapis.com/drive/v2/changes/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16862,6 +19069,20 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o self._request = new_value; self } + /// The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. + /// + /// Sets the *team drive id* query property to the given value. + pub fn team_drive_id(mut self, new_value: &str) -> ChangeWatchCall<'a, C, A> { + self._team_drive_id = Some(new_value.to_string()); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> ChangeWatchCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Change ID to start listing changes from. /// /// Sets the *start change id* query property to the given value. @@ -16876,7 +19097,7 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o self._spaces = Some(new_value.to_string()); self } - /// Page token for changes. + /// The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ChangeWatchCall<'a, C, A> { @@ -16890,6 +19111,13 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o self._max_results = Some(new_value); self } + /// Whether Team Drive files or changes should be included in results. + /// + /// Sets the *include team drive items* query property to the given value. + pub fn include_team_drive_items(mut self, new_value: bool) -> ChangeWatchCall<'a, C, A> { + self._include_team_drive_items = Some(new_value); + self + } /// Whether to include public files the user has opened and shared files. When set to false, the list only includes owned files plus any shared or public files the user has explicitly added to a folder they own. /// /// Sets the *include subscribed* query property to the given value. @@ -16897,13 +19125,20 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o self._include_subscribed = Some(new_value); self } - /// Whether to include deleted items. + /// Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. /// /// Sets the *include deleted* query property to the given value. pub fn include_deleted(mut self, new_value: bool) -> ChangeWatchCall<'a, C, A> { self._include_deleted = Some(new_value); self } + /// Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + /// + /// Sets the *include corpus removals* query property to the given value. + pub fn include_corpus_removals(mut self, new_value: bool) -> ChangeWatchCall<'a, C, A> { + self._include_corpus_removals = 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. /// @@ -16956,7 +19191,7 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o } -/// Lists the changes for a user. +/// Lists the changes for a user or Team Drive. /// /// A builder for the *list* method supported by a *change* resource. /// It is not used directly, but through a `ChangeMethods` instance. @@ -16983,12 +19218,16 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.changes().list() -/// .start_change_id("consetetur") -/// .spaces("sea") -/// .page_token("elitr") -/// .max_results(-77) +/// .team_drive_id("consetetur") +/// .supports_team_drives(true) +/// .start_change_id("justo") +/// .spaces("tempor") +/// .page_token("gubergren") +/// .max_results(-84) +/// .include_team_drive_items(false) /// .include_subscribed(true) /// .include_deleted(false) +/// .include_corpus_removals(false) /// .doit(); /// # } /// ``` @@ -16996,12 +19235,16 @@ pub struct ChangeListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Drive, + _team_drive_id: Option, + _supports_team_drives: Option, _start_change_id: Option, _spaces: Option, _page_token: Option, _max_results: Option, + _include_team_drive_items: Option, _include_subscribed: Option, _include_deleted: Option, + _include_corpus_removals: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -17023,7 +19266,13 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.changes.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); + if let Some(value) = self._team_drive_id { + params.push(("teamDriveId", value.to_string())); + } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._start_change_id { params.push(("startChangeId", value.to_string())); } @@ -17036,13 +19285,19 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } + if let Some(value) = self._include_team_drive_items { + params.push(("includeTeamDriveItems", value.to_string())); + } if let Some(value) = self._include_subscribed { params.push(("includeSubscribed", value.to_string())); } if let Some(value) = self._include_deleted { params.push(("includeDeleted", value.to_string())); } - for &field in ["alt", "startChangeId", "spaces", "pageToken", "maxResults", "includeSubscribed", "includeDeleted"].iter() { + if let Some(value) = self._include_corpus_removals { + params.push(("includeCorpusRemovals", value.to_string())); + } + for &field in ["alt", "teamDriveId", "supportsTeamDrives", "startChangeId", "spaces", "pageToken", "maxResults", "includeTeamDriveItems", "includeSubscribed", "includeDeleted", "includeCorpusRemovals"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -17054,7 +19309,7 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "changes"; + let mut url = "https://www.googleapis.com/drive/v2/changes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppReadonly.as_ref().to_string(), ()); } @@ -17136,6 +19391,20 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa } + /// The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. + /// + /// Sets the *team drive id* query property to the given value. + pub fn team_drive_id(mut self, new_value: &str) -> ChangeListCall<'a, C, A> { + self._team_drive_id = Some(new_value.to_string()); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Change ID to start listing changes from. /// /// Sets the *start change id* query property to the given value. @@ -17150,7 +19419,7 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa self._spaces = Some(new_value.to_string()); self } - /// Page token for changes. + /// The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ChangeListCall<'a, C, A> { @@ -17164,6 +19433,13 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa self._max_results = Some(new_value); self } + /// Whether Team Drive files or changes should be included in results. + /// + /// Sets the *include team drive items* query property to the given value. + pub fn include_team_drive_items(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { + self._include_team_drive_items = Some(new_value); + self + } /// Whether to include public files the user has opened and shared files. When set to false, the list only includes owned files plus any shared or public files the user has explicitly added to a folder they own. /// /// Sets the *include subscribed* query property to the given value. @@ -17171,13 +19447,20 @@ impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oa self._include_subscribed = Some(new_value); self } - /// Whether to include deleted items. + /// Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. /// /// Sets the *include deleted* query property to the given value. pub fn include_deleted(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { self._include_deleted = Some(new_value); self } + /// Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + /// + /// Sets the *include corpus removals* query property to the given value. + pub fn include_corpus_removals(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { + self._include_corpus_removals = 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. /// @@ -17257,6 +19540,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("changeId") +/// .team_drive_id("ipsum") +/// .supports_team_drives(true) /// .doit(); /// # } /// ``` @@ -17265,6 +19550,8 @@ pub struct ChangeGetCall<'a, C, A> hub: &'a Drive, _change_id: String, + _team_drive_id: Option, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -17286,9 +19573,15 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "drive.changes.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((5 + self._additional_params.len())); params.push(("changeId", self._change_id.to_string())); - for &field in ["alt", "changeId"].iter() { + if let Some(value) = self._team_drive_id { + params.push(("teamDriveId", value.to_string())); + } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["alt", "changeId", "teamDriveId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -17300,7 +19593,7 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "changes/{changeId}"; + let mut url = "https://www.googleapis.com/drive/v2/changes/{changeId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppReadonly.as_ref().to_string(), ()); } @@ -17413,6 +19706,20 @@ impl<'a, C, A> ChangeGetCall<'a, C, A> where C: BorrowMut, A: oau self._change_id = new_value.to_string(); self } + /// The Team Drive from which the change will be returned. + /// + /// Sets the *team drive id* query property to the given value. + pub fn team_drive_id(mut self, new_value: &str) -> ChangeGetCall<'a, C, A> { + self._team_drive_id = Some(new_value.to_string()); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> ChangeGetCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -17498,7 +19805,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("consetetur") +/// .visibility("diam") /// .doit(); /// # } /// ``` @@ -17549,7 +19856,7 @@ impl<'a, C, A> PropertyPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/properties/{propertyKey}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties/{propertyKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17782,7 +20089,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("elitr") +/// .visibility("diam") /// .doit(); /// # } /// ``` @@ -17831,7 +20138,7 @@ impl<'a, C, A> PropertyDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "files/{fileId}/properties/{propertyKey}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties/{propertyKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18080,7 +20387,7 @@ impl<'a, C, A> PropertyInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/properties"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18339,7 +20646,7 @@ impl<'a, C, A> PropertyListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/properties"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -18537,7 +20844,7 @@ impl<'a, C, A> PropertyListCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.properties().update(req, "fileId", "propertyKey") -/// .visibility("dolor") +/// .visibility("vero") /// .doit(); /// # } /// ``` @@ -18588,7 +20895,7 @@ impl<'a, C, A> PropertyUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/properties/{propertyKey}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties/{propertyKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18821,7 +21128,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("Lorem") +/// .visibility("dolores") /// .doit(); /// # } /// ``` @@ -18871,7 +21178,7 @@ impl<'a, C, A> PropertyGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/properties/{propertyKey}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/properties/{propertyKey}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -19125,7 +21432,7 @@ impl<'a, C, A> RevisionGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/revisions/{revisionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -19379,7 +21686,7 @@ impl<'a, C, A> RevisionPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/revisions/{revisionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19649,7 +21956,7 @@ impl<'a, C, A> RevisionDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/revisions/{revisionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -19893,7 +22200,7 @@ impl<'a, C, A> RevisionUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/revisions/{revisionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -20119,8 +22426,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("Lorem") -/// .max_results(-16) +/// .page_token("nonumy") +/// .max_results(-47) /// .doit(); /// # } /// ``` @@ -20172,7 +22479,7 @@ impl<'a, C, A> RevisionListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions"; + let mut url = "https://www.googleapis.com/drive/v2/files/{fileId}/revisions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -20351,3 +22658,4 @@ impl<'a, C, A> RevisionListCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/drive3-cli/Cargo.toml b/gen/drive3-cli/Cargo.toml index c4b2548eac..147e2f2d54 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.4+20161212" +version = "1.0.4+20170512" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-drive3] path = "../drive3" -version = "1.0.4+20161212" +version = "1.0.4+20170512" diff --git a/gen/drive3-cli/README.md b/gen/drive3-cli/README.md index 041b9b614e..5ffd73d417 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 *20161212*. The CLI is at version *1.0.4*. +This documentation was generated from the *drive* API at revision *20170512*. The CLI is at version *1.0.4*. ```bash drive3 [options] @@ -71,6 +71,12 @@ drive3 [options] get [-p ]... [-o ] list [-p ]... [-o ] update (-r )... [-p ]... [-o ] + teamdrives + create (-r )... [-p ]... [-o ] + delete [-p ]... + get [-p ]... [-o ] + list [-p ]... [-o ] + update (-r )... [-p ]... [-o ] drive3 --help Configuration: diff --git a/gen/drive3-cli/mkdocs.yml b/gen/drive3-cli/mkdocs.yml index 6a4d9e2e46..e3146b941d 100644 --- a/gen/drive3-cli/mkdocs.yml +++ b/gen/drive3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: drive v1.0.4+20161212 +site_name: drive v1.0.4+20170512 site_url: http://byron.github.io/google-apis-rs/google-drive3-cli site_description: A complete library to interact with drive (protocol v3) @@ -43,6 +43,11 @@ pages: - ['revisions_get.md', 'Revisions', 'Get'] - ['revisions_list.md', 'Revisions', 'List'] - ['revisions_update.md', 'Revisions', 'Update'] +- ['teamdrives_create.md', 'Teamdrives', 'Create'] +- ['teamdrives_delete.md', 'Teamdrives', 'Delete'] +- ['teamdrives_get.md', 'Teamdrives', 'Get'] +- ['teamdrives_list.md', 'Teamdrives', 'List'] +- ['teamdrives_update.md', 'Teamdrives', 'Update'] theme: readthedocs diff --git a/gen/drive3-cli/src/main.rs b/gen/drive3-cli/src/main.rs index 25b3c555c8..e9a187c352 100644 --- a/gen/drive3-cli/src/main.rs +++ b/gen/drive3-cli/src/main.rs @@ -104,6 +104,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 { + "team-drive-id" => { + call = call.team_drive_id(value.unwrap_or("")); + }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -117,6 +123,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(["team-drive-id", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -156,6 +163,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 { + "team-drive-id" => { + call = call.team_drive_id(value.unwrap_or("")); + }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "spaces" => { call = call.spaces(value.unwrap_or("")); }, @@ -165,9 +178,15 @@ impl<'n> Engine<'n> { "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, + "include-team-drive-items" => { + call = call.include_team_drive_items(arg_from_str(value.unwrap_or("false"), err, "include-team-drive-items", "boolean")); + }, "include-removed" => { call = call.include_removed(arg_from_str(value.unwrap_or("false"), err, "include-removed", "boolean")); }, + "include-corpus-removals" => { + call = call.include_corpus_removals(arg_from_str(value.unwrap_or("false"), err, "include-corpus-removals", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -181,7 +200,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(["spaces", "page-size", "restrict-to-my-drive", "include-removed"].iter().map(|v|*v)); + v.extend(["page-size", "include-team-drive-items", "restrict-to-my-drive", "spaces", "supports-team-drives", "include-corpus-removals", "team-drive-id", "include-removed"].iter().map(|v|*v)); v } )); } } @@ -263,6 +282,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 { + "team-drive-id" => { + call = call.team_drive_id(value.unwrap_or("")); + }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "spaces" => { call = call.spaces(value.unwrap_or("")); }, @@ -272,9 +297,15 @@ impl<'n> Engine<'n> { "page-size" => { call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); }, + "include-team-drive-items" => { + call = call.include_team_drive_items(arg_from_str(value.unwrap_or("false"), err, "include-team-drive-items", "boolean")); + }, "include-removed" => { call = call.include_removed(arg_from_str(value.unwrap_or("false"), err, "include-removed", "boolean")); }, + "include-corpus-removals" => { + call = call.include_corpus_removals(arg_from_str(value.unwrap_or("false"), err, "include-corpus-removals", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -288,7 +319,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(["spaces", "page-size", "restrict-to-my-drive", "include-removed"].iter().map(|v|*v)); + v.extend(["page-size", "include-team-drive-items", "restrict-to-my-drive", "spaces", "supports-team-drives", "include-corpus-removals", "team-drive-id", "include-removed"].iter().map(|v|*v)); v } )); } } @@ -828,10 +859,23 @@ impl<'n> Engine<'n> { "folder-color-rgb" => Some(("folderColorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "app-properties" => Some(("appProperties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-untrash" => Some(("capabilities.canUntrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-item-into-team-drive" => Some(("capabilities.canMoveItemIntoTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-viewers-can-copy-content" => Some(("capabilities.canChangeViewersCanCopyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-read-team-drive" => Some(("capabilities.canReadTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashed-time" => Some(("trashedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-view-link" => Some(("webViewLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parents" => Some(("parents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -845,6 +889,7 @@ impl<'n> Engine<'n> { "viewed-by-me" => Some(("viewedByMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "modified-by-me" => Some(("modifiedByMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties" => Some(("properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -875,16 +920,23 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.me" => Some(("trashingUser.me", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.photo-link" => Some(("trashingUser.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "trashed" => Some(("trashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-hints.indexable-text" => Some(("contentHints.indexableText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-hints.thumbnail.mime-type" => Some(("contentHints.thumbnail.mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-hints.thumbnail.image" => Some(("contentHints.thumbnail.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-time" => Some(("createdTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "starred" => Some(("starred", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-comment", "can-copy", "can-edit", "can-read-revisions", "can-share", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -898,6 +950,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "ocr-language" => { call = call.ocr_language(value.unwrap_or("")); }, @@ -920,7 +975,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(["keep-revision-forever", "ocr-language", "ignore-default-visibility"].iter().map(|v|*v)); + v.extend(["keep-revision-forever", "ignore-default-visibility", "ocr-language", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -1007,10 +1062,23 @@ impl<'n> Engine<'n> { "folder-color-rgb" => Some(("folderColorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "app-properties" => Some(("appProperties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-untrash" => Some(("capabilities.canUntrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-item-into-team-drive" => Some(("capabilities.canMoveItemIntoTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-viewers-can-copy-content" => Some(("capabilities.canChangeViewersCanCopyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-read-team-drive" => Some(("capabilities.canReadTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashed-time" => Some(("trashedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-view-link" => Some(("webViewLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parents" => Some(("parents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -1024,6 +1092,7 @@ impl<'n> Engine<'n> { "viewed-by-me" => Some(("viewedByMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "modified-by-me" => Some(("modifiedByMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties" => Some(("properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1054,16 +1123,23 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.me" => Some(("trashingUser.me", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.photo-link" => Some(("trashingUser.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "trashed" => Some(("trashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-hints.indexable-text" => Some(("contentHints.indexableText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-hints.thumbnail.mime-type" => Some(("contentHints.thumbnail.mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-hints.thumbnail.image" => Some(("contentHints.thumbnail.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-time" => Some(("createdTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "starred" => Some(("starred", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-comment", "can-copy", "can-edit", "can-read-revisions", "can-share", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1080,6 +1156,9 @@ impl<'n> Engine<'n> { "use-content-as-indexable-text" => { call = call.use_content_as_indexable_text(arg_from_str(value.unwrap_or("false"), err, "use-content-as-indexable-text", "boolean")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "ocr-language" => { call = call.ocr_language(value.unwrap_or("")); }, @@ -1102,7 +1181,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(["keep-revision-forever", "use-content-as-indexable-text", "ocr-language", "ignore-default-visibility"].iter().map(|v|*v)); + v.extend(["keep-revision-forever", "ignore-default-visibility", "use-content-as-indexable-text", "ocr-language", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -1146,6 +1225,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1159,6 +1241,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 } )); } } @@ -1351,6 +1434,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "acknowledge-abuse" => { call = call.acknowledge_abuse(arg_from_str(value.unwrap_or("false"), err, "acknowledge-abuse", "boolean")); }, @@ -1370,7 +1456,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(["acknowledge-abuse"].iter().map(|v|*v)); + v.extend(["acknowledge-abuse", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -1415,6 +1501,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 { + "team-drive-id" => { + call = call.team_drive_id(value.unwrap_or("")); + }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "spaces" => { call = call.spaces(value.unwrap_or("")); }, @@ -1430,9 +1522,15 @@ impl<'n> Engine<'n> { "order-by" => { call = call.order_by(value.unwrap_or("")); }, + "include-team-drive-items" => { + call = call.include_team_drive_items(arg_from_str(value.unwrap_or("false"), err, "include-team-drive-items", "boolean")); + }, "corpus" => { call = call.corpus(value.unwrap_or("")); }, + "corpora" => { + call = call.corpora(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1446,7 +1544,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-size", "q", "page-token", "spaces", "corpus"].iter().map(|v|*v)); + v.extend(["order-by", "include-team-drive-items", "page-size", "corpora", "supports-team-drives", "q", "page-token", "spaces", "team-drive-id", "corpus"].iter().map(|v|*v)); v } )); } } @@ -1533,10 +1631,23 @@ impl<'n> Engine<'n> { "folder-color-rgb" => Some(("folderColorRgb", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "app-properties" => Some(("appProperties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "capabilities.can-read-revisions" => Some(("capabilities.canReadRevisions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-untrash" => Some(("capabilities.canUntrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-copy" => Some(("capabilities.canCopy", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), - "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete" => Some(("capabilities.canDelete", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-team-drive-item" => Some(("capabilities.canMoveTeamDriveItem", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-move-item-into-team-drive" => Some(("capabilities.canMoveItemIntoTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-trash" => Some(("capabilities.canTrash", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-viewers-can-copy-content" => Some(("capabilities.canChangeViewersCanCopyContent", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-read-team-drive" => Some(("capabilities.canReadTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename" => Some(("capabilities.canRename", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashed-time" => Some(("trashedTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-view-link" => Some(("webViewLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "parents" => Some(("parents", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), @@ -1550,6 +1661,7 @@ impl<'n> Engine<'n> { "viewed-by-me" => Some(("viewedByMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "modified-by-me" => Some(("modifiedByMe", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "quota-bytes-used" => Some(("quotaBytesUsed", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "team-drive-id" => Some(("teamDriveId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "file-extension" => Some(("fileExtension", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "properties" => Some(("properties", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "md5-checksum" => Some(("md5Checksum", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1580,16 +1692,23 @@ impl<'n> Engine<'n> { "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "web-content-link" => Some(("webContentLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.me" => Some(("trashingUser.me", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "trashing-user.kind" => Some(("trashingUser.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.display-name" => Some(("trashingUser.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.permission-id" => Some(("trashingUser.permissionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.email-address" => Some(("trashingUser.emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "trashing-user.photo-link" => Some(("trashingUser.photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "spaces" => Some(("spaces", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "trashed" => Some(("trashed", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "content-hints.indexable-text" => Some(("contentHints.indexableText", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-hints.thumbnail.mime-type" => Some(("contentHints.thumbnail.mimeType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-hints.thumbnail.image" => Some(("contentHints.thumbnail.image", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "created-time" => Some(("createdTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "has-augmented-permissions" => Some(("hasAugmentedPermissions", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "starred" => Some(("starred", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "head-revision-id" => Some(("headRevisionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-comment", "can-copy", "can-edit", "can-read-revisions", "can-share", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["altitude", "aperture", "app-properties", "camera-make", "camera-model", "can-add-children", "can-change-viewers-can-copy-content", "can-comment", "can-copy", "can-delete", "can-download", "can-edit", "can-list-children", "can-move-item-into-team-drive", "can-move-team-drive-item", "can-read-revisions", "can-read-team-drive", "can-remove-children", "can-rename", "can-share", "can-trash", "can-untrash", "capabilities", "color-space", "content-hints", "created-time", "description", "display-name", "duration-millis", "email-address", "explicitly-trashed", "exposure-bias", "exposure-mode", "exposure-time", "file-extension", "flash-used", "focal-length", "folder-color-rgb", "full-file-extension", "has-augmented-permissions", "has-thumbnail", "head-revision-id", "height", "icon-link", "id", "image", "image-media-metadata", "indexable-text", "is-app-authorized", "iso-speed", "kind", "last-modifying-user", "latitude", "lens", "location", "longitude", "max-aperture-value", "md5-checksum", "me", "metering-mode", "mime-type", "modified-by-me", "modified-by-me-time", "modified-time", "name", "original-filename", "owned-by-me", "parents", "permission-id", "photo-link", "properties", "quota-bytes-used", "rotation", "sensor", "shared", "shared-with-me-time", "sharing-user", "size", "spaces", "starred", "subject-distance", "team-drive-id", "thumbnail", "thumbnail-link", "thumbnail-version", "time", "trashed", "trashed-time", "trashing-user", "version", "video-media-metadata", "viewed-by-me", "viewed-by-me-time", "viewers-can-copy-content", "web-content-link", "web-view-link", "white-balance", "width", "writers-can-share"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1606,6 +1725,9 @@ impl<'n> Engine<'n> { "use-content-as-indexable-text" => { call = call.use_content_as_indexable_text(arg_from_str(value.unwrap_or("false"), err, "use-content-as-indexable-text", "boolean")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "remove-parents" => { call = call.remove_parents(value.unwrap_or("")); }, @@ -1631,7 +1753,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(["add-parents", "keep-revision-forever", "use-content-as-indexable-text", "ocr-language", "remove-parents"].iter().map(|v|*v)); + v.extend(["add-parents", "use-content-as-indexable-text", "keep-revision-forever", "supports-team-drives", "ocr-language", "remove-parents"].iter().map(|v|*v)); v } )); } } @@ -1718,6 +1840,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "acknowledge-abuse" => { call = call.acknowledge_abuse(arg_from_str(value.unwrap_or("false"), err, "acknowledge-abuse", "boolean")); }, @@ -1737,7 +1862,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(["acknowledge-abuse"].iter().map(|v|*v)); + v.extend(["acknowledge-abuse", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -1802,6 +1927,7 @@ impl<'n> Engine<'n> { "domain" => Some(("domain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "allow-file-discovery" => Some(("allowFileDiscovery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "deleted" => Some(("deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "email-address" => Some(("emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "photo-link" => Some(("photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1810,7 +1936,7 @@ impl<'n> Engine<'n> { "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!["allow-file-discovery", "display-name", "domain", "email-address", "expiration-time", "id", "kind", "photo-link", "role", "type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-file-discovery", "deleted", "display-name", "domain", "email-address", "expiration-time", "id", "kind", "photo-link", "role", "type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1827,6 +1953,9 @@ impl<'n> Engine<'n> { "transfer-ownership" => { call = call.transfer_ownership(arg_from_str(value.unwrap_or("false"), err, "transfer-ownership", "boolean")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "send-notification-email" => { call = call.send_notification_email(arg_from_str(value.unwrap_or("false"), err, "send-notification-email", "boolean")); }, @@ -1846,7 +1975,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"].iter().map(|v|*v)); + v.extend(["send-notification-email", "email-message", "transfer-ownership", "supports-team-drives"].iter().map(|v|*v)); v } )); } } @@ -1886,6 +2015,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1899,6 +2031,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 } )); } } @@ -1930,6 +2063,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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1943,6 +2079,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 } )); } } @@ -1982,6 +2119,15 @@ 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 { + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1995,6 +2141,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 } )); } } @@ -2054,6 +2201,7 @@ impl<'n> Engine<'n> { "domain" => Some(("domain", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "allow-file-discovery" => Some(("allowFileDiscovery", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "deleted" => Some(("deleted", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "email-address" => Some(("emailAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "photo-link" => Some(("photoLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2062,7 +2210,7 @@ impl<'n> Engine<'n> { "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!["allow-file-discovery", "display-name", "domain", "email-address", "expiration-time", "id", "kind", "photo-link", "role", "type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["allow-file-discovery", "deleted", "display-name", "domain", "email-address", "expiration-time", "id", "kind", "photo-link", "role", "type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2079,6 +2227,9 @@ impl<'n> Engine<'n> { "transfer-ownership" => { call = call.transfer_ownership(arg_from_str(value.unwrap_or("false"), err, "transfer-ownership", "boolean")); }, + "supports-team-drives" => { + call = call.supports_team_drives(arg_from_str(value.unwrap_or("false"), err, "supports-team-drives", "boolean")); + }, "remove-expiration" => { call = call.remove_expiration(arg_from_str(value.unwrap_or("false"), err, "remove-expiration", "boolean")); }, @@ -2095,7 +2246,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", "remove-expiration"].iter().map(|v|*v)); + v.extend(["transfer-ownership", "supports-team-drives", "remove-expiration"].iter().map(|v|*v)); v } )); } } @@ -2756,6 +2907,377 @@ impl<'n> Engine<'n> { } } + fn _teamdrives_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()[..] { + "kind" => Some(("kind", 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 })), + "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 })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-manage-members" => Some(("capabilities.canManageMembers", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-team-drive-background" => Some(("capabilities.canChangeTeamDriveBackground", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete-team-drive" => Some(("capabilities.canDeleteTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename-team-drive" => Some(("capabilities.canRenameTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "background-image-file.width" => Some(("backgroundImageFile.width", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "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 })), + "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"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TeamDrive = json::value::from_value(object).unwrap(); + let mut call = self.hub.teamdrives().create(request, opt.value_of("request-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _teamdrives_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.teamdrives().delete(opt.value_of("team-drive-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.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 _teamdrives_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.teamdrives().get(opt.value_of("team-drive-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _teamdrives_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.teamdrives().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 _teamdrives_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 })), + "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 })), + "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 })), + "capabilities.can-list-children" => Some(("capabilities.canListChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-share" => Some(("capabilities.canShare", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-manage-members" => Some(("capabilities.canManageMembers", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-download" => Some(("capabilities.canDownload", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-comment" => Some(("capabilities.canComment", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-change-team-drive-background" => Some(("capabilities.canChangeTeamDriveBackground", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-delete-team-drive" => Some(("capabilities.canDeleteTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-rename-team-drive" => Some(("capabilities.canRenameTeamDrive", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-remove-children" => Some(("capabilities.canRemoveChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-add-children" => Some(("capabilities.canAddChildren", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "capabilities.can-edit" => Some(("capabilities.canEdit", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "background-image-file.width" => Some(("backgroundImageFile.width", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "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 })), + "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"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::TeamDrive = json::value::from_value(object).unwrap(); + let mut call = self.hub.teamdrives().update(request, opt.value_of("team-drive-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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(()); @@ -2927,6 +3449,29 @@ impl<'n> Engine<'n> { } } }, + ("teamdrives", Some(opt)) => { + match opt.subcommand() { + ("create", Some(opt)) => { + call_result = self._teamdrives_create(opt, dry_run, &mut err); + }, + ("delete", Some(opt)) => { + call_result = self._teamdrives_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._teamdrives_get(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._teamdrives_list(opt, dry_run, &mut err); + }, + ("update", Some(opt)) => { + call_result = self._teamdrives_update(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("teamdrives".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, _ => { err.issues.push(CLIError::MissingCommandError); writeln!(io::stderr(), "{}\n", self.opt.usage()).ok(); @@ -3047,7 +3592,7 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists changes for a user."##), + Some(r##"Lists the changes for a user or Team Drive."##), "Details at http://byron.github.io/google-apis-rs/google_drive3_cli/changes_list", vec![ (Some(r##"page-token"##), @@ -3312,7 +3857,7 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Permanently deletes a file owned by the user without moving it to the trash. If the target is a folder, all descendants owned by the user are also deleted."##), + Some(r##"Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted."##), "Details at http://byron.github.io/google-apis-rs/google_drive3_cli/files_delete", vec![ (Some(r##"file-id"##), @@ -3485,12 +4030,12 @@ fn main() { ("permissions", "methods: 'create', 'delete', 'get', 'list' and 'update'", vec![ ("create", - Some(r##"Creates a permission for a file."##), + Some(r##"Creates a permission for a file or Team Drive."##), "Details at http://byron.github.io/google-apis-rs/google_drive3_cli/permissions_create", vec![ (Some(r##"file-id"##), None, - Some(r##"The ID of the file."##), + Some(r##"The ID of the file or Team Drive."##), Some(true), Some(false)), @@ -3518,7 +4063,7 @@ fn main() { vec![ (Some(r##"file-id"##), None, - Some(r##"The ID of the file."##), + Some(r##"The ID of the file or Team Drive."##), Some(true), Some(false)), @@ -3563,12 +4108,12 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists a file's permissions."##), + Some(r##"Lists a file's or Team Drive's permissions."##), "Details at http://byron.github.io/google-apis-rs/google_drive3_cli/permissions_list", vec![ (Some(r##"file-id"##), None, - Some(r##"The ID of the file."##), + Some(r##"The ID of the file or Team Drive."##), Some(true), Some(false)), @@ -3590,7 +4135,7 @@ fn main() { vec![ (Some(r##"file-id"##), None, - Some(r##"The ID of the file."##), + Some(r##"The ID of the file or Team Drive."##), Some(true), Some(false)), @@ -3896,11 +4441,124 @@ fn main() { ]), ]), + ("teamdrives", "methods: 'create', 'delete', 'get', 'list' and 'update'", vec![ + ("create", + Some(r##"Creates a new Team Drive."##), + "Details at http://byron.github.io/google-apis-rs/google_drive3_cli/teamdrives_create", + vec![ + (Some(r##"request-id"##), + None, + Some(r##"An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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##"Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items."##), + "Details at http://byron.github.io/google-apis-rs/google_drive3_cli/teamdrives_delete", + vec![ + (Some(r##"team-drive-id"##), + None, + Some(r##"The ID of the Team Drive"##), + Some(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 a Team Drive's metadata by ID."##), + "Details at http://byron.github.io/google-apis-rs/google_drive3_cli/teamdrives_get", + vec![ + (Some(r##"team-drive-id"##), + None, + Some(r##"The ID of the Team Drive"##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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 user's Team Drives."##), + "Details at http://byron.github.io/google-apis-rs/google_drive3_cli/teamdrives_list", + vec![ + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update", + Some(r##"Updates a Team Drive's metadata"##), + "Details at http://byron.github.io/google-apis-rs/google_drive3_cli/teamdrives_update", + vec![ + (Some(r##"team-drive-id"##), + None, + Some(r##"The ID of the Team Drive"##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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("drive3") .author("Sebastian Thiel ") - .version("1.0.4+20161212") + .version("1.0.4+20170512") .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 498a982f9d..1ef9637061 100644 --- a/gen/drive3/Cargo.toml +++ b/gen/drive3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-drive3" -version = "1.0.4+20161212" +version = "1.0.4+20170512" 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.4+20161212" +documentation = "https://docs.rs/google-drive3/1.0.4+20170512" license = "MIT" keywords = ["drive", "google", "protocol", "web", "api"] diff --git a/gen/drive3/README.md b/gen/drive3/README.md index 31d8669afd..9c6aa7e66e 100644 --- a/gen/drive3/README.md +++ b/gen/drive3/README.md @@ -5,51 +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.4+20161212*, where *20161212* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *drive* crate version *1.0.4+20170512*, where *20170512* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161212/google_drive3/struct.Drive.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.Drive.html) ... -* [about](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.About.html) - * [*get*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.AboutGetCall.html) -* [changes](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.Change.html) - * [*get start page token*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ChangeWatchCall.html) -* [channels](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.Channel.html) - * [*stop*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ChannelStopCall.html) -* [comments](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.Comment.html) - * [*create*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.CommentCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.CommentGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.CommentListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.CommentUpdateCall.html) -* [files](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.File.html) - * [*copy*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileCopyCall.html), [*create*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileListCall.html), [*update*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileWatchCall.html) -* [permissions](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.Permission.html) - * [*create*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.PermissionCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.PermissionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.PermissionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.PermissionUpdateCall.html) -* [replies](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.Reply.html) - * [*create*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ReplyCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ReplyGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ReplyListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ReplyUpdateCall.html) -* [revisions](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.Revision.html) - * [*delete*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.RevisionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.RevisionUpdateCall.html) +* [about](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.About.html) + * [*get*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.AboutGetCall.html) +* [changes](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.Change.html) + * [*get start page token*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ChangeGetStartPageTokenCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ChangeListCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ChangeWatchCall.html) +* [channels](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.Channel.html) + * [*stop*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ChannelStopCall.html) +* [comments](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.Comment.html) + * [*create*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.CommentCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.CommentDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.CommentGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.CommentListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.CommentUpdateCall.html) +* [files](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.File.html) + * [*copy*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileCopyCall.html), [*create*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileDeleteCall.html), [*empty trash*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileEmptyTrashCall.html), [*export*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileExportCall.html), [*generate ids*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileGenerateIdCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileListCall.html), [*update*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileUpdateCall.html) and [*watch*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileWatchCall.html) +* [permissions](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.Permission.html) + * [*create*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.PermissionCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.PermissionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.PermissionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.PermissionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.PermissionUpdateCall.html) +* [replies](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.Reply.html) + * [*create*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ReplyCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ReplyDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ReplyGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ReplyListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ReplyUpdateCall.html) +* [revisions](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.Revision.html) + * [*delete*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.RevisionDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.RevisionGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.RevisionListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.RevisionUpdateCall.html) +* teamdrives + * [*create*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.TeamdriveCreateCall.html), [*delete*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.TeamdriveDeleteCall.html), [*get*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.TeamdriveGetCall.html), [*list*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.TeamdriveListCall.html) and [*update*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.TeamdriveUpdateCall.html) Upload supported by ... -* [*update files*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileUpdateCall.html) -* [*create files*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileCreateCall.html) +* [*update files*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileUpdateCall.html) +* [*create files*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileCreateCall.html) Download supported by ... -* [*watch files*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileWatchCall.html) -* [*export files*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileExportCall.html) -* [*get revisions*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.RevisionGetCall.html) -* [*get files*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileGetCall.html) +* [*watch files*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileWatchCall.html) +* [*export files*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileExportCall.html) +* [*get revisions*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.RevisionGetCall.html) +* [*get files*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileGetCall.html) Subscription supported by ... -* [*watch changes*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ChangeWatchCall.html) -* [*watch files*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileWatchCall.html) -* [*list changes*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.ChangeListCall.html) -* [*create files*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileCreateCall.html) -* [*get files*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.FileGetCall.html) +* [*watch files*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileWatchCall.html) +* [*watch changes*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ChangeWatchCall.html) +* [*list changes*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.ChangeListCall.html) +* [*create files*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileCreateCall.html) +* [*get files*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/struct.FileGetCall.html) @@ -57,17 +59,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/struct.Drive.html)** +* **[Hub](https://docs.rs/google-drive3/1.0.4+20170512/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.4+20161212/google_drive3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-drive3/1.0.4+20170512/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.4+20161212/google_drive3/trait.Part.html)** + * **[Parts](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-drive3/1.0.4+20161212/google_drive3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-drive3/1.0.4+20170512/google_drive3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -115,9 +117,7 @@ google-drive3 = "*" extern crate hyper; extern crate yup_oauth2 as oauth2; extern crate google_drive3 as drive3; -use drive3::File; use drive3::{Result, Error}; -use std::fs; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; use drive3::Drive; @@ -134,21 +134,21 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::new(), ::default(), None); let mut hub = Drive::new(hyper::Client::new(), auth); -// As the method needs a request, you would usually fill it with the desired information -// into the respective structure. Some of the parts shown here might not be applicable ! -// Values shown here are possibly random and not representative ! -let mut req = File::default(); - // You can configure optional parameters by calling the respective setters at will, and -// execute the final call using `upload_resumable(...)`. +// execute the final call using `doit()`. // Values shown here are possibly random and not representative ! -let result = hub.files().update(req, "fileId") - .use_content_as_indexable_text(true) - .remove_parents("Stet") - .ocr_language("sed") - .keep_revision_forever(false) - .add_parents("dolores") - .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); +let result = hub.files().list() + .team_drive_id("eirmod") + .supports_team_drives(true) + .spaces("Stet") + .q("sed") + .page_token("et") + .page_size(-18) + .order_by("kasd") + .include_team_drive_items(true) + .corpus("takimata") + .corpora("justo") + .doit(); match result { Err(e) => match e { @@ -170,17 +170,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-drive3/1.0.4+20161212/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.4+20170512/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.4+20161212/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.4+20170512/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.4+20161212/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.4+20170512/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.4+20161212/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.4+20170512/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")`. @@ -190,29 +190,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.4+20161212/google_drive3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-drive3/1.0.4+20161212/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.4+20170512/google_drive3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-drive3/1.0.4+20170512/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.4+20161212/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.4+20170512/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.4+20161212/google_drive3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-drive3/1.0.4+20161212/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.4+20170512/google_drive3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-drive3/1.0.4+20170512/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.4+20161212/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.4+20170512/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.4+20161212/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.4+20170512/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.4+20161212/google_drive3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-drive3/1.0.4+20170512/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 ad46cf3f83..55bc87dd22 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.4+20161212*, where *20161212* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *drive* crate version *1.0.4+20170512*, where *20170512* is the exact revision of the *drive:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *drive* *v3* API can be found at the //! [official documentation site](https://developers.google.com/drive/). @@ -27,6 +27,8 @@ //! * [*create*](struct.ReplyCreateCall.html), [*delete*](struct.ReplyDeleteCall.html), [*get*](struct.ReplyGetCall.html), [*list*](struct.ReplyListCall.html) and [*update*](struct.ReplyUpdateCall.html) //! * [revisions](struct.Revision.html) //! * [*delete*](struct.RevisionDeleteCall.html), [*get*](struct.RevisionGetCall.html), [*list*](struct.RevisionListCall.html) and [*update*](struct.RevisionUpdateCall.html) +//! * teamdrives +//! * [*create*](struct.TeamdriveCreateCall.html), [*delete*](struct.TeamdriveDeleteCall.html), [*get*](struct.TeamdriveGetCall.html), [*list*](struct.TeamdriveListCall.html) and [*update*](struct.TeamdriveUpdateCall.html) //! //! //! Upload supported by ... @@ -43,8 +45,8 @@ //! //! Subscription supported by ... //! -//! * [*watch changes*](struct.ChangeWatchCall.html) //! * [*watch files*](struct.FileWatchCall.html) +//! * [*watch changes*](struct.ChangeWatchCall.html) //! * [*list changes*](struct.ChangeListCall.html) //! * [*create files*](struct.FileCreateCall.html) //! * [*get files*](struct.FileGetCall.html) @@ -115,9 +117,7 @@ //! extern crate hyper; //! extern crate yup_oauth2 as oauth2; //! extern crate google_drive3 as drive3; -//! use drive3::File; //! use drive3::{Result, Error}; -//! use std::fs; //! # #[test] fn egal() { //! use std::default::Default; //! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -135,21 +135,21 @@ //! hyper::Client::new(), //! ::default(), None); //! let mut hub = Drive::new(hyper::Client::new(), auth); -//! // As the method needs a request, you would usually fill it with the desired information -//! // into the respective structure. Some of the parts shown here might not be applicable ! -//! // Values shown here are possibly random and not representative ! -//! let mut req = File::default(); -//! //! // You can configure optional parameters by calling the respective setters at will, and -//! // execute the final call using `upload_resumable(...)`. +//! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! -//! let result = hub.files().update(req, "fileId") -//! .use_content_as_indexable_text(true) -//! .remove_parents("takimata") -//! .ocr_language("justo") -//! .keep_revision_forever(true) -//! .add_parents("erat") -//! .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); +//! let result = hub.files().list() +//! .team_drive_id("amet.") +//! .supports_team_drives(false) +//! .spaces("labore") +//! .q("sea") +//! .page_token("nonumy") +//! .page_size(-19) +//! .order_by("gubergren") +//! .include_team_drive_items(false) +//! .corpus("aliquyam") +//! .corpora("ea") +//! .doit(); //! //! match result { //! Err(e) => match e { @@ -225,7 +225,7 @@ // 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 +// 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)] @@ -332,9 +332,7 @@ impl Default for Scope { /// extern crate hyper; /// extern crate yup_oauth2 as oauth2; /// extern crate google_drive3 as drive3; -/// use drive3::File; /// use drive3::{Result, Error}; -/// use std::fs; /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -352,21 +350,21 @@ impl Default for Scope { /// hyper::Client::new(), /// ::default(), None); /// let mut hub = Drive::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = File::default(); -/// /// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `upload_resumable(...)`. +/// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.files().update(req, "fileId") -/// .use_content_as_indexable_text(true) -/// .remove_parents("nonumy") -/// .ocr_language("dolores") -/// .keep_revision_forever(false) -/// .add_parents("sadipscing") -/// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); +/// let result = hub.files().list() +/// .team_drive_id("no") +/// .supports_team_drives(true) +/// .spaces("justo") +/// .q("et") +/// .page_token("et") +/// .page_size(-41) +/// .order_by("ipsum") +/// .include_team_drive_items(true) +/// .corpus("et") +/// .corpora("duo") +/// .doit(); /// /// match result { /// Err(e) => match e { @@ -390,8 +388,6 @@ pub struct Drive { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Drive {} @@ -404,8 +400,6 @@ impl<'a, C, A> Drive client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/drive/v3/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -433,6 +427,9 @@ impl<'a, C, A> Drive pub fn revisions(&'a self) -> RevisionMethods<'a, C, A> { RevisionMethods { hub: &self } } + pub fn teamdrives(&'a self) -> TeamdriveMethods<'a, C, A> { + TeamdriveMethods { 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.4`. @@ -443,26 +440,6 @@ impl<'a, C, A> Drive self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/drive/v3/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -535,6 +512,9 @@ pub struct About { /// A map of source MIME type to possible targets for all supported exports. #[serde(rename="exportFormats")] pub export_formats: Option>>, + /// A list of themes that are supported for Team Drives. + #[serde(rename="teamDriveThemes")] + pub team_drive_themes: Option>, /// A map of maximum import sizes by MIME type, in bytes. #[serde(rename="maxImportSizes")] pub max_import_sizes: Option>, @@ -560,21 +540,128 @@ pub struct About { impl ResponseResult for About {} -/// Additional information about the content of the file. These fields are never populated in responses. +/// Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FileContentHints { - /// Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. - #[serde(rename="indexableText")] - pub indexable_text: Option, - /// A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail. - pub thumbnail: Option, +pub struct PermissionTeamDrivePermissionDetails { + /// Whether this permission is inherited. This field is always populated. This is an output-only field. + pub inherited: Option, + /// The Team Drive permission type for this user. While new values may be added in future, the following are currently possible: + /// - file + /// - member + #[serde(rename="teamDrivePermissionType")] + pub team_drive_permission_type: Option, + /// The primary role for this user. While new values may be added in the future, the following are currently possible: + /// - organizer + /// - writer + /// - commenter + /// - reader + pub role: Option, + /// The ID of the item from which this permission is inherited. This is an output-only field and is only populated for members of the Team Drive. + #[serde(rename="inheritedFrom")] + pub inherited_from: Option, } -impl NestedType for FileContentHints {} -impl Part for FileContentHints {} +impl NestedType for PermissionTeamDrivePermissionDetails {} +impl Part for PermissionTeamDrivePermissionDetails {} + + +/// A list of themes that are supported for Team Drives. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AboutTeamDriveThemes { + /// The color of this Team Drive theme as an RGB hex string. + #[serde(rename="colorRgb")] + pub color_rgb: Option, + /// A link to this Team Drive theme's background image. + #[serde(rename="backgroundImageLink")] + pub background_image_link: Option, + /// The ID of the theme. + pub id: Option, +} + +impl NestedType for AboutTeamDriveThemes {} +impl Part for AboutTeamDriveThemes {} + + +/// Capabilities the current user has on this Team Drive. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TeamDriveCapabilities { + /// Whether the current user can read the revisions resource of files in this Team Drive. + #[serde(rename="canReadRevisions")] + pub can_read_revisions: Option, + /// Whether the current user can copy files in this Team Drive. + #[serde(rename="canCopy")] + pub can_copy: Option, + /// Whether the current user can edit files in this Team Drive + #[serde(rename="canEdit")] + pub can_edit: Option, + /// Whether the current user can add children to folders in this Team Drive. + #[serde(rename="canAddChildren")] + pub can_add_children: Option, + /// Whether the current user can share files or folders in this Team Drive. + #[serde(rename="canShare")] + pub can_share: Option, + /// Whether the current user can add members to this Team Drive or remove them or change their role. + #[serde(rename="canManageMembers")] + pub can_manage_members: Option, + /// Whether the current user can download files in this Team Drive. + #[serde(rename="canDownload")] + pub can_download: Option, + /// Whether the current user can comment on files in this Team Drive. + #[serde(rename="canComment")] + pub can_comment: Option, + /// Whether the current user can change the background of this Team Drive. + #[serde(rename="canChangeTeamDriveBackground")] + pub can_change_team_drive_background: Option, + /// Whether the current user can delete this Team Drive. Attempting to delete the Team Drive may still fail if there are untrashed items inside the Team Drive. + #[serde(rename="canDeleteTeamDrive")] + pub can_delete_team_drive: Option, + /// Whether the current user can rename this Team Drive. + #[serde(rename="canRenameTeamDrive")] + pub can_rename_team_drive: Option, + /// Whether the current user can remove children from folders in this Team Drive. + #[serde(rename="canRemoveChildren")] + pub can_remove_children: Option, + /// Whether the current user can list the children of folders in this Team Drive. + #[serde(rename="canListChildren")] + pub can_list_children: Option, + /// Whether the current user can rename files or folders in this Team Drive. + #[serde(rename="canRename")] + pub can_rename: Option, +} + +impl NestedType for TeamDriveCapabilities {} +impl Part for TeamDriveCapabilities {} + + +/// 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. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TeamDriveBackgroundImageFile { + /// The width of the cropped image in the closed range of 0 to 1. This value represents the width of the cropped image divided by the width of the entire image. The height is computed by applying a width to height aspect ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and 144 pixels high. + pub width: Option, + /// The Y coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the vertical distance from the top side of the entire image to the top side of the cropping area divided by the height of the entire image. + #[serde(rename="yCoordinate")] + pub y_coordinate: Option, + /// The ID of an image file in Drive to use for the background image. + pub id: Option, + /// The X coordinate of the upper left corner of the cropping area in the background image. This is a value in the closed range of 0 to 1. This value represents the horizontal distance from the left side of the entire image to the left side of the cropping area divided by the width of the entire image. + #[serde(rename="xCoordinate")] + pub x_coordinate: Option, +} + +impl NestedType for TeamDriveBackgroundImageFile {} +impl Part for TeamDriveBackgroundImageFile {} /// A list of changes for a user. @@ -588,12 +675,12 @@ impl Part for FileContentHints {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ChangeList { - /// The page token for the next page of changes. This will be absent if the end of the current changes list has been reached. + /// The page token for the next page of changes. This will be absent if the end of the changes list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// Identifies what kind of resource this is. Value: the fixed string "drive#changeList". pub kind: Option, - /// The page of changes. + /// The list of changes. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. pub changes: Option>, /// The starting page token for future changes. This will be present only if the end of the current changes list has been reached. #[serde(rename="newStartPageToken")] @@ -614,12 +701,12 @@ impl ResponseResult for ChangeList {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ReplyList { - /// The page token for the next page of replies. This will be absent if the end of the replies list has been reached. + /// The page token for the next page of replies. This will be absent if the end of the replies list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// Identifies what kind of resource this is. Value: the fixed string "drive#replyList". pub kind: Option, - /// The page of replies. + /// The list of replies. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. pub replies: Option>, } @@ -721,12 +808,12 @@ impl Part for FileImageMediaMetadata {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RevisionList { - /// The page token for the next page of revisions. This will be absent if the end of the revisions list has been reached. + /// The page token for the next page of revisions. This will be absent if the end of the revisions list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// Identifies what kind of resource this is. Value: the fixed string "drive#revisionList". pub kind: Option, - /// The full list of revisions. + /// The list of revisions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. pub revisions: Option>, } @@ -922,18 +1009,35 @@ impl ResponseResult for Revision {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CommentList { - /// The page token for the next page of comments. This will be absent if the end of the comments list has been reached. + /// The page token for the next page of comments. This will be absent if the end of the comments list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// Identifies what kind of resource this is. Value: the fixed string "drive#commentList". pub kind: Option, - /// The page of comments. + /// The list of comments. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. pub comments: Option>, } impl ResponseResult for CommentList {} +/// Additional information about the content of the file. These fields are never populated in responses. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileContentHints { + /// Text to be indexed for the file to improve fullText queries. This is limited to 128KB in length and may contain HTML elements. + #[serde(rename="indexableText")] + pub indexable_text: Option, + /// A thumbnail for the file. This will only be used if Drive cannot generate a standard thumbnail. + pub thumbnail: Option, +} + +impl NestedType for FileContentHints {} +impl Part for FileContentHints {} + + /// Geographic location information stored in the image. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -975,23 +1079,32 @@ pub struct Permission { /// Whether the permission allows the file to be discovered through search. This is only applicable for permissions of type domain or anyone. #[serde(rename="allowFileDiscovery")] pub allow_file_discovery: Option, + /// Whether the account associated with this permission has been deleted. This field only pertains to user and group permissions. + pub deleted: Option, /// Identifies what kind of resource this is. Value: the fixed string "drive#permission". pub kind: Option, - /// The email address of the user or group to which this permission refers. - #[serde(rename="emailAddress")] - pub email_address: Option, + /// Details of whether the permissions on this Team Drive item are inherited or directly on this item. This is an output-only field which is present only for Team Drive items. + #[serde(rename="teamDrivePermissionDetails")] + pub team_drive_permission_details: Option>, /// A link to the user's profile photo, if available. #[serde(rename="photoLink")] pub photo_link: Option, - /// The role granted by this permission. Valid values are: + /// The email address of the user or group to which this permission refers. + #[serde(rename="emailAddress")] + pub email_address: Option, + /// The time at which this permission will expire (RFC 3339 date-time). Expiration times have the following restrictions: + /// - They can only be set on user and group permissions + /// - The time must be in the future + /// - The time cannot be more than a year in the future + #[serde(rename="expirationTime")] + pub expiration_time: Option, + /// The role granted by this permission. While new values may be supported in the future, the following are currently allowed: + /// - organizer /// - owner /// - writer /// - commenter /// - reader pub role: Option, - /// The time at which this permission will expire (RFC 3339 date-time). - #[serde(rename="expirationTime")] - pub expiration_time: Option, /// The type of the grantee. Valid values are: /// - user /// - group @@ -1008,33 +1121,88 @@ impl Resource for Permission {} impl ResponseResult for Permission {} -/// Capabilities the current user has on the file. +/// Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FileCapabilities { - /// Whether the current user has read access to the Revisions resource of the file. + /// Whether the current user can read the revisions resource of this file. For a Team Drive item, whether revisions of non-folder descendants of this item, or this item itself if it is not a folder, can be read. #[serde(rename="canReadRevisions")] pub can_read_revisions: Option, - /// Whether the user can copy the file. + /// Whether the current user can restore this file from trash. + #[serde(rename="canUntrash")] + pub can_untrash: Option, + /// Whether the current user can copy this file. For a Team Drive item, whether the current user can copy non-folder descendants of this item, or this item itself if it is not a folder. #[serde(rename="canCopy")] pub can_copy: Option, - /// Whether the user can modify the file's permissions and sharing settings. - #[serde(rename="canShare")] - pub can_share: Option, - /// Whether the user can edit the file's content. - #[serde(rename="canEdit")] - pub can_edit: Option, - /// Whether the user can comment on the file. + /// Whether the current user can move this item into a Team Drive. If the item is in a Team Drive, this field is equivalent to canMoveTeamDriveItem. + #[serde(rename="canMoveItemIntoTeamDrive")] + pub can_move_item_into_team_drive: Option, + /// Whether the current user can comment on this file. #[serde(rename="canComment")] pub can_comment: Option, + /// Whether the current user can list the children of this folder. This is always false when the item is not a folder. + #[serde(rename="canListChildren")] + pub can_list_children: Option, + /// Whether the current user can rename this file. + #[serde(rename="canRename")] + pub can_rename: Option, + /// Whether the current user can move this file to trash. + #[serde(rename="canTrash")] + pub can_trash: Option, + /// Whether the current user can delete this file. + #[serde(rename="canDelete")] + pub can_delete: Option, + /// Whether the current user can move this Team Drive item by changing its parent. Note that a request to change the parent for this item may still fail depending on the new parent that is being added. Only populated for Team Drive files. + #[serde(rename="canMoveTeamDriveItem")] + pub can_move_team_drive_item: Option, + /// Whether the current user can add children to this folder. This is always false when the item is not a folder. + #[serde(rename="canAddChildren")] + pub can_add_children: Option, + /// Whether the current user can modify the sharing settings for this file. + #[serde(rename="canShare")] + pub can_share: Option, + /// Whether the current user can download this file. + #[serde(rename="canDownload")] + pub can_download: Option, + /// Whether the current user can change whether viewers can copy the contents of this file. + #[serde(rename="canChangeViewersCanCopyContent")] + pub can_change_viewers_can_copy_content: Option, + /// Whether the current user can remove children from this folder. This is always false when the item is not a folder. + #[serde(rename="canRemoveChildren")] + pub can_remove_children: Option, + /// Whether the current user can read the Team Drive to which this file belongs. Only populated for Team Drive files. + #[serde(rename="canReadTeamDrive")] + pub can_read_team_drive: Option, + /// Whether the current user can edit this file. + #[serde(rename="canEdit")] + pub can_edit: Option, } impl NestedType for FileCapabilities {} impl Part for FileCapabilities {} +/// Additional metadata about video media. This may not be available immediately upon upload. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FileVideoMediaMetadata { + /// The width of the video in pixels. + pub width: Option, + /// The duration of the video in milliseconds. + #[serde(rename="durationMillis")] + pub duration_millis: Option, + /// The height of the video in pixels. + pub height: Option, +} + +impl NestedType for FileVideoMediaMetadata {} +impl Part for FileVideoMediaMetadata {} + + /// The user's storage quota limits and usage. All fields are measured in bytes. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1068,18 +1236,61 @@ impl Part for AboutStorageQuota {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FileList { - /// The page of files. + /// The list of files. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. pub files: Option>, - /// The page token for the next page of files. This will be absent if the end of the files list has been reached. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, + /// Whether the search process was incomplete. If true, then some search results may be missing, since all documents were not searched. This may occur when searching multiple Team Drives with the "user,allTeamDrives" corpora, but all corpora could not be searched. When this happens, it is suggested that clients narrow their query by choosing a different corpus such as "user" or "teamDrive". + #[serde(rename="incompleteSearch")] + pub incomplete_search: Option, /// Identifies what kind of resource this is. Value: the fixed string "drive#fileList". pub kind: Option, + /// The page token for the next page of files. This will be absent if the end of the files list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, } impl ResponseResult for FileList {} +/// Representation of a Team Drive. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 teamdrives](struct.TeamdriveGetCall.html) (response) +/// * [create teamdrives](struct.TeamdriveCreateCall.html) (request|response) +/// * [update teamdrives](struct.TeamdriveUpdateCall.html) (request|response) +/// +#[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, + /// A short-lived link to this Team Drive's background image. + #[serde(rename="backgroundImageLink")] + pub background_image_link: Option, + /// The name of this Team Drive. + pub name: Option, + /// 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, + /// 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 ID of this Team Drive which is also the ID of the top level folder for this Team Drive. + pub id: Option, +} + +impl RequestValue for TeamDrive {} +impl Resource for TeamDrive {} +impl ResponseResult for TeamDrive {} + + /// Information about a Drive user. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1127,7 +1338,7 @@ impl Part for User {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct File { - /// Whether this file has a thumbnail. + /// Whether this file has a thumbnail. This does not indicate whether the requesting app has access to the thumbnail. To check access, look for the presence of the thumbnailLink field. #[serde(rename="hasThumbnail")] pub has_thumbnail: Option, /// The MIME type of the file. @@ -1141,7 +1352,7 @@ pub struct File { /// A short-lived link to the file's thumbnail, if available. Typically lasts on the order of hours. Only populated when the requesting app can access the file's content. #[serde(rename="thumbnailLink")] pub thumbnail_link: Option, - /// The thumbnail version for use in client-contructable thumbnail URLs or thumbnail cache invalidation. + /// The thumbnail version for use in thumbnail cache invalidation. #[serde(rename="thumbnailVersion")] pub thumbnail_version: Option, /// Whether the file has been explicitly trashed, as opposed to recursively trashed from a parent folder. @@ -1150,10 +1361,10 @@ pub struct File { /// Whether the file was created or opened by the requesting app. #[serde(rename="isAppAuthorized")] pub is_app_authorized: Option, - /// Whether users with only writer permission can modify the file's permissions. + /// Whether users with only writer permission can modify the file's permissions. Not populated for Team Drive files. #[serde(rename="writersCanShare")] pub writers_can_share: Option, - /// Whether the user owns the file. + /// Whether the user owns the file. Not populated for Team Drive files. #[serde(rename="ownedByMe")] pub owned_by_me: Option, /// The last time the file was viewed by the user (RFC 3339 date-time). @@ -1180,8 +1391,11 @@ pub struct File { /// Entries with null values are cleared in update and copy requests. #[serde(rename="appProperties")] pub app_properties: Option>, - /// Capabilities the current user has on the file. + /// Capabilities the current user has on this file. Each capability corresponds to a fine-grained action that a user may take. pub capabilities: Option, + /// A collection of arbitrary key-value pairs which are visible to all apps. + /// Entries with null values are cleared in update and copy requests. + pub properties: Option>, /// A link for opening the file in a relevant Google editor or viewer in a browser. #[serde(rename="webViewLink")] pub web_view_link: Option, @@ -1193,7 +1407,7 @@ pub struct File { /// The MD5 checksum for the content of the file. This is only applicable to files with binary content in Drive. #[serde(rename="md5Checksum")] pub md5_checksum: Option, - /// Whether the file has been shared. + /// Whether the file has been shared. Not populated for Team Drive files. pub shared: Option, /// A static, unauthenticated link to the file's icon. #[serde(rename="iconLink")] @@ -1228,24 +1442,30 @@ pub struct File { /// The number of storage quota bytes used by the file. This includes the head revision as well as previous revisions with keepForever enabled. #[serde(rename="quotaBytesUsed")] pub quota_bytes_used: Option, - /// A collection of arbitrary key-value pairs which are visible to all apps. - /// Entries with null values are cleared in update and copy requests. - pub properties: Option>, + /// ID of the Team Drive the file resides in. + #[serde(rename="teamDriveId")] + pub team_drive_id: Option, + /// The time that the item was trashed (RFC 3339 date-time). Only populated for Team Drive files. + #[serde(rename="trashedTime")] + pub trashed_time: Option, /// The time at which the file was shared with the user, if applicable (RFC 3339 date-time). #[serde(rename="sharedWithMeTime")] pub shared_with_me_time: Option, - /// The full list of permissions for the file. This is only available if the requesting user can share the file. + /// The full list of permissions for the file. This is only available if the requesting user can share the file. Not populated for Team Drive files. pub permissions: Option>, /// Whether users with only reader or commenter permission can copy the file's content. This affects copy, download, and print operations. #[serde(rename="viewersCanCopyContent")] pub viewers_can_copy_content: Option, - /// The owners of the file. Currently, only certain legacy files may have more than one owner. + /// The owners of the file. Currently, only certain legacy files may have more than one owner. Not populated for Team Drive files. pub owners: Option>, - /// The name of the file. This is not necessarily unique within a folder. + /// The name of the file. This is not necessarily unique within a folder. Note that for immutable items such as the top level folders of Team Drives, My Drive root folder, and Application Data folder the name is constant. pub name: Option, /// A link for downloading the content of the file in a browser. This is only available for files with binary content in Drive. #[serde(rename="webContentLink")] pub web_content_link: Option, + /// If the file has been explicitly trashed, the user who trashed it. Only populated for Team Drive files. + #[serde(rename="trashingUser")] + pub trashing_user: Option, /// The list of spaces which contain the file. The currently supported values are 'drive', 'appDataFolder' and 'photos'. pub spaces: Option>, /// Whether the file has been trashed, either explicitly or from a trashed parent folder. Only the owner may trash a file, and other users cannot see files in the owner's trash. @@ -1256,6 +1476,9 @@ pub struct File { /// The final component of fullFileExtension. This is only available for files with binary content in Drive. #[serde(rename="fileExtension")] pub file_extension: Option, + /// Whether any users are granted file access directly on this file. This field is only populated for Team Drive files. + #[serde(rename="hasAugmentedPermissions")] + pub has_augmented_permissions: Option, /// Whether the user has starred the file. pub starred: Option, /// The ID of the file's head revision. This is currently only available for files with binary content in Drive. @@ -1279,32 +1502,40 @@ impl ResponseResult for File {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PermissionList { + /// The page token for the next page of permissions. This field will be absent if the end of the permissions list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, /// Identifies what kind of resource this is. Value: the fixed string "drive#permissionList". pub kind: Option, - /// The full list of permissions. + /// The list of permissions. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. pub permissions: Option>, } impl ResponseResult for PermissionList {} -/// Additional metadata about video media. This may not be available immediately upon upload. +/// A list of Team Drives. /// -/// 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 teamdrives](struct.TeamdriveListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FileVideoMediaMetadata { - /// The width of the video in pixels. - pub width: Option, - /// The duration of the video in milliseconds. - #[serde(rename="durationMillis")] - pub duration_millis: Option, - /// The height of the video in pixels. - pub height: Option, +pub struct TeamDriveList { + /// The page token for the next page of Team Drives. This will be absent if the end of the Team Drives list has been reached. If the token is rejected for any reason, it should be discarded, and pagination should be restarted from the first page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "drive#teamDriveList". + pub kind: Option, + /// The list of Team Drives. If nextPageToken is populated, then this list may be incomplete and an additional page of results should be fetched. + #[serde(rename="teamDrives")] + pub team_drives: Option>, } -impl NestedType for FileVideoMediaMetadata {} -impl Part for FileVideoMediaMetadata {} +impl ResponseResult for TeamDriveList {} /// There is no detailed description. @@ -1328,7 +1559,7 @@ pub struct StartPageToken { impl ResponseResult for StartPageToken {} -/// A change to a file. +/// A change to a file or Team Drive. /// /// # Activities /// @@ -1341,17 +1572,26 @@ impl ResponseResult for StartPageToken {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Change { + /// The updated state of the Team Drive. Present if the type is teamDrive, the user is still a member of the Team Drive, and the Team Drive has not been removed. + #[serde(rename="teamDrive")] + pub team_drive: Option, /// Identifies what kind of resource this is. Value: the fixed string "drive#change". pub kind: Option, - /// Whether the file has been removed from the view of the changes list, for example by deletion or lost access. - pub removed: Option, - /// The ID of the file which has changed. - #[serde(rename="fileId")] - pub file_id: Option, - /// The updated state of the file. Present if the file has not been removed. + /// The updated state of the file. Present if the type is file and the file has not been removed from this list of changes. pub file: Option, /// The time of this change (RFC 3339 date-time). pub time: Option, + /// The ID of the Team Drive associated with this change. + #[serde(rename="teamDriveId")] + pub team_drive_id: Option, + /// Whether the file or Team Drive has been removed from this list of changes, for example by deletion or loss of access. + pub removed: Option, + /// The type of the change. Possible values are file and teamDrive. + #[serde(rename="type")] + pub type_: Option, + /// The ID of the file which has changed. + #[serde(rename="fileId")] + pub file_id: Option, } impl Resource for Change {} @@ -1400,6 +1640,27 @@ 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: + /// + /// Subscribes to changes to a file + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `fileId` - The ID of the file. + pub fn watch(&self, request: Channel, file_id: &str) -> FileWatchCall<'a, C, A> { + FileWatchCall { + hub: self.hub, + _request: request, + _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), + _acknowledge_abuse: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a file's metadata and/or content with patch semantics. @@ -1414,6 +1675,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { _request: request, _file_id: file_id.to_string(), _use_content_as_indexable_text: Default::default(), + _supports_team_drives: Default::default(), _remove_parents: Default::default(), _ocr_language: Default::default(), _keep_revision_forever: Default::default(), @@ -1424,48 +1686,6 @@ impl<'a, C, A> FileMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Subscribes to changes to a file - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `fileId` - The ID of the file. - pub fn watch(&self, request: Channel, file_id: &str) -> FileWatchCall<'a, C, A> { - FileWatchCall { - hub: self.hub, - _request: request, - _file_id: file_id.to_string(), - _acknowledge_abuse: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a copy of a file and applies any requested updates with patch semantics. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `fileId` - The ID of the file. - pub fn copy(&self, request: File, file_id: &str) -> FileCopyCall<'a, C, A> { - FileCopyCall { - hub: self.hub, - _request: request, - _file_id: file_id.to_string(), - _ocr_language: Default::default(), - _keep_revision_forever: Default::default(), - _ignore_default_visibility: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Exports a Google Doc to the requested MIME type and returns the exported content. @@ -1485,6 +1705,29 @@ impl<'a, C, A> FileMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Creates a copy of a file and applies any requested updates with patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `fileId` - The ID of the file. + pub fn copy(&self, request: File, file_id: &str) -> FileCopyCall<'a, C, A> { + FileCopyCall { + hub: self.hub, + _request: request, + _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), + _ocr_language: Default::default(), + _keep_revision_forever: Default::default(), + _ignore_default_visibility: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Permanently deletes all of the user's trashed files. @@ -1503,12 +1746,16 @@ impl<'a, C, A> FileMethods<'a, C, A> { pub fn list(&self) -> FileListCall<'a, C, A> { FileListCall { hub: self.hub, + _team_drive_id: Default::default(), + _supports_team_drives: Default::default(), _spaces: Default::default(), _q: Default::default(), _page_token: Default::default(), _page_size: Default::default(), _order_by: Default::default(), + _include_team_drive_items: Default::default(), _corpus: Default::default(), + _corpora: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1541,6 +1788,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { hub: self.hub, _request: request, _use_content_as_indexable_text: Default::default(), + _supports_team_drives: Default::default(), _ocr_language: Default::default(), _keep_revision_forever: Default::default(), _ignore_default_visibility: Default::default(), @@ -1552,7 +1800,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Permanently deletes a file owned by the user without moving it to the trash. If the target is a folder, all descendants owned by the user are also deleted. + /// Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted. /// /// # Arguments /// @@ -1561,6 +1809,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { FileDeleteCall { hub: self.hub, _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1578,6 +1827,7 @@ impl<'a, C, A> FileMethods<'a, C, A> { FileGetCall { hub: self.hub, _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), _acknowledge_abuse: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1588,6 +1838,133 @@ impl<'a, C, A> FileMethods<'a, C, A> { +/// A builder providing access to all methods supported on *teamdrive* resources. +/// It is not used directly, but through the `Drive` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_drive3 as drive3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use drive3::Drive; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Drive::new(hyper::Client::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.teamdrives(); +/// # } +/// ``` +pub struct TeamdriveMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, +} + +impl<'a, C, A> MethodsBuilder for TeamdriveMethods<'a, C, A> {} + +impl<'a, C, A> TeamdriveMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets a Team Drive's metadata by ID. + /// + /// # Arguments + /// + /// * `teamDriveId` - The ID of the Team Drive + pub fn get(&self, team_drive_id: &str) -> TeamdriveGetCall<'a, C, A> { + TeamdriveGetCall { + hub: self.hub, + _team_drive_id: team_drive_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a new Team Drive. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `requestId` - An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned. + pub fn create(&self, request: TeamDrive, request_id: &str) -> TeamdriveCreateCall<'a, C, A> { + TeamdriveCreateCall { + hub: self.hub, + _request: request, + _request_id: request_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the user's Team Drives. + pub fn list(&self) -> TeamdriveListCall<'a, C, A> { + TeamdriveListCall { + hub: self.hub, + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. + /// + /// # Arguments + /// + /// * `teamDriveId` - The ID of the Team Drive + pub fn delete(&self, team_drive_id: &str) -> TeamdriveDeleteCall<'a, C, A> { + TeamdriveDeleteCall { + hub: self.hub, + _team_drive_id: team_drive_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 Team Drive's metadata + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `teamDriveId` - The ID of the Team Drive + pub fn update(&self, request: TeamDrive, team_drive_id: &str) -> TeamdriveUpdateCall<'a, C, A> { + TeamdriveUpdateCall { + hub: self.hub, + _request: request, + _team_drive_id: team_drive_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *about* resources. /// It is not used directly, but through the `Drive` hub. /// @@ -1899,27 +2276,6 @@ impl<'a, C, A> ReplyMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Deletes a reply. - /// - /// # Arguments - /// - /// * `fileId` - The ID of the file. - /// * `commentId` - The ID of the comment. - /// * `replyId` - The ID of the reply. - pub fn delete(&self, file_id: &str, comment_id: &str, reply_id: &str) -> ReplyDeleteCall<'a, C, A> { - ReplyDeleteCall { - hub: self.hub, - _file_id: file_id.to_string(), - _comment_id: comment_id.to_string(), - _reply_id: reply_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Lists a comment's replies. @@ -1964,6 +2320,27 @@ impl<'a, C, A> ReplyMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes a reply. + /// + /// # Arguments + /// + /// * `fileId` - The ID of the file. + /// * `commentId` - The ID of the comment. + /// * `replyId` - The ID of the reply. + pub fn delete(&self, file_id: &str, comment_id: &str, reply_id: &str) -> ReplyDeleteCall<'a, C, A> { + ReplyDeleteCall { + hub: self.hub, + _file_id: file_id.to_string(), + _comment_id: comment_id.to_string(), + _reply_id: reply_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 reply with patch semantics. @@ -2148,12 +2525,39 @@ impl<'a, C, A> MethodsBuilder for ChangeMethods<'a, C, A> {} impl<'a, C, A> ChangeMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Lists the changes for a user or Team Drive. + /// + /// # Arguments + /// + /// * `pageToken` - The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. + pub fn list(&self, page_token: &str) -> ChangeListCall<'a, C, A> { + ChangeListCall { + hub: self.hub, + _page_token: page_token.to_string(), + _team_drive_id: Default::default(), + _supports_team_drives: Default::default(), + _spaces: Default::default(), + _restrict_to_my_drive: Default::default(), + _page_size: Default::default(), + _include_team_drive_items: Default::default(), + _include_removed: Default::default(), + _include_corpus_removals: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets the starting pageToken for listing future changes. pub fn get_start_page_token(&self) -> ChangeGetStartPageTokenCall<'a, C, A> { ChangeGetStartPageTokenCall { hub: self.hub, + _team_drive_id: Default::default(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2173,31 +2577,14 @@ impl<'a, C, A> ChangeMethods<'a, C, A> { hub: self.hub, _request: request, _page_token: page_token.to_string(), + _team_drive_id: Default::default(), + _supports_team_drives: Default::default(), _spaces: Default::default(), _restrict_to_my_drive: Default::default(), _page_size: Default::default(), + _include_team_drive_items: Default::default(), _include_removed: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists changes for a user. - /// - /// # Arguments - /// - /// * `pageToken` - The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. - pub fn list(&self, page_token: &str) -> ChangeListCall<'a, C, A> { - ChangeListCall { - hub: self.hub, - _page_token: page_token.to_string(), - _spaces: Default::default(), - _restrict_to_my_drive: Default::default(), - _page_size: Default::default(), - _include_removed: Default::default(), + _include_corpus_removals: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2251,30 +2638,14 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// /// # Arguments /// - /// * `fileId` - The ID of the file. + /// * `fileId` - The ID of the file or Team Drive. /// * `permissionId` - The ID of the permission. pub fn delete(&self, file_id: &str, permission_id: &str) -> PermissionDeleteCall<'a, C, A> { PermissionDeleteCall { hub: self.hub, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Lists a file's permissions. - /// - /// # Arguments - /// - /// * `fileId` - The ID of the file. - pub fn list(&self, file_id: &str) -> PermissionListCall<'a, C, A> { - PermissionListCall { - hub: self.hub, - _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2288,7 +2659,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `fileId` - The ID of the file. + /// * `fileId` - The ID of the file or Team Drive. /// * `permissionId` - The ID of the permission. pub fn update(&self, request: Permission, file_id: &str, permission_id: &str) -> PermissionUpdateCall<'a, C, A> { PermissionUpdateCall { @@ -2297,6 +2668,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), _transfer_ownership: Default::default(), + _supports_team_drives: Default::default(), _remove_expiration: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2304,6 +2676,26 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists a file's or Team Drive's permissions. + /// + /// # Arguments + /// + /// * `fileId` - The ID of the file or Team Drive. + pub fn list(&self, file_id: &str) -> PermissionListCall<'a, C, A> { + PermissionListCall { + hub: self.hub, + _file_id: file_id.to_string(), + _supports_team_drives: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Gets a permission by ID. @@ -2317,6 +2709,7 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { hub: self.hub, _file_id: file_id.to_string(), _permission_id: permission_id.to_string(), + _supports_team_drives: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2325,18 +2718,19 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a permission for a file. + /// Creates a permission for a file or Team Drive. /// /// # Arguments /// /// * `request` - No description provided. - /// * `fileId` - The ID of the file. + /// * `fileId` - The ID of the file or Team Drive. pub fn create(&self, request: Permission, file_id: &str) -> PermissionCreateCall<'a, C, A> { PermissionCreateCall { hub: self.hub, _request: request, _file_id: file_id.to_string(), _transfer_ownership: Default::default(), + _supports_team_drives: Default::default(), _send_notification_email: Default::default(), _email_message: Default::default(), _delegate: Default::default(), @@ -2354,6 +2748,317 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { // CallBuilders ### // ################# +/// Subscribes to changes to a file +/// +/// 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 `Channel` structure that you would usually get. The latter will be a default value. +/// +/// A builder for the *watch* 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 yup_oauth2 as oauth2; +/// # extern crate google_drive3 as drive3; +/// use drive3::Channel; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive3::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = 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.files().watch(req, "fileId") +/// .supports_team_drives(true) +/// .acknowledge_abuse(false) +/// .doit(); +/// # } +/// ``` +pub struct FileWatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _request: Channel, + _file_id: String, + _supports_team_drives: Option, + _acknowledge_abuse: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FileWatchCall<'a, C, A> {} + +impl<'a, C, A> FileWatchCall<'a, C, 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: "drive.files.watch", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("fileId", self._file_id.to_string())); + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + if let Some(value) = self._acknowledge_abuse { + params.push(("acknowledgeAbuse", value.to_string())); + } + for &field in ["fileId", "supportsTeamDrives", "acknowledgeAbuse"].iter() { + if self._additional_params.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 = "https://www.googleapis.com/drive/v3/files/{fileId}/watch".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{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(1); + for param_name in ["fileId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + 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) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though 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) -> FileWatchCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the 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) -> FileWatchCall<'a, C, A> { + self._file_id = new_value.to_string(); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileWatchCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } + /// Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. + /// + /// Sets the *acknowledge abuse* query property to the given value. + pub fn acknowledge_abuse(mut self, new_value: bool) -> FileWatchCall<'a, C, A> { + self._acknowledge_abuse = 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) -> FileWatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> FileWatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FileWatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Updates a file's metadata and/or content with patch semantics. /// /// A builder for the *update* method supported by a *file* resource. @@ -2389,10 +3094,11 @@ impl<'a, C, A> PermissionMethods<'a, C, A> { /// // Values shown here are possibly random and not representative ! /// let result = hub.files().update(req, "fileId") /// .use_content_as_indexable_text(false) -/// .remove_parents("no") -/// .ocr_language("justo") +/// .supports_team_drives(false) +/// .remove_parents("dolor") +/// .ocr_language("eirmod") /// .keep_revision_forever(true) -/// .add_parents("et") +/// .add_parents("amet") /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -2403,6 +3109,7 @@ pub struct FileUpdateCall<'a, C, A> _request: File, _file_id: String, _use_content_as_indexable_text: Option, + _supports_team_drives: Option, _remove_parents: Option, _ocr_language: Option, _keep_revision_forever: Option, @@ -2429,11 +3136,14 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.update", http_method: hyper::method::Method::Patch }); - 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(("fileId", self._file_id.to_string())); if let Some(value) = self._use_content_as_indexable_text { params.push(("useContentAsIndexableText", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._remove_parents { params.push(("removeParents", value.to_string())); } @@ -2446,7 +3156,7 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._add_parents { params.push(("addParents", value.to_string())); } - for &field in ["alt", "fileId", "useContentAsIndexableText", "removeParents", "ocrLanguage", "keepRevisionForever", "addParents"].iter() { + for &field in ["alt", "fileId", "useContentAsIndexableText", "supportsTeamDrives", "removeParents", "ocrLanguage", "keepRevisionForever", "addParents"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2460,9 +3170,9 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/drive/v3/files/{fileId}", "multipart") + ("https://www.googleapis.com/upload/drive/v3/files/{fileId}".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/drive/v3/files/{fileId}", "resumable") + ("https://www.googleapis.com/resumable/upload/drive/v3/files/{fileId}".to_string(), "resumable") } else { unreachable!() }; @@ -2714,6 +3424,13 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa self._use_content_as_indexable_text = Some(new_value); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileUpdateCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// A comma-separated list of parent IDs to remove. /// /// Sets the *remove parents* query property to the given value. @@ -2794,607 +3511,6 @@ impl<'a, C, A> FileUpdateCall<'a, C, A> where C: BorrowMut, A: oa } -/// Subscribes to changes to a file -/// -/// 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 `Channel` structure that you would usually get. The latter will be a default value. -/// -/// A builder for the *watch* 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 yup_oauth2 as oauth2; -/// # extern crate google_drive3 as drive3; -/// use drive3::Channel; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use drive3::Drive; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Drive::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = 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.files().watch(req, "fileId") -/// .acknowledge_abuse(true) -/// .doit(); -/// # } -/// ``` -pub struct FileWatchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Drive, - _request: Channel, - _file_id: String, - _acknowledge_abuse: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FileWatchCall<'a, C, A> {} - -impl<'a, C, A> FileWatchCall<'a, C, 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: "drive.files.watch", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("fileId", self._file_id.to_string())); - if let Some(value) = self._acknowledge_abuse { - params.push(("acknowledgeAbuse", value.to_string())); - } - for &field in ["fileId", "acknowledgeAbuse"].iter() { - if self._additional_params.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() + "files/{fileId}/watch"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{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(1); - for param_name in ["fileId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - 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) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though 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) -> FileWatchCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the 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) -> FileWatchCall<'a, C, A> { - self._file_id = new_value.to_string(); - self - } - /// Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. - /// - /// Sets the *acknowledge abuse* query property to the given value. - pub fn acknowledge_abuse(mut self, new_value: bool) -> FileWatchCall<'a, C, A> { - self._acknowledge_abuse = 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) -> FileWatchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> FileWatchCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> FileWatchCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Creates a copy of a file and applies any requested updates with patch semantics. -/// -/// A builder for the *copy* 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 yup_oauth2 as oauth2; -/// # extern crate google_drive3 as drive3; -/// use drive3::File; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use drive3::Drive; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Drive::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = File::default(); -/// -/// // You can configure optional parameters by calling 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().copy(req, "fileId") -/// .ocr_language("Lorem") -/// .keep_revision_forever(true) -/// .ignore_default_visibility(false) -/// .doit(); -/// # } -/// ``` -pub struct FileCopyCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Drive, - _request: File, - _file_id: String, - _ocr_language: Option, - _keep_revision_forever: Option, - _ignore_default_visibility: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for FileCopyCall<'a, C, A> {} - -impl<'a, C, A> FileCopyCall<'a, C, 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: "drive.files.copy", - http_method: hyper::method::Method::Post }); - 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._ocr_language { - params.push(("ocrLanguage", value.to_string())); - } - if let Some(value) = self._keep_revision_forever { - params.push(("keepRevisionForever", value.to_string())); - } - if let Some(value) = self._ignore_default_visibility { - params.push(("ignoreDefaultVisibility", value.to_string())); - } - for &field in ["alt", "fileId", "ocrLanguage", "keepRevisionForever", "ignoreDefaultVisibility"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "files/{fileId}/copy"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{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(1); - for param_name in ["fileId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: File) -> FileCopyCall<'a, C, A> { - self._request = new_value; - self - } - /// The ID of the 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) -> FileCopyCall<'a, C, A> { - self._file_id = new_value.to_string(); - self - } - /// A language hint for OCR processing during image import (ISO 639-1 code). - /// - /// Sets the *ocr language* query property to the given value. - pub fn ocr_language(mut self, new_value: &str) -> FileCopyCall<'a, C, A> { - self._ocr_language = Some(new_value.to_string()); - self - } - /// Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. - /// - /// Sets the *keep revision forever* query property to the given value. - pub fn keep_revision_forever(mut self, new_value: bool) -> FileCopyCall<'a, C, A> { - self._keep_revision_forever = Some(new_value); - self - } - /// Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. - /// - /// Sets the *ignore default visibility* query property to the given value. - pub fn ignore_default_visibility(mut self, new_value: bool) -> FileCopyCall<'a, C, A> { - self._ignore_default_visibility = 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) -> FileCopyCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> FileCopyCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> FileCopyCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Exports a Google Doc to the requested MIME type and returns the exported content. /// /// This method supports **media download**. To enable it, adjust the builder like this: @@ -3469,7 +3585,7 @@ impl<'a, C, A> FileExportCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "files/{fileId}/export"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/export".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3634,6 +3750,320 @@ impl<'a, C, A> FileExportCall<'a, C, A> where C: BorrowMut, A: oa } +/// Creates a copy of a file and applies any requested updates with patch semantics. +/// +/// A builder for the *copy* 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 yup_oauth2 as oauth2; +/// # extern crate google_drive3 as drive3; +/// use drive3::File; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive3::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = File::default(); +/// +/// // You can configure optional parameters by calling 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().copy(req, "fileId") +/// .supports_team_drives(true) +/// .ocr_language("invidunt") +/// .keep_revision_forever(false) +/// .ignore_default_visibility(false) +/// .doit(); +/// # } +/// ``` +pub struct FileCopyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _request: File, + _file_id: String, + _supports_team_drives: Option, + _ocr_language: Option, + _keep_revision_forever: Option, + _ignore_default_visibility: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for FileCopyCall<'a, C, A> {} + +impl<'a, C, A> FileCopyCall<'a, C, 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: "drive.files.copy", + http_method: hyper::method::Method::Post }); + 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._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + if let Some(value) = self._ocr_language { + params.push(("ocrLanguage", value.to_string())); + } + if let Some(value) = self._keep_revision_forever { + params.push(("keepRevisionForever", value.to_string())); + } + if let Some(value) = self._ignore_default_visibility { + params.push(("ignoreDefaultVisibility", value.to_string())); + } + for &field in ["alt", "fileId", "supportsTeamDrives", "ocrLanguage", "keepRevisionForever", "ignoreDefaultVisibility"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/copy".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{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(1); + for param_name in ["fileId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: File) -> FileCopyCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the 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) -> FileCopyCall<'a, C, A> { + self._file_id = new_value.to_string(); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileCopyCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } + /// A language hint for OCR processing during image import (ISO 639-1 code). + /// + /// Sets the *ocr language* query property to the given value. + pub fn ocr_language(mut self, new_value: &str) -> FileCopyCall<'a, C, A> { + self._ocr_language = Some(new_value.to_string()); + self + } + /// Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Drive. + /// + /// Sets the *keep revision forever* query property to the given value. + pub fn keep_revision_forever(mut self, new_value: bool) -> FileCopyCall<'a, C, A> { + self._keep_revision_forever = Some(new_value); + self + } + /// Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. + /// + /// Sets the *ignore default visibility* query property to the given value. + pub fn ignore_default_visibility(mut self, new_value: bool) -> FileCopyCall<'a, C, A> { + self._ignore_default_visibility = 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) -> FileCopyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> FileCopyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> FileCopyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Permanently deletes all of the user's trashed files. /// /// A builder for the *emptyTrash* method supported by a *file* resource. @@ -3701,7 +4131,7 @@ impl<'a, C, A> FileEmptyTrashCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "files/trash"; + let mut url = "https://www.googleapis.com/drive/v3/files/trash".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3852,12 +4282,16 @@ impl<'a, C, A> FileEmptyTrashCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().list() -/// .spaces("Lorem") -/// .q("eos") -/// .page_token("erat") -/// .page_size(-95) -/// .order_by("dolor") -/// .corpus("eirmod") +/// .team_drive_id("Lorem") +/// .supports_team_drives(true) +/// .spaces("et") +/// .q("duo") +/// .page_token("et") +/// .page_size(-40) +/// .order_by("sanctus") +/// .include_team_drive_items(true) +/// .corpus("amet") +/// .corpora("et") /// .doit(); /// # } /// ``` @@ -3865,12 +4299,16 @@ pub struct FileListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Drive, + _team_drive_id: Option, + _supports_team_drives: Option, _spaces: Option, _q: Option, _page_token: Option, _page_size: Option, _order_by: Option, + _include_team_drive_items: Option, _corpus: Option, + _corpora: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3892,7 +4330,13 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut }; dlg.begin(MethodInfo { id: "drive.files.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); + if let Some(value) = self._team_drive_id { + params.push(("teamDriveId", value.to_string())); + } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._spaces { params.push(("spaces", value.to_string())); } @@ -3908,10 +4352,16 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut if let Some(value) = self._order_by { params.push(("orderBy", value.to_string())); } + if let Some(value) = self._include_team_drive_items { + params.push(("includeTeamDriveItems", value.to_string())); + } if let Some(value) = self._corpus { params.push(("corpus", value.to_string())); } - for &field in ["alt", "spaces", "q", "pageToken", "pageSize", "orderBy", "corpus"].iter() { + if let Some(value) = self._corpora { + params.push(("corpora", value.to_string())); + } + for &field in ["alt", "teamDriveId", "supportsTeamDrives", "spaces", "q", "pageToken", "pageSize", "orderBy", "includeTeamDriveItems", "corpus", "corpora"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3923,7 +4373,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files"; + let mut url = "https://www.googleapis.com/drive/v3/files".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -4005,6 +4455,20 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut } + /// ID of Team Drive to search. + /// + /// Sets the *team drive id* query property to the given value. + pub fn team_drive_id(mut self, new_value: &str) -> FileListCall<'a, C, A> { + self._team_drive_id = Some(new_value.to_string()); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileListCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. /// /// Sets the *spaces* query property to the given value. @@ -4026,7 +4490,7 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut self._page_token = Some(new_value.to_string()); self } - /// The maximum number of files to return per page. + /// The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> FileListCall<'a, C, A> { @@ -4040,13 +4504,27 @@ impl<'a, C, A> FileListCall<'a, C, A> where C: BorrowMut, A: oaut self._order_by = Some(new_value.to_string()); self } - /// The source of files to list. + /// Whether Team Drive items should be included in results. + /// + /// Sets the *include team drive items* query property to the given value. + pub fn include_team_drive_items(mut self, new_value: bool) -> FileListCall<'a, C, A> { + self._include_team_drive_items = Some(new_value); + self + } + /// The source of files to list. Deprecated: use 'corpora' instead. /// /// Sets the *corpus* query property to the given value. pub fn corpus(mut self, new_value: &str) -> FileListCall<'a, C, A> { self._corpus = Some(new_value.to_string()); self } + /// Comma-separated list of bodies of items (files/documents) to which the query applies. Supported bodies are 'user', 'domain', 'teamDrive' and 'allTeamDrives'. 'allTeamDrives' must be combined with 'user'; all other values must be used in isolation. Prefer 'user' or 'teamDrive' to 'allTeamDrives' for efficiency. + /// + /// Sets the *corpora* query property to the given value. + pub fn corpora(mut self, new_value: &str) -> FileListCall<'a, C, A> { + self._corpora = 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. /// @@ -4126,8 +4604,8 @@ impl<'a, C, A> FileListCall<'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.files().generate_ids() -/// .space("elitr") -/// .count(-97) +/// .space("consetetur") +/// .count(-36) /// .doit(); /// # } /// ``` @@ -4177,7 +4655,7 @@ impl<'a, C, A> FileGenerateIdCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/generateIds"; + let mut url = "https://www.googleapis.com/drive/v3/files/generateIds".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4359,8 +4837,9 @@ impl<'a, C, A> FileGenerateIdCall<'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.files().create(req) -/// .use_content_as_indexable_text(false) -/// .ocr_language("labore") +/// .use_content_as_indexable_text(true) +/// .supports_team_drives(false) +/// .ocr_language("dolor") /// .keep_revision_forever(true) /// .ignore_default_visibility(true) /// .upload_resumable(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); @@ -4372,6 +4851,7 @@ pub struct FileCreateCall<'a, C, A> hub: &'a Drive, _request: File, _use_content_as_indexable_text: Option, + _supports_team_drives: Option, _ocr_language: Option, _keep_revision_forever: Option, _ignore_default_visibility: Option, @@ -4397,10 +4877,13 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.create", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); if let Some(value) = self._use_content_as_indexable_text { params.push(("useContentAsIndexableText", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._ocr_language { params.push(("ocrLanguage", value.to_string())); } @@ -4410,7 +4893,7 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._ignore_default_visibility { params.push(("ignoreDefaultVisibility", value.to_string())); } - for &field in ["alt", "useContentAsIndexableText", "ocrLanguage", "keepRevisionForever", "ignoreDefaultVisibility"].iter() { + for &field in ["alt", "useContentAsIndexableText", "supportsTeamDrives", "ocrLanguage", "keepRevisionForever", "ignoreDefaultVisibility"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4424,9 +4907,9 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/drive/v3/files", "multipart") + ("https://www.googleapis.com/upload/drive/v3/files".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/drive/v3/files", "resumable") + ("https://www.googleapis.com/resumable/upload/drive/v3/files".to_string(), "resumable") } else { unreachable!() }; @@ -4647,6 +5130,13 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa self._use_content_as_indexable_text = Some(new_value); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileCreateCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// A language hint for OCR processing during image import (ISO 639-1 code). /// /// Sets the *ocr language* query property to the given value. @@ -4720,7 +5210,7 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa } -/// Permanently deletes a file owned by the user without moving it to the trash. If the target is a folder, all descendants owned by the user are also deleted. +/// Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a Team Drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted. /// /// A builder for the *delete* method supported by a *file* resource. /// It is not used directly, but through a `FileMethods` instance. @@ -4747,6 +5237,7 @@ impl<'a, C, A> FileCreateCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().delete("fileId") +/// .supports_team_drives(false) /// .doit(); /// # } /// ``` @@ -4755,6 +5246,7 @@ pub struct FileDeleteCall<'a, C, A> hub: &'a Drive, _file_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4776,9 +5268,12 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "drive.files.delete", http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); - for &field in ["fileId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["fileId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4789,7 +5284,7 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "files/{fileId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4892,6 +5387,13 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa self._file_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileDeleteCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -4976,6 +5478,7 @@ impl<'a, C, A> FileDeleteCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.files().get("fileId") +/// .supports_team_drives(true) /// .acknowledge_abuse(false) /// .doit(); /// # } @@ -4985,6 +5488,7 @@ pub struct FileGetCall<'a, C, A> hub: &'a Drive, _file_id: String, + _supports_team_drives: Option, _acknowledge_abuse: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -5007,12 +5511,15 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth }; dlg.begin(MethodInfo { id: "drive.files.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(("fileId", self._file_id.to_string())); + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._acknowledge_abuse { params.push(("acknowledgeAbuse", value.to_string())); } - for &field in ["fileId", "acknowledgeAbuse"].iter() { + for &field in ["fileId", "supportsTeamDrives", "acknowledgeAbuse"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5040,7 +5547,7 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "files/{fileId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -5153,6 +5660,13 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth self._file_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> FileGetCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media. /// /// Sets the *acknowledge abuse* query property to the given value. @@ -5212,6 +5726,1202 @@ impl<'a, C, A> FileGetCall<'a, C, A> where C: BorrowMut, A: oauth } +/// Gets a Team Drive's metadata by ID. +/// +/// A builder for the *get* method supported by a *teamdrive* resource. +/// It is not used directly, but through a `TeamdriveMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive3 as drive3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive3::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.teamdrives().get("teamDriveId") +/// .doit(); +/// # } +/// ``` +pub struct TeamdriveGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _team_drive_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TeamdriveGetCall<'a, C, A> {} + +impl<'a, C, A> TeamdriveGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TeamDrive)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + 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())); + params.push(("teamDriveId", self._team_drive_id.to_string())); + for &field in ["alt", "teamDriveId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v3/teamdrives/{teamDriveId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{teamDriveId}", "teamDriveId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["teamDriveId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 Team Drive + /// + /// Sets the *team drive id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn team_drive_id(mut self, new_value: &str) -> TeamdriveGetCall<'a, C, A> { + self._team_drive_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TeamdriveGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TeamdriveGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TeamdriveGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Creates a new Team Drive. +/// +/// A builder for the *create* method supported by a *teamdrive* resource. +/// It is not used directly, but through a `TeamdriveMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive3 as drive3; +/// use drive3::TeamDrive; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive3::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = TeamDrive::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.teamdrives().create(req, "requestId") +/// .doit(); +/// # } +/// ``` +pub struct TeamdriveCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _request: TeamDrive, + _request_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TeamdriveCreateCall<'a, C, A> {} + +impl<'a, C, A> TeamdriveCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TeamDrive)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "drive.teamdrives.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("requestId", self._request_id.to_string())); + for &field in ["alt", "requestId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v3/teamdrives".to_string(); + 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: TeamDrive) -> TeamdriveCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned. + /// + /// Sets the *request 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 request_id(mut self, new_value: &str) -> TeamdriveCreateCall<'a, C, A> { + self._request_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TeamdriveCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TeamdriveCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TeamdriveCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists the user's Team Drives. +/// +/// A builder for the *list* method supported by a *teamdrive* resource. +/// It is not used directly, but through a `TeamdriveMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive3 as drive3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive3::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.teamdrives().list() +/// .page_token("sit") +/// .page_size(-26) +/// .doit(); +/// # } +/// ``` +pub struct TeamdriveListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TeamdriveListCall<'a, C, A> {} + +impl<'a, C, A> TeamdriveListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TeamDriveList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + 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())); + 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 = "https://www.googleapis.com/drive/v3/teamdrives".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Page token for Team Drives. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> TeamdriveListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of Team Drives to return. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> TeamdriveListCall<'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) -> TeamdriveListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TeamdriveListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TeamdriveListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Permanently deletes a Team Drive for which the user is an organizer. The Team Drive cannot contain any untrashed items. +/// +/// A builder for the *delete* method supported by a *teamdrive* resource. +/// It is not used directly, but through a `TeamdriveMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive3 as drive3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive3::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.teamdrives().delete("teamDriveId") +/// .doit(); +/// # } +/// ``` +pub struct TeamdriveDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _team_drive_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TeamdriveDeleteCall<'a, C, A> {} + +impl<'a, C, A> TeamdriveDeleteCall<'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: "drive.teamdrives.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((2 + self._additional_params.len())); + params.push(("teamDriveId", self._team_drive_id.to_string())); + for &field in ["teamDriveId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = "https://www.googleapis.com/drive/v3/teamdrives/{teamDriveId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{teamDriveId}", "teamDriveId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["teamDriveId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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 Team Drive + /// + /// Sets the *team drive id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn team_drive_id(mut self, new_value: &str) -> TeamdriveDeleteCall<'a, C, A> { + self._team_drive_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TeamdriveDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TeamdriveDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TeamdriveDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a Team Drive's metadata +/// +/// A builder for the *update* method supported by a *teamdrive* resource. +/// It is not used directly, but through a `TeamdriveMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive3 as drive3; +/// use drive3::TeamDrive; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive3::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = TeamDrive::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.teamdrives().update(req, "teamDriveId") +/// .doit(); +/// # } +/// ``` +pub struct TeamdriveUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _request: TeamDrive, + _team_drive_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TeamdriveUpdateCall<'a, C, A> {} + +impl<'a, C, A> TeamdriveUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, TeamDrive)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "drive.teamdrives.update", + http_method: hyper::method::Method::Patch }); + 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 self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v3/teamdrives/{teamDriveId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{teamDriveId}", "teamDriveId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["teamDriveId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: TeamDrive) -> TeamdriveUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the Team Drive + /// + /// Sets the *team drive id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn team_drive_id(mut self, new_value: &str) -> TeamdriveUpdateCall<'a, C, A> { + self._team_drive_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> TeamdriveUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> TeamdriveUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TeamdriveUpdateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Gets information about the user, the user's Drive, and system capabilities. /// /// A builder for the *get* method supported by a *about* resource. @@ -5280,7 +6990,7 @@ impl<'a, C, A> AboutGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "about"; + let mut url = "https://www.googleapis.com/drive/v3/about".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -5485,7 +7195,7 @@ impl<'a, C, A> CommentDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5677,7 +7387,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(true) +/// .include_deleted(false) /// .doit(); /// # } /// ``` @@ -5727,7 +7437,7 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5988,7 +7698,7 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6264,7 +7974,7 @@ impl<'a, C, A> CommentCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6480,9 +8190,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("et") -/// .page_token("consetetur") -/// .page_size(-36) +/// .start_modified_time("Lorem") +/// .page_token("et") +/// .page_size(-13) /// .include_deleted(true) /// .doit(); /// # } @@ -6543,7 +8253,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6810,7 +8520,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "channels/stop"; + let mut url = "https://www.googleapis.com/drive/v3/channels/stop".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7037,7 +8747,7 @@ impl<'a, C, A> ReplyCreateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7236,254 +8946,6 @@ impl<'a, C, A> ReplyCreateCall<'a, C, A> where C: BorrowMut, A: o } -/// Deletes a reply. -/// -/// A builder for the *delete* method supported by a *reply* resource. -/// It is not used directly, but through a `ReplyMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_drive3 as drive3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use drive3::Drive; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Drive::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.replies().delete("fileId", "commentId", "replyId") -/// .doit(); -/// # } -/// ``` -pub struct ReplyDeleteCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Drive, - _file_id: String, - _comment_id: String, - _reply_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ReplyDeleteCall<'a, C, A> {} - -impl<'a, C, A> ReplyDeleteCall<'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: "drive.replies.delete", - http_method: hyper::method::Method::Delete }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("fileId", self._file_id.to_string())); - params.push(("commentId", self._comment_id.to_string())); - params.push(("replyId", self._reply_id.to_string())); - for &field in ["fileId", "commentId", "replyId"].iter() { - if self._additional_params.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() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{fileId}", "fileId"), ("{commentId}", "commentId"), ("{replyId}", "replyId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["replyId", "commentId", "fileId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_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 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) -> ReplyDeleteCall<'a, C, A> { - self._file_id = new_value.to_string(); - self - } - /// The ID of the comment. - /// - /// Sets the *comment id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn comment_id(mut self, new_value: &str) -> ReplyDeleteCall<'a, C, A> { - self._comment_id = new_value.to_string(); - self - } - /// The ID of the reply. - /// - /// Sets the *reply id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn reply_id(mut self, new_value: &str) -> ReplyDeleteCall<'a, C, A> { - self._reply_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReplyDeleteCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ReplyDeleteCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ReplyDeleteCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Lists a comment's replies. /// /// A builder for the *list* method supported by a *reply* resource. @@ -7511,9 +8973,9 @@ impl<'a, C, A> ReplyDeleteCall<'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("voluptua.") -/// .page_size(-56) -/// .include_deleted(true) +/// .page_token("takimata") +/// .page_size(-27) +/// .include_deleted(false) /// .doit(); /// # } /// ``` @@ -7571,7 +9033,7 @@ impl<'a, C, A> ReplyListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7794,7 +9256,7 @@ impl<'a, C, A> ReplyListCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.replies().get("fileId", "commentId", "replyId") -/// .include_deleted(true) +/// .include_deleted(false) /// .doit(); /// # } /// ``` @@ -7846,7 +9308,7 @@ impl<'a, C, A> ReplyGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8038,6 +9500,254 @@ impl<'a, C, A> ReplyGetCall<'a, C, A> where C: BorrowMut, A: oaut } +/// Deletes a reply. +/// +/// A builder for the *delete* method supported by a *reply* resource. +/// It is not used directly, but through a `ReplyMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive3 as drive3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive3::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.replies().delete("fileId", "commentId", "replyId") +/// .doit(); +/// # } +/// ``` +pub struct ReplyDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _file_id: String, + _comment_id: String, + _reply_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ReplyDeleteCall<'a, C, A> {} + +impl<'a, C, A> ReplyDeleteCall<'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: "drive.replies.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("fileId", self._file_id.to_string())); + params.push(("commentId", self._comment_id.to_string())); + params.push(("replyId", self._reply_id.to_string())); + for &field in ["fileId", "commentId", "replyId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{fileId}", "fileId"), ("{commentId}", "commentId"), ("{replyId}", "replyId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["replyId", "commentId", "fileId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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 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) -> ReplyDeleteCall<'a, C, A> { + self._file_id = new_value.to_string(); + self + } + /// The ID of the comment. + /// + /// Sets the *comment id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn comment_id(mut self, new_value: &str) -> ReplyDeleteCall<'a, C, A> { + self._comment_id = new_value.to_string(); + self + } + /// The ID of the reply. + /// + /// Sets the *reply id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn reply_id(mut self, new_value: &str) -> ReplyDeleteCall<'a, C, A> { + self._reply_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ReplyDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ReplyDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ReplyDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Updates a reply with patch semantics. /// /// A builder for the *update* method supported by a *reply* resource. @@ -8119,7 +9829,7 @@ impl<'a, C, A> ReplyUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/comments/{commentId}/replies/{replyId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/comments/{commentId}/replies/{replyId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8407,7 +10117,7 @@ impl<'a, C, A> RevisionUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8704,7 +10414,7 @@ impl<'a, C, A> RevisionGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -8957,7 +10667,7 @@ impl<'a, C, A> RevisionDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions/{revisionId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/revisions/{revisionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9149,8 +10859,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("et") -/// .page_size(-13) +/// .page_token("sea") +/// .page_size(-85) /// .doit(); /// # } /// ``` @@ -9202,7 +10912,7 @@ impl<'a, C, A> RevisionListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/revisions"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/revisions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -9381,9 +11091,9 @@ impl<'a, C, A> RevisionListCall<'a, C, A> where C: BorrowMut, A: } -/// Gets the starting pageToken for listing future changes. +/// Lists the changes for a user or Team Drive. /// -/// A builder for the *getStartPageToken* method supported by a *change* resource. +/// A builder for the *list* method supported by a *change* resource. /// It is not used directly, but through a `ChangeMethods` instance. /// /// # Example @@ -9407,26 +11117,43 @@ impl<'a, C, A> RevisionListCall<'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.changes().get_start_page_token() +/// let result = hub.changes().list("pageToken") +/// .team_drive_id("aliquyam") +/// .supports_team_drives(false) +/// .spaces("sit") +/// .restrict_to_my_drive(true) +/// .page_size(-37) +/// .include_team_drive_items(false) +/// .include_removed(true) +/// .include_corpus_removals(true) /// .doit(); /// # } /// ``` -pub struct ChangeGetStartPageTokenCall<'a, C, A> +pub struct ChangeListCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Drive, + _page_token: String, + _team_drive_id: Option, + _supports_team_drives: Option, + _spaces: Option, + _restrict_to_my_drive: Option, + _page_size: Option, + _include_team_drive_items: Option, + _include_removed: Option, + _include_corpus_removals: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ChangeGetStartPageTokenCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ChangeListCall<'a, C, A> {} -impl<'a, C, A> ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StartPageToken)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, ChangeList)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -9434,10 +11161,35 @@ impl<'a, C, A> ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "drive.changes.getStartPageToken", + dlg.begin(MethodInfo { id: "drive.changes.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() { + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + params.push(("pageToken", self._page_token.to_string())); + if let Some(value) = self._team_drive_id { + params.push(("teamDriveId", value.to_string())); + } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + if let Some(value) = self._spaces { + params.push(("spaces", value.to_string())); + } + if let Some(value) = self._restrict_to_my_drive { + params.push(("restrictToMyDrive", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._include_team_drive_items { + params.push(("includeTeamDriveItems", value.to_string())); + } + if let Some(value) = self._include_removed { + params.push(("includeRemoved", value.to_string())); + } + if let Some(value) = self._include_corpus_removals { + params.push(("includeCorpusRemovals", value.to_string())); + } + for &field in ["alt", "pageToken", "teamDriveId", "supportsTeamDrives", "spaces", "restrictToMyDrive", "pageSize", "includeTeamDriveItems", "includeRemoved", "includeCorpusRemovals"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9449,7 +11201,7 @@ impl<'a, C, A> ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut ChangeListCall<'a, C, A> { + self._page_token = new_value.to_string(); + self + } + /// The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. + /// + /// Sets the *team drive id* query property to the given value. + pub fn team_drive_id(mut self, new_value: &str) -> ChangeListCall<'a, C, A> { + self._team_drive_id = Some(new_value.to_string()); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } + /// A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. + /// + /// Sets the *spaces* query property to the given value. + pub fn spaces(mut self, new_value: &str) -> ChangeListCall<'a, C, A> { + self._spaces = Some(new_value.to_string()); + self + } + /// Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive. + /// + /// Sets the *restrict to my drive* query property to the given value. + pub fn restrict_to_my_drive(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { + self._restrict_to_my_drive = Some(new_value); + self + } + /// The maximum number of changes to return per page. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ChangeListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Whether Team Drive files or changes should be included in results. + /// + /// Sets the *include team drive items* query property to the given value. + pub fn include_team_drive_items(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { + self._include_team_drive_items = Some(new_value); + self + } + /// Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. + /// + /// Sets the *include removed* query property to the given value. + pub fn include_removed(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { + self._include_removed = Some(new_value); + self + } + /// Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + /// + /// Sets the *include corpus removals* query property to the given value. + pub fn include_corpus_removals(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { + self._include_corpus_removals = 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) -> ChangeListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ChangeListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::MetadataReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ChangeListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Gets the starting pageToken for listing future changes. +/// +/// A builder for the *getStartPageToken* method supported by a *change* resource. +/// It is not used directly, but through a `ChangeMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive3 as drive3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive3::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.changes().get_start_page_token() +/// .team_drive_id("accusam") +/// .supports_team_drives(true) +/// .doit(); +/// # } +/// ``` +pub struct ChangeGetStartPageTokenCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _team_drive_id: Option, + _supports_team_drives: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ChangeGetStartPageTokenCall<'a, C, A> {} + +impl<'a, C, A> ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, StartPageToken)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "drive.changes.getStartPageToken", + 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._team_drive_id { + params.push(("teamDriveId", value.to_string())); + } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["alt", "teamDriveId", "supportsTeamDrives"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v3/changes/startPageToken".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::MetadataReadonly.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 ID of the Team Drive for which the starting pageToken for listing future changes from that Team Drive will be returned. + /// + /// Sets the *team drive id* query property to the given value. + pub fn team_drive_id(mut self, new_value: &str) -> ChangeGetStartPageTokenCall<'a, C, A> { + self._team_drive_id = Some(new_value.to_string()); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> ChangeGetStartPageTokenCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -9616,10 +11660,14 @@ impl<'a, C, A> ChangeGetStartPageTokenCall<'a, C, A> where C: BorrowMut hub: &'a Drive, _request: Channel, _page_token: String, + _team_drive_id: Option, + _supports_team_drives: Option, _spaces: Option, _restrict_to_my_drive: Option, _page_size: Option, + _include_team_drive_items: Option, _include_removed: Option, + _include_corpus_removals: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -9654,8 +11706,14 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "drive.changes.watch", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); params.push(("pageToken", self._page_token.to_string())); + if let Some(value) = self._team_drive_id { + params.push(("teamDriveId", value.to_string())); + } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._spaces { params.push(("spaces", value.to_string())); } @@ -9665,10 +11723,16 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o if let Some(value) = self._page_size { params.push(("pageSize", value.to_string())); } + if let Some(value) = self._include_team_drive_items { + params.push(("includeTeamDriveItems", value.to_string())); + } if let Some(value) = self._include_removed { params.push(("includeRemoved", value.to_string())); } - for &field in ["alt", "pageToken", "spaces", "restrictToMyDrive", "pageSize", "includeRemoved"].iter() { + if let Some(value) = self._include_corpus_removals { + params.push(("includeCorpusRemovals", value.to_string())); + } + for &field in ["alt", "pageToken", "teamDriveId", "supportsTeamDrives", "spaces", "restrictToMyDrive", "pageSize", "includeTeamDriveItems", "includeRemoved", "includeCorpusRemovals"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9680,7 +11744,7 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "changes/watch"; + let mut url = "https://www.googleapis.com/drive/v3/changes/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9796,6 +11860,20 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o self._page_token = new_value.to_string(); self } + /// The Team Drive from which changes will be returned. If specified the change IDs will be reflective of the Team Drive; use the combined Team Drive ID and change ID as an identifier. + /// + /// Sets the *team drive id* query property to the given value. + pub fn team_drive_id(mut self, new_value: &str) -> ChangeWatchCall<'a, C, A> { + self._team_drive_id = Some(new_value.to_string()); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> ChangeWatchCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. /// /// Sets the *spaces* query property to the given value. @@ -9817,13 +11895,27 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o self._page_size = Some(new_value); self } - /// Whether to include changes indicating that items have left the view of the changes list, for example by deletion or lost access. + /// Whether Team Drive files or changes should be included in results. + /// + /// Sets the *include team drive items* query property to the given value. + pub fn include_team_drive_items(mut self, new_value: bool) -> ChangeWatchCall<'a, C, A> { + self._include_team_drive_items = Some(new_value); + self + } + /// Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access. /// /// Sets the *include removed* query property to the given value. pub fn include_removed(mut self, new_value: bool) -> ChangeWatchCall<'a, C, A> { self._include_removed = Some(new_value); self } + /// Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file. + /// + /// Sets the *include corpus removals* query property to the given value. + pub fn include_corpus_removals(mut self, new_value: bool) -> ChangeWatchCall<'a, C, A> { + self._include_corpus_removals = 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. /// @@ -9876,268 +11968,6 @@ impl<'a, C, A> ChangeWatchCall<'a, C, A> where C: BorrowMut, A: o } -/// Lists changes for a user. -/// -/// A builder for the *list* method supported by a *change* resource. -/// It is not used directly, but through a `ChangeMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_drive3 as drive3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use drive3::Drive; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Drive::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.changes().list("pageToken") -/// .spaces("At") -/// .restrict_to_my_drive(false) -/// .page_size(-37) -/// .include_removed(false) -/// .doit(); -/// # } -/// ``` -pub struct ChangeListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Drive, - _page_token: String, - _spaces: Option, - _restrict_to_my_drive: Option, - _page_size: Option, - _include_removed: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ChangeListCall<'a, C, A> {} - -impl<'a, C, A> ChangeListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ChangeList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "drive.changes.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); - params.push(("pageToken", self._page_token.to_string())); - if let Some(value) = self._spaces { - params.push(("spaces", value.to_string())); - } - if let Some(value) = self._restrict_to_my_drive { - params.push(("restrictToMyDrive", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._include_removed { - params.push(("includeRemoved", value.to_string())); - } - for &field in ["alt", "pageToken", "spaces", "restrictToMyDrive", "pageSize", "includeRemoved"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "changes"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::MetadataReadonly.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 token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method. - /// - /// Sets the *page token* 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 page_token(mut self, new_value: &str) -> ChangeListCall<'a, C, A> { - self._page_token = new_value.to_string(); - self - } - /// A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'. - /// - /// Sets the *spaces* query property to the given value. - pub fn spaces(mut self, new_value: &str) -> ChangeListCall<'a, C, A> { - self._spaces = Some(new_value.to_string()); - self - } - /// Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive. - /// - /// Sets the *restrict to my drive* query property to the given value. - pub fn restrict_to_my_drive(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { - self._restrict_to_my_drive = Some(new_value); - self - } - /// The maximum number of changes to return per page. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ChangeListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Whether to include changes indicating that items have left the view of the changes list, for example by deletion or lost access. - /// - /// Sets the *include removed* query property to the given value. - pub fn include_removed(mut self, new_value: bool) -> ChangeListCall<'a, C, A> { - self._include_removed = 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) -> ChangeListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ChangeListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::MetadataReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ChangeListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Deletes a permission. /// /// A builder for the *delete* method supported by a *permission* resource. @@ -10165,6 +11995,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.permissions().delete("fileId", "permissionId") +/// .supports_team_drives(true) /// .doit(); /// # } /// ``` @@ -10174,6 +12005,7 @@ pub struct PermissionDeleteCall<'a, C, A> hub: &'a Drive, _file_id: String, _permission_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -10195,10 +12027,13 @@ 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((3 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("fileId", self._file_id.to_string())); params.push(("permissionId", self._permission_id.to_string())); - for &field in ["fileId", "permissionId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["fileId", "permissionId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10209,7 +12044,7 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/permissions/{permissionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10302,7 +12137,7 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, } - /// The ID of the file. + /// The ID of the file or Team Drive. /// /// Sets the *file id* path property to the given value. /// @@ -10322,6 +12157,13 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, self._permission_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionDeleteCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -10374,241 +12216,6 @@ impl<'a, C, A> PermissionDeleteCall<'a, C, A> where C: BorrowMut, } -/// Lists a file's permissions. -/// -/// A builder for the *list* method supported by a *permission* resource. -/// It is not used directly, but through a `PermissionMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_drive3 as drive3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use drive3::Drive; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Drive::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.permissions().list("fileId") -/// .doit(); -/// # } -/// ``` -pub struct PermissionListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Drive, - _file_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for PermissionListCall<'a, C, A> {} - -impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, PermissionList)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "drive.permissions.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - params.push(("fileId", self._file_id.to_string())); - for &field in ["alt", "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())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{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(1); - for param_name in ["fileId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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 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) -> PermissionListCall<'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) -> PermissionListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> PermissionListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::MetadataReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> PermissionListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Updates a permission with patch semantics. /// /// A builder for the *update* method supported by a *permission* resource. @@ -10643,7 +12250,8 @@ impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A /// // Values shown here are possibly random and not representative ! /// let result = hub.permissions().update(req, "fileId", "permissionId") /// .transfer_ownership(false) -/// .remove_expiration(false) +/// .supports_team_drives(true) +/// .remove_expiration(true) /// .doit(); /// # } /// ``` @@ -10655,6 +12263,7 @@ pub struct PermissionUpdateCall<'a, C, A> _file_id: String, _permission_id: String, _transfer_ownership: Option, + _supports_team_drives: Option, _remove_expiration: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -10677,16 +12286,19 @@ 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((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())); params.push(("permissionId", self._permission_id.to_string())); if let Some(value) = self._transfer_ownership { params.push(("transferOwnership", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._remove_expiration { params.push(("removeExpiration", value.to_string())); } - for &field in ["alt", "fileId", "permissionId", "transferOwnership", "removeExpiration"].iter() { + for &field in ["alt", "fileId", "permissionId", "transferOwnership", "supportsTeamDrives", "removeExpiration"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10698,7 +12310,7 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/permissions/{permissionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10825,7 +12437,7 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the file. + /// The ID of the file or Team Drive. /// /// Sets the *file id* path property to the given value. /// @@ -10852,6 +12464,13 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, self._transfer_ownership = Some(new_value); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionUpdateCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Whether to remove the expiration date. /// /// Sets the *remove expiration* query property to the given value. @@ -10911,6 +12530,277 @@ impl<'a, C, A> PermissionUpdateCall<'a, C, A> where C: BorrowMut, } +/// Lists a file's or Team Drive's permissions. +/// +/// A builder for the *list* method supported by a *permission* resource. +/// It is not used directly, but through a `PermissionMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_drive3 as drive3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use drive3::Drive; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Drive::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.permissions().list("fileId") +/// .supports_team_drives(false) +/// .page_token("rebum.") +/// .page_size(-51) +/// .doit(); +/// # } +/// ``` +pub struct PermissionListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Drive, + _file_id: String, + _supports_team_drives: Option, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PermissionListCall<'a, C, A> {} + +impl<'a, C, A> PermissionListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, PermissionList)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + 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())); + params.push(("fileId", self._file_id.to_string())); + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", 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", "fileId", "supportsTeamDrives", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/permissions".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{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(1); + for param_name in ["fileId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 file or Team Drive. + /// + /// 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) -> PermissionListCall<'a, C, A> { + self._file_id = new_value.to_string(); + self + } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionListCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } + /// The token for continuing a previous list request on the next page. This should be set 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) -> PermissionListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maximum number of permissions to return per page. When not set for files in a Team Drive, at most 100 results will be returned. When not set for files that are not in a Team Drive, the entire list will be returned. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> PermissionListCall<'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) -> PermissionListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> PermissionListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::MetadataReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PermissionListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Gets a permission by ID. /// /// A builder for the *get* method supported by a *permission* resource. @@ -10938,6 +12828,7 @@ 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) /// .doit(); /// # } /// ``` @@ -10947,6 +12838,7 @@ pub struct PermissionGetCall<'a, C, A> hub: &'a Drive, _file_id: String, _permission_id: String, + _supports_team_drives: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -10968,10 +12860,13 @@ 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((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())); - for &field in ["alt", "fileId", "permissionId"].iter() { + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } + for &field in ["alt", "fileId", "permissionId", "supportsTeamDrives"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10983,7 +12878,7 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions/{permissionId}"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/permissions/{permissionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::MetadataReadonly.as_ref().to_string(), ()); } @@ -11106,6 +13001,13 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: self._permission_id = new_value.to_string(); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionGetCall<'a, C, A> { + self._supports_team_drives = 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. /// @@ -11158,7 +13060,7 @@ impl<'a, C, A> PermissionGetCall<'a, C, A> where C: BorrowMut, A: } -/// Creates a permission for a file. +/// Creates a permission for a file or Team Drive. /// /// A builder for the *create* method supported by a *permission* resource. /// It is not used directly, but through a `PermissionMethods` instance. @@ -11191,9 +13093,10 @@ 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(true) -/// .send_notification_email(true) -/// .email_message("gubergren") +/// .transfer_ownership(false) +/// .supports_team_drives(true) +/// .send_notification_email(false) +/// .email_message("sit") /// .doit(); /// # } /// ``` @@ -11204,6 +13107,7 @@ pub struct PermissionCreateCall<'a, C, A> _request: Permission, _file_id: String, _transfer_ownership: Option, + _supports_team_drives: Option, _send_notification_email: Option, _email_message: Option, _delegate: Option<&'a mut Delegate>, @@ -11227,18 +13131,21 @@ 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((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._transfer_ownership { params.push(("transferOwnership", value.to_string())); } + if let Some(value) = self._supports_team_drives { + params.push(("supportsTeamDrives", value.to_string())); + } if let Some(value) = self._send_notification_email { params.push(("sendNotificationEmail", value.to_string())); } if let Some(value) = self._email_message { params.push(("emailMessage", value.to_string())); } - for &field in ["alt", "fileId", "transferOwnership", "sendNotificationEmail", "emailMessage"].iter() { + for &field in ["alt", "fileId", "transferOwnership", "supportsTeamDrives", "sendNotificationEmail", "emailMessage"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11250,7 +13157,7 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "files/{fileId}/permissions"; + let mut url = "https://www.googleapis.com/drive/v3/files/{fileId}/permissions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11377,7 +13284,7 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The ID of the file. + /// The ID of the file or Team Drive. /// /// Sets the *file id* path property to the given value. /// @@ -11394,6 +13301,13 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, self._transfer_ownership = Some(new_value); self } + /// Whether the requesting application supports Team Drives. + /// + /// Sets the *supports team drives* query property to the given value. + pub fn supports_team_drives(mut self, new_value: bool) -> PermissionCreateCall<'a, C, A> { + self._supports_team_drives = Some(new_value); + self + } /// Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers. /// /// Sets the *send notification email* query property to the given value. @@ -11460,3 +13374,4 @@ impl<'a, C, A> PermissionCreateCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/firebasedynamiclinks1-cli/Cargo.toml b/gen/firebasedynamiclinks1-cli/Cargo.toml index a18b5b377b..33254cf1cb 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.4+20161118" +version = "1.0.4+20170517" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-firebasedynamiclinks1] path = "../firebasedynamiclinks1" -version = "1.0.4+20161118" +version = "1.0.4+20170517" diff --git a/gen/firebasedynamiclinks1-cli/README.md b/gen/firebasedynamiclinks1-cli/README.md index dce6d245ef..5e4919a681 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 *20161118*. The CLI is at version *1.0.4*. +This documentation was generated from the *Firebase Dynamic Links* API at revision *20170517*. The CLI is at version *1.0.4*. ```bash firebasedynamiclinks1 [options] diff --git a/gen/firebasedynamiclinks1-cli/mkdocs.yml b/gen/firebasedynamiclinks1-cli/mkdocs.yml index 28affa9ef3..9fa5b5da76 100644 --- a/gen/firebasedynamiclinks1-cli/mkdocs.yml +++ b/gen/firebasedynamiclinks1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Firebase Dynamic Links v1.0.4+20161118 +site_name: Firebase Dynamic Links v1.0.4+20170517 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 003d464cfc..ce5978c67e 100644 --- a/gen/firebasedynamiclinks1-cli/src/main.rs +++ b/gen/firebasedynamiclinks1-cli/src/main.rs @@ -69,6 +69,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "dynamic-link-info.navigation-info.enable-forced-redirect" => Some(("dynamicLinkInfo.navigationInfo.enableForcedRedirect", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "dynamic-link-info.analytics-info.google-play-analytics.utm-medium" => Some(("dynamicLinkInfo.analyticsInfo.googlePlayAnalytics.utmMedium", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.analytics-info.google-play-analytics.utm-source" => Some(("dynamicLinkInfo.analyticsInfo.googlePlayAnalytics.utmSource", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dynamic-link-info.analytics-info.google-play-analytics.gclid" => Some(("dynamicLinkInfo.analyticsInfo.googlePlayAnalytics.gclid", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -97,7 +98,7 @@ impl<'n> Engine<'n> { "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", "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", "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", "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 } @@ -296,8 +297,8 @@ fn main() { let mut app = App::new("firebasedynamiclinks1") .author("Sebastian Thiel ") - .version("1.0.4+20161118") - .about("Firebase Dynamic Links API enables third party developers to programmatically create and manage Dynamic Links.") + .version("1.0.4+20170517") + .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") .long("scope") diff --git a/gen/firebasedynamiclinks1/Cargo.toml b/gen/firebasedynamiclinks1/Cargo.toml index d5ff63af3a..64766e3258 100644 --- a/gen/firebasedynamiclinks1/Cargo.toml +++ b/gen/firebasedynamiclinks1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-firebasedynamiclinks1" -version = "1.0.4+20161118" +version = "1.0.4+20170517" 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.4+20161118" +documentation = "https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517" license = "MIT" keywords = ["firebasedynamiclinks", "google", "protocol", "web", "api"] diff --git a/gen/firebasedynamiclinks1/README.md b/gen/firebasedynamiclinks1/README.md index 8179395686..798b063f30 100644 --- a/gen/firebasedynamiclinks1/README.md +++ b/gen/firebasedynamiclinks1/README.md @@ -5,16 +5,16 @@ 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.4+20161118*, where *20161118* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Firebase Dynamic Links* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161118/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html) ... * short links - * [*create*](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20161118/google_firebasedynamiclinks1/struct.ShortLinkCreateCall.html) + * [*create*](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/google_firebasedynamiclinks1/struct.ShortLinkCreateCall.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-firebasedynamiclinks1/1.0.4+20161118/google_firebasedynamiclinks1/struct.FirebaseDynamicLinks.html)** +* **[Hub](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/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.4+20161118/google_firebasedynamiclinks1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20161118/google_firebasedynamiclinks1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20161118/google_firebasedynamiclinks1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/google_firebasedynamiclinks1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/google_firebasedynamiclinks1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/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.4+20161118/google_firebasedynamiclinks1/trait.Part.html)** + * **[Parts](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/google_firebasedynamiclinks1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20161118/google_firebasedynamiclinks1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/google_firebasedynamiclinks1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -121,17 +121,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20161118/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.4+20170517/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.4+20161118/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.4+20170517/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.4+20161118/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.4+20170517/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.4+20161118/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.4+20170517/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")`. @@ -141,29 +141,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20161118/google_firebasedynamiclinks1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20161118/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.4+20170517/google_firebasedynamiclinks1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/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.4+20161118/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.4+20170517/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.4+20161118/google_firebasedynamiclinks1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20161118/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.4+20170517/google_firebasedynamiclinks1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/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.4+20161118/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.4+20170517/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.4+20161118/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.4+20170517/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.4+20161118/google_firebasedynamiclinks1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-firebasedynamiclinks1/1.0.4+20170517/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 74c153613d..1e2ac15cd1 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.4+20161118*, where *20161118* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Firebase Dynamic Links* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *firebasedynamiclinks:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Firebase Dynamic Links* *v1* API can be found at the //! [official documentation site](https://firebase.google.com/docs/dynamic-links/). @@ -176,7 +176,7 @@ // 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 +// 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)] @@ -307,8 +307,6 @@ pub struct FirebaseDynamicLinks { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for FirebaseDynamicLinks {} @@ -321,8 +319,6 @@ impl<'a, C, A> FirebaseDynamicLinks client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://firebasedynamiclinks.googleapis.com/".to_string(), - _root_url: "https://firebasedynamiclinks.googleapis.com/".to_string(), } } @@ -339,32 +335,27 @@ impl<'a, C, A> FirebaseDynamicLinks self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://firebasedynamiclinks.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://firebasedynamiclinks.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## +/// Information of navigation 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 NavigationInfo { + /// If this option is on, FDL click will be forced to redirect rather than + /// show an interstitial page. + #[serde(rename="enableForcedRedirect")] + pub enable_forced_redirect: Option, +} + +impl Part for NavigationInfo {} + + /// Tracking parameters supported by Dynamic Link. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -577,23 +568,26 @@ impl Part for GooglePlayAnalytics {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct DynamicLinkInfo { + /// Information of navigation behavior of a Firebase Dynamic Links. + #[serde(rename="navigationInfo")] + pub navigation_info: Option, /// Parameters used for tracking. See all tracking parameters in the - /// [documentation](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically). + /// [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/android#create-a-dynamic-link-programmatically). + /// [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/ios#create-a-dynamic-link-programmatically). + /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). #[serde(rename="iosInfo")] pub ios_info: Option, /// Android related information. See Android related parameters in the - /// [documentation](https://firebase.google.com/docs/dynamic-links/android#create-a-dynamic-link-programmatically). + /// [documentation](https://firebase.google.com/docs/dynamic-links/create-manually). #[serde(rename="androidInfo")] pub android_info: Option, /// Parameters for social meta tag params. @@ -601,7 +595,7 @@ pub struct DynamicLinkInfo { #[serde(rename="socialMetaTagInfo")] pub social_meta_tag_info: Option, /// Dynamic Links domain that the project owns, e.g. abcd.app.goo.gl - /// [Learn more](https://firebase.google.com/docs/dynamic-links/android#set-up-firebase-and-the-dynamic-links-sdk) + /// [Learn more](https://firebase.google.com/docs/dynamic-links/android/receive) /// on how to set up Dynamic Link domain associated with your Firebase project. /// /// Required. @@ -623,14 +617,14 @@ impl Part for DynamicLinkInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateShortDynamicLinkResponse { - /// Preivew link to show the link flow chart. - #[serde(rename="previewLink")] - pub preview_link: Option, - /// Information about potential warnings on link creation. - pub warning: Option>, /// Short Dynamic Link value. e.g. https://abcd.app.goo.gl/wxyz #[serde(rename="shortLink")] pub short_link: Option, + /// Information about potential warnings on link creation. + pub warning: Option>, + /// Preivew link to show the link flow chart. + #[serde(rename="previewLink")] + pub preview_link: Option, } impl ResponseResult for CreateShortDynamicLinkResponse {} @@ -796,7 +790,7 @@ impl<'a, C, A> ShortLinkCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/shortLinks"; + let mut url = "https://firebasedynamiclinks.googleapis.com/v1/shortLinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Firebase.as_ref().to_string(), ()); } @@ -960,3 +954,4 @@ impl<'a, C, A> ShortLinkCreateCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/fitness1-cli/Cargo.toml b/gen/fitness1-cli/Cargo.toml index 45a20309d0..43264c5aa0 100644 --- a/gen/fitness1-cli/Cargo.toml +++ b/gen/fitness1-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/fitness1/src/lib.rs b/gen/fitness1/src/lib.rs index 167de51b0c..712f79cc97 100644 --- a/gen/fitness1/src/lib.rs +++ b/gen/fitness1/src/lib.rs @@ -180,7 +180,7 @@ // 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 +// 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)] @@ -379,8 +379,6 @@ pub struct Fitness { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Fitness {} @@ -393,8 +391,6 @@ impl<'a, C, A> Fitness client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/fitness/v1/users/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -411,26 +407,6 @@ impl<'a, C, A> Fitness self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/fitness/v1/users/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1363,7 +1339,7 @@ impl<'a, C, A> UserDatasetAggregateCall<'a, C, A> where C: BorrowMut UserDataSourceDeleteCall<'a, C, A> where C: BorrowMut UserDataSourceDatasetGetCall<'a, C, A> where C: BorrowMut UserDataSourceCreateCall<'a, C, A> where C: BorrowMut UserDataSourceDatasetDeleteCall<'a, C, A> where C: BorrowMut UserDataSourceDatasetPatchCall<'a, C, A> where C: BorrowMut UserSessionDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "{userId}/sessions/{sessionId}"; + let mut url = "https://www.googleapis.com/fitness/v1/users/{userId}/sessions/{sessionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ActivityWrite.as_ref().to_string(), ()); } @@ -3242,7 +3218,7 @@ impl<'a, C, A> UserDataSourceGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/dataSources/{dataSourceId}"; + let mut url = "https://www.googleapis.com/fitness/v1/users/{userId}/dataSources/{dataSourceId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ActivityRead.as_ref().to_string(), ()); } @@ -3498,7 +3474,7 @@ impl<'a, C, A> UserDataSourceUpdateCall<'a, C, A> where C: BorrowMut UserSessionListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/sessions"; + let mut url = "https://www.googleapis.com/fitness/v1/users/{userId}/sessions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ActivityRead.as_ref().to_string(), ()); } @@ -4064,7 +4040,7 @@ impl<'a, C, A> UserSessionUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/sessions/{sessionId}"; + let mut url = "https://www.googleapis.com/fitness/v1/users/{userId}/sessions/{sessionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ActivityWrite.as_ref().to_string(), ()); } @@ -4351,7 +4327,7 @@ impl<'a, C, A> UserDataSourcePatchCall<'a, C, A> where C: BorrowMut UserDataSourceListCall<'a, C, A> where C: BorrowMut UserDataSourceListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with fusiontables (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/fusiontables2-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-fusiontables2] path = "../fusiontables2" -version = "1.0.4+20160526" +version = "1.0.4+20170413" diff --git a/gen/fusiontables2-cli/README.md b/gen/fusiontables2-cli/README.md index 632dcc9c60..d4f98627f4 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 *20160526*. The CLI is at version *1.0.4*. +This documentation was generated from the *fusiontables* API at revision *20170413*. The CLI is at version *1.0.4*. ```bash fusiontables2 [options] diff --git a/gen/fusiontables2-cli/mkdocs.yml b/gen/fusiontables2-cli/mkdocs.yml index 14a631afab..09da7c1222 100644 --- a/gen/fusiontables2-cli/mkdocs.yml +++ b/gen/fusiontables2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: fusiontables v1.0.4+20160526 +site_name: fusiontables v1.0.4+20170413 site_url: http://byron.github.io/google-apis-rs/google-fusiontables2-cli site_description: A complete library to interact with fusiontables (protocol v2) diff --git a/gen/fusiontables2-cli/src/main.rs b/gen/fusiontables2-cli/src/main.rs index 885f6c1370..a455977374 100644 --- a/gen/fusiontables2-cli/src/main.rs +++ b/gen/fusiontables2-cli/src/main.rs @@ -3586,7 +3586,7 @@ fn main() { let mut app = App::new("fusiontables2") .author("Sebastian Thiel ") - .version("1.0.4+20160526") + .version("1.0.4+20170413") .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 74dd034f3b..d38b1a1319 100644 --- a/gen/fusiontables2/Cargo.toml +++ b/gen/fusiontables2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-fusiontables2" -version = "1.0.4+20160526" +version = "1.0.4+20170413" 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.4+20160526" +documentation = "https://docs.rs/google-fusiontables2/1.0.4+20170413" license = "MIT" keywords = ["fusiontables", "google", "protocol", "web", "api"] diff --git a/gen/fusiontables2/README.md b/gen/fusiontables2/README.md index 64753f76cd..9f9f3fb3de 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.4+20160526*, where *20160526* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *fusiontables* crate version *1.0.4+20170413*, where *20170413* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20160526/google_fusiontables2/struct.Fusiontables.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.Fusiontables.html) ... -* [column](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.Column.html) - * [*delete*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.ColumnDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.ColumnGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.ColumnInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.ColumnListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.ColumnPatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.ColumnUpdateCall.html) +* [column](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.Column.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.ColumnDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.ColumnGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.ColumnInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.ColumnListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.ColumnPatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.ColumnUpdateCall.html) * query - * [*sql*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.QuerySqlCall.html) and [*sql get*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.QuerySqlGetCall.html) + * [*sql*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.QuerySqlCall.html) and [*sql get*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.QuerySqlGetCall.html) * style - * [*delete*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.StyleDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.StyleGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.StyleInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.StyleListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.StylePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.StyleUpdateCall.html) -* [table](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.Table.html) - * [*copy*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableCopyCall.html), [*delete*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableGetCall.html), [*import rows*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableImportRowCall.html), [*import table*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableImportTableCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TablePatchCall.html), [*replace rows*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableReplaceRowCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableUpdateCall.html) -* [task](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.Task.html) - * [*delete*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TaskDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TaskGetCall.html) and [*list*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TaskListCall.html) -* [template](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.Template.html) - * [*delete*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TemplateDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TemplateGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TemplateInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TemplateListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TemplatePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TemplateUpdateCall.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.StyleDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.StyleGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.StyleInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.StyleListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.StylePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.StyleUpdateCall.html) +* [table](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.Table.html) + * [*copy*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableCopyCall.html), [*delete*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableGetCall.html), [*import rows*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableImportRowCall.html), [*import table*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableImportTableCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TablePatchCall.html), [*replace rows*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableReplaceRowCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableUpdateCall.html) +* [task](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.Task.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TaskDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TaskGetCall.html) and [*list*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TaskListCall.html) +* [template](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.Template.html) + * [*delete*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TemplateDeleteCall.html), [*get*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TemplateGetCall.html), [*insert*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TemplateInsertCall.html), [*list*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TemplateListCall.html), [*patch*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TemplatePatchCall.html) and [*update*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TemplateUpdateCall.html) Upload supported by ... -* [*replace rows table*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableReplaceRowCall.html) -* [*import rows table*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableImportRowCall.html) -* [*import table table*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.TableImportTableCall.html) +* [*replace rows table*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableReplaceRowCall.html) +* [*import rows table*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableImportRowCall.html) +* [*import table table*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.TableImportTableCall.html) Download supported by ... -* [*sql get query*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.QuerySqlGetCall.html) -* [*sql query*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/struct.QuerySqlCall.html) +* [*sql get query*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/struct.QuerySqlGetCall.html) +* [*sql query*](https://docs.rs/google-fusiontables2/1.0.4+20170413/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.4+20160526/google_fusiontables2/struct.Fusiontables.html)** +* **[Hub](https://docs.rs/google-fusiontables2/1.0.4+20170413/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.4+20160526/google_fusiontables2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-fusiontables2/1.0.4+20170413/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.4+20160526/google_fusiontables2/trait.Part.html)** + * **[Parts](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-fusiontables2/1.0.4+20160526/google_fusiontables2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-fusiontables2/1.0.4+20170413/google_fusiontables2/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-fusiontables2/1.0.4+20160526/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.4+20170413/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.4+20160526/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.4+20170413/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.4+20160526/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.4+20170413/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.4+20160526/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.4+20170413/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")`. @@ -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-fusiontables2/1.0.4+20160526/google_fusiontables2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-fusiontables2/1.0.4+20160526/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.4+20170413/google_fusiontables2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-fusiontables2/1.0.4+20170413/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.4+20160526/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.4+20170413/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.4+20160526/google_fusiontables2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-fusiontables2/1.0.4+20160526/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.4+20170413/google_fusiontables2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-fusiontables2/1.0.4+20170413/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.4+20160526/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.4+20170413/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.4+20160526/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.4+20170413/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.4+20160526/google_fusiontables2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-fusiontables2/1.0.4+20170413/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 f07c038f34..6248066f88 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.4+20160526*, where *20160526* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *fusiontables* crate version *1.0.4+20170413*, where *20170413* is the exact revision of the *fusiontables:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *fusiontables* *v2* API can be found at the //! [official documentation site](https://developers.google.com/fusiontables). @@ -199,7 +199,7 @@ // 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 +// 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)] @@ -331,8 +331,6 @@ pub struct Fusiontables { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Fusiontables {} @@ -345,8 +343,6 @@ impl<'a, C, A> Fusiontables client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/fusiontables/v2/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -378,26 +374,6 @@ impl<'a, C, A> Fusiontables self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/fusiontables/v2/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1955,7 +1931,7 @@ impl<'a, C, A> StyleListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2213,7 +2189,7 @@ impl<'a, C, A> StyleUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles/{styleId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles/{styleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2489,7 +2465,7 @@ impl<'a, C, A> StyleInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2750,7 +2726,7 @@ impl<'a, C, A> StyleGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles/{styleId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles/{styleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2996,7 +2972,7 @@ impl<'a, C, A> StyleDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles/{styleId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles/{styleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3240,7 +3216,7 @@ impl<'a, C, A> StylePatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/styles/{styleId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/styles/{styleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3524,7 +3500,7 @@ impl<'a, C, A> TaskListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/tasks"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/tasks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3781,7 +3757,7 @@ impl<'a, C, A> TaskDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "tables/{tableId}/tasks/{taskId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/tasks/{taskId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4018,7 +3994,7 @@ impl<'a, C, A> TaskGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/tasks/{taskId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/tasks/{taskId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4270,7 +4246,7 @@ impl<'a, C, A> ColumnInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4538,7 +4514,7 @@ impl<'a, C, A> ColumnUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns/{columnId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns/{columnId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4817,7 +4793,7 @@ impl<'a, C, A> ColumnListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5075,7 +5051,7 @@ impl<'a, C, A> ColumnPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns/{columnId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns/{columnId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5345,7 +5321,7 @@ impl<'a, C, A> ColumnDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns/{columnId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns/{columnId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5582,7 +5558,7 @@ impl<'a, C, A> ColumnGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/columns/{columnId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/columns/{columnId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5836,7 +5812,7 @@ impl<'a, C, A> TemplateUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates/{templateId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates/{templateId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6115,7 +6091,7 @@ impl<'a, C, A> TemplateListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6365,7 +6341,7 @@ impl<'a, C, A> TemplateDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates/{templateId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates/{templateId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6607,7 +6583,7 @@ impl<'a, C, A> TemplateInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6875,7 +6851,7 @@ impl<'a, C, A> TemplatePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates/{templateId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates/{templateId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7146,7 +7122,7 @@ impl<'a, C, A> TemplateGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/templates/{templateId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/templates/{templateId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7425,7 +7401,7 @@ impl<'a, C, A> QuerySqlGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "query"; + let mut url = "https://www.googleapis.com/fusiontables/v2/query".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7694,7 +7670,7 @@ impl<'a, C, A> QuerySqlCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "query"; + let mut url = "https://www.googleapis.com/fusiontables/v2/query".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7941,7 +7917,7 @@ impl<'a, C, A> TablePatchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8236,9 +8212,9 @@ impl<'a, C, A> TableReplaceRowCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/fusiontables/v2/tables/{tableId}/replace", "multipart") + ("https://www.googleapis.com/upload/fusiontables/v2/tables/{tableId}/replace".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/fusiontables/v2/tables/{tableId}/replace", "resumable") + ("https://www.googleapis.com/resumable/upload/fusiontables/v2/tables/{tableId}/replace".to_string(), "resumable") } else { unreachable!() }; @@ -8623,7 +8599,7 @@ impl<'a, C, A> TableUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8888,7 +8864,7 @@ impl<'a, C, A> TableDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "tables/{tableId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9118,7 +9094,7 @@ impl<'a, C, A> TableInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9346,7 +9322,7 @@ impl<'a, C, A> TableGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9589,7 +9565,7 @@ impl<'a, C, A> TableListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9836,9 +9812,9 @@ impl<'a, C, A> TableImportRowCall<'a, C, A> where C: BorrowMut, A let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/fusiontables/v2/tables/{tableId}/import", "multipart") + ("https://www.googleapis.com/upload/fusiontables/v2/tables/{tableId}/import".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/fusiontables/v2/tables/{tableId}/import", "resumable") + ("https://www.googleapis.com/resumable/upload/fusiontables/v2/tables/{tableId}/import".to_string(), "resumable") } else { unreachable!() }; @@ -10225,9 +10201,9 @@ impl<'a, C, A> TableImportTableCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/fusiontables/v2/tables/import", "multipart") + ("https://www.googleapis.com/upload/fusiontables/v2/tables/import".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/fusiontables/v2/tables/import", "resumable") + ("https://www.googleapis.com/resumable/upload/fusiontables/v2/tables/import".to_string(), "resumable") } else { unreachable!() }; @@ -10563,7 +10539,7 @@ impl<'a, C, A> TableCopyCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "tables/{tableId}/copy"; + let mut url = "https://www.googleapis.com/fusiontables/v2/tables/{tableId}/copy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10735,3 +10711,4 @@ impl<'a, C, A> TableCopyCall<'a, C, A> where C: BorrowMut, A: oau } + diff --git a/gen/games1-cli/Cargo.toml b/gen/games1-cli/Cargo.toml index 8adb6956a5..2f5b0d72f0 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.4+20161207" +version = "1.0.4+20170511" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-games1] path = "../games1" -version = "1.0.4+20161207" +version = "1.0.4+20170511" diff --git a/gen/games1-cli/README.md b/gen/games1-cli/README.md index a76283c67f..0ca224bc66 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 *20161207*. The CLI is at version *1.0.4*. +This documentation was generated from the *Games* API at revision *20170511*. The CLI is at version *1.0.4*. ```bash games1 [options] diff --git a/gen/games1-cli/mkdocs.yml b/gen/games1-cli/mkdocs.yml index 55de514eee..3f4927e742 100644 --- a/gen/games1-cli/mkdocs.yml +++ b/gen/games1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Games v1.0.4+20161207 +site_name: Games v1.0.4+20170511 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 5441bc45fe..f0aaf00e8b 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.4+20161207") + .version("1.0.4+20170511") .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 ba83b687bd..0923351d8d 100644 --- a/gen/games1/Cargo.toml +++ b/gen/games1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-games1" -version = "1.0.4+20161207" +version = "1.0.4+20170511" 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.4+20161207" +documentation = "https://docs.rs/google-games1/1.0.4+20170511" license = "MIT" keywords = ["games", "google", "protocol", "web", "api"] diff --git a/gen/games1/README.md b/gen/games1/README.md index 73a741e516..0335386dca 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.4+20161207*, where *20161207* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Games* crate version *1.0.4+20170511*, where *20170511* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161207/google_games1/struct.Games.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.Games.html) ... -* [achievement definitions](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.AchievementDefinition.html) - * [*list*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.AchievementDefinitionListCall.html) +* [achievement definitions](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.AchievementDefinition.html) + * [*list*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.AchievementDefinitionListCall.html) * achievements - * [*increment*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.AchievementIncrementCall.html), [*list*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.AchievementListCall.html), [*reveal*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.AchievementRevealCall.html), [*set steps at least*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.AchievementSetStepsAtLeastCall.html), [*unlock*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.AchievementUnlockCall.html) and [*update multiple*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.AchievementUpdateMultipleCall.html) -* [applications](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.Application.html) - * [*get*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.ApplicationGetCall.html), [*played*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.ApplicationPlayedCall.html) and [*verify*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.ApplicationVerifyCall.html) + * [*increment*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.AchievementIncrementCall.html), [*list*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.AchievementListCall.html), [*reveal*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.AchievementRevealCall.html), [*set steps at least*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.AchievementSetStepsAtLeastCall.html), [*unlock*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.AchievementUnlockCall.html) and [*update multiple*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.AchievementUpdateMultipleCall.html) +* [applications](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.Application.html) + * [*get*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.ApplicationGetCall.html), [*played*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.ApplicationPlayedCall.html) and [*verify*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.ApplicationVerifyCall.html) * events - * [*list by player*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.EventListByPlayerCall.html), [*list definitions*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.EventListDefinitionCall.html) and [*record*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.EventRecordCall.html) -* [leaderboards](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.Leaderboard.html) - * [*get*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.LeaderboardGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.LeaderboardListCall.html) + * [*list by player*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.EventListByPlayerCall.html), [*list definitions*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.EventListDefinitionCall.html) and [*record*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.EventRecordCall.html) +* [leaderboards](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.Leaderboard.html) + * [*get*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.LeaderboardGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.LeaderboardListCall.html) * metagame - * [*get metagame config*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.MetagameGetMetagameConfigCall.html) and [*list categories by player*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.MetagameListCategoriesByPlayerCall.html) -* [players](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.Player.html) - * [*get*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.PlayerGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.PlayerListCall.html) + * [*get metagame config*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.MetagameGetMetagameConfigCall.html) and [*list categories by player*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.MetagameListCategoriesByPlayerCall.html) +* [players](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.Player.html) + * [*get*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.PlayerGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.PlayerListCall.html) * pushtokens - * [*remove*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.PushtokenRemoveCall.html) and [*update*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.PushtokenUpdateCall.html) -* [quest milestones](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.QuestMilestone.html) - * [*claim*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.QuestMilestoneClaimCall.html) -* [quests](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.Quest.html) - * [*accept*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.QuestAcceptCall.html) and [*list*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.QuestListCall.html) + * [*remove*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.PushtokenRemoveCall.html) and [*update*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.PushtokenUpdateCall.html) +* [quest milestones](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.QuestMilestone.html) + * [*claim*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.QuestMilestoneClaimCall.html) +* [quests](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.Quest.html) + * [*accept*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.QuestAcceptCall.html) and [*list*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.QuestListCall.html) * revisions - * [*check*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.RevisionCheckCall.html) -* [rooms](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.Room.html) - * [*create*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.RoomCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.RoomDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.RoomDismisCall.html), [*get*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.RoomGetCall.html), [*join*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.RoomJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.RoomLeaveCall.html), [*list*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.RoomListCall.html) and [*report status*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.RoomReportStatuCall.html) + * [*check*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.RevisionCheckCall.html) +* [rooms](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.Room.html) + * [*create*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.RoomCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.RoomDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.RoomDismisCall.html), [*get*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.RoomGetCall.html), [*join*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.RoomJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.RoomLeaveCall.html), [*list*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.RoomListCall.html) and [*report status*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.RoomReportStatuCall.html) * scores - * [*get*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.ScoreGetCall.html), [*list*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.ScoreListCall.html), [*list window*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.ScoreListWindowCall.html), [*submit*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.ScoreSubmitCall.html) and [*submit multiple*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.ScoreSubmitMultipleCall.html) -* [snapshots](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.Snapshot.html) - * [*get*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.SnapshotGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.SnapshotListCall.html) + * [*get*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.ScoreGetCall.html), [*list*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.ScoreListCall.html), [*list window*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.ScoreListWindowCall.html), [*submit*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.ScoreSubmitCall.html) and [*submit multiple*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.ScoreSubmitMultipleCall.html) +* [snapshots](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.Snapshot.html) + * [*get*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.SnapshotGetCall.html) and [*list*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.SnapshotListCall.html) * turn based matches - * [*cancel*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheCancelCall.html), [*create*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheDismisCall.html), [*finish*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheFinishCall.html), [*get*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheGetCall.html), [*join*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheLeaveCall.html), [*leave turn*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheLeaveTurnCall.html), [*list*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheListCall.html), [*rematch*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheRematchCall.html), [*sync*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheSyncCall.html) and [*take turn*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/struct.TurnBasedMatcheTakeTurnCall.html) + * [*cancel*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheCancelCall.html), [*create*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheCreateCall.html), [*decline*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheDeclineCall.html), [*dismiss*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheDismisCall.html), [*finish*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheFinishCall.html), [*get*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheGetCall.html), [*join*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheJoinCall.html), [*leave*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheLeaveCall.html), [*leave turn*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheLeaveTurnCall.html), [*list*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheListCall.html), [*rematch*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheRematchCall.html), [*sync*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/struct.TurnBasedMatcheSyncCall.html) and [*take turn*](https://docs.rs/google-games1/1.0.4+20170511/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.4+20161207/google_games1/struct.Games.html)** +* **[Hub](https://docs.rs/google-games1/1.0.4+20170511/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.4+20161207/google_games1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-games1/1.0.4+20161207/google_games1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-games1/1.0.4+20161207/google_games1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-games1/1.0.4+20170511/google_games1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-games1/1.0.4+20170511/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.4+20161207/google_games1/trait.Part.html)** + * **[Parts](https://docs.rs/google-games1/1.0.4+20170511/google_games1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-games1/1.0.4+20161207/google_games1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-games1/1.0.4+20170511/google_games1/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-games1/1.0.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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")`. @@ -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-games1/1.0.4+20161207/google_games1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-games1/1.0.4+20161207/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.4+20170511/google_games1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-games1/1.0.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/google_games1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-games1/1.0.4+20161207/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.4+20170511/google_games1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-games1/1.0.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/google_games1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-games1/1.0.4+20170511/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 b6a9cae849..317fb39e16 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.4+20161207*, where *20161207* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Games* crate version *1.0.4+20170511*, where *20170511* is the exact revision of the *games:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Games* *v1* API can be found at the //! [official documentation site](https://developers.google.com/games/services/). @@ -208,7 +208,7 @@ // 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 +// 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)] @@ -344,8 +344,6 @@ pub struct Games { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Games {} @@ -358,8 +356,6 @@ impl<'a, C, A> Games client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/games/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -418,26 +414,6 @@ impl<'a, C, A> Games self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/games/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -4942,7 +4918,7 @@ impl<'a, C, A> AchievementListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "players/{playerId}/achievements"; + let mut url = "https://www.googleapis.com/games/v1/players/{playerId}/achievements".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -5224,7 +5200,7 @@ impl<'a, C, A> AchievementIncrementCall<'a, C, A> where C: BorrowMut AchievementSetStepsAtLeastCall<'a, C, A> where C: BorrowMut AchievementUpdateMultipleCall<'a, C, A> where C: BorrowMut AchievementRevealCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "achievements/{achievementId}/reveal"; + let mut url = "https://www.googleapis.com/games/v1/achievements/{achievementId}/reveal".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6239,7 +6215,7 @@ impl<'a, C, A> AchievementUnlockCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "achievements/{achievementId}/unlock"; + let mut url = "https://www.googleapis.com/games/v1/achievements/{achievementId}/unlock".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6491,7 +6467,7 @@ impl<'a, C, A> LeaderboardGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}"; + let mut url = "https://www.googleapis.com/games/v1/leaderboards/{leaderboardId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -6758,7 +6734,7 @@ impl<'a, C, A> LeaderboardListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "leaderboards"; + let mut url = "https://www.googleapis.com/games/v1/leaderboards".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7012,7 +6988,7 @@ impl<'a, C, A> MetagameListCategoriesByPlayerCall<'a, C, A> where C: BorrowMut MetagameGetMetagameConfigCall<'a, C, A> where C: BorrowMut PlayerListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "players/me/players/{collection}"; + let mut url = "https://www.googleapis.com/games/v1/players/me/players/{collection}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -7792,7 +7768,7 @@ impl<'a, C, A> PlayerGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "players/{playerId}"; + let mut url = "https://www.googleapis.com/games/v1/players/{playerId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8051,7 +8027,7 @@ impl<'a, C, A> QuestAcceptCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "quests/{questId}/accept"; + let mut url = "https://www.googleapis.com/games/v1/quests/{questId}/accept".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8320,7 +8296,7 @@ impl<'a, C, A> QuestListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "players/{playerId}/quests"; + let mut url = "https://www.googleapis.com/games/v1/players/{playerId}/quests".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -8593,7 +8569,7 @@ impl<'a, C, A> SnapshotGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "snapshots/{snapshotId}"; + let mut url = "https://www.googleapis.com/games/v1/snapshots/{snapshotId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DriveAppdata.as_ref().to_string(), ()); } @@ -8862,7 +8838,7 @@ impl<'a, C, A> SnapshotListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "players/{playerId}/snapshots"; + let mut url = "https://www.googleapis.com/games/v1/players/{playerId}/snapshots".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DriveAppdata.as_ref().to_string(), ()); } @@ -9129,7 +9105,7 @@ impl<'a, C, A> TurnBasedMatcheDismisCall<'a, C, A> where C: BorrowMut TurnBasedMatcheSyncCall<'a, C, A> where C: BorrowMut TurnBasedMatcheDeclineCall<'a, C, A> where C: BorrowMut TurnBasedMatcheGetCall<'a, C, A> where C: BorrowMut TurnBasedMatcheCreateCall<'a, C, A> where C: BorrowMut TurnBasedMatcheJoinCall<'a, C, A> where C: BorrowMut TurnBasedMatcheLeaveTurnCall<'a, C, A> where C: BorrowMut TurnBasedMatcheCancelCall<'a, C, A> where C: BorrowMut TurnBasedMatcheFinishCall<'a, C, A> where C: BorrowMut TurnBasedMatcheLeaveCall<'a, C, A> where C: BorrowMut TurnBasedMatcheListCall<'a, C, A> where C: BorrowMut TurnBasedMatcheTakeTurnCall<'a, C, A> where C: BorrowMut TurnBasedMatcheRematchCall<'a, C, A> where C: BorrowMut ApplicationVerifyCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "applications/{applicationId}/verify"; + let mut url = "https://www.googleapis.com/games/v1/applications/{applicationId}/verify".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12846,7 +12822,7 @@ impl<'a, C, A> ApplicationGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "applications/{applicationId}"; + let mut url = "https://www.googleapis.com/games/v1/applications/{applicationId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13104,7 +13080,7 @@ impl<'a, C, A> ApplicationPlayedCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "applications/played"; + let mut url = "https://www.googleapis.com/games/v1/applications/played".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13315,7 +13291,7 @@ impl<'a, C, A> RoomGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "rooms/{roomId}"; + let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13581,7 +13557,7 @@ impl<'a, C, A> RoomLeaveCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "rooms/{roomId}/leave"; + let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}/leave".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13872,7 +13848,7 @@ impl<'a, C, A> RoomListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "rooms"; + let mut url = "https://www.googleapis.com/games/v1/rooms".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14121,7 +14097,7 @@ impl<'a, C, A> RoomReportStatuCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "rooms/{roomId}/reportstatus"; + let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}/reportstatus".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14409,7 +14385,7 @@ impl<'a, C, A> RoomCreateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "rooms/create"; + let mut url = "https://www.googleapis.com/games/v1/rooms/create".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14661,7 +14637,7 @@ impl<'a, C, A> RoomDeclineCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "rooms/{roomId}/decline"; + let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}/decline".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14914,7 +14890,7 @@ impl<'a, C, A> RoomDismisCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "rooms/{roomId}/dismiss"; + let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}/dismiss".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15163,7 +15139,7 @@ impl<'a, C, A> RoomJoinCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "rooms/{roomId}/join"; + let mut url = "https://www.googleapis.com/games/v1/rooms/{roomId}/join".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15453,7 +15429,7 @@ impl<'a, C, A> ScoreSubmitCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/scores"; + let mut url = "https://www.googleapis.com/games/v1/leaderboards/{leaderboardId}/scores".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15743,7 +15719,7 @@ impl<'a, C, A> ScoreListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/scores/{collection}"; + let mut url = "https://www.googleapis.com/games/v1/leaderboards/{leaderboardId}/scores/{collection}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16056,7 +16032,7 @@ impl<'a, C, A> ScoreGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}"; + let mut url = "https://www.googleapis.com/games/v1/players/{playerId}/leaderboards/{leaderboardId}/scores/{timeSpan}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16361,7 +16337,7 @@ impl<'a, C, A> ScoreSubmitMultipleCall<'a, C, A> where C: BorrowMut ScoreListWindowCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/window/{collection}"; + let mut url = "https://www.googleapis.com/games/v1/leaderboards/{leaderboardId}/window/{collection}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -16943,7 +16919,7 @@ impl<'a, C, A> PushtokenRemoveCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "pushtokens/remove"; + let mut url = "https://www.googleapis.com/games/v1/pushtokens/remove".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17177,7 +17153,7 @@ impl<'a, C, A> PushtokenUpdateCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "pushtokens"; + let mut url = "https://www.googleapis.com/games/v1/pushtokens".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17407,7 +17383,7 @@ impl<'a, C, A> RevisionCheckCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "revisions/check"; + let mut url = "https://www.googleapis.com/games/v1/revisions/check".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -17651,7 +17627,7 @@ impl<'a, C, A> EventListDefinitionCall<'a, C, A> where C: BorrowMut EventRecordCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "events"; + let mut url = "https://www.googleapis.com/games/v1/events".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18158,7 +18134,7 @@ impl<'a, C, A> EventListByPlayerCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "events"; + let mut url = "https://www.googleapis.com/games/v1/events".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -18398,7 +18374,7 @@ impl<'a, C, A> QuestMilestoneClaimCall<'a, C, A> where C: BorrowMut AchievementDefinitionListCall<'a, C, A> where C: BorrowMut AchievementDefinitionListCall<'a, C, A> where C: BorrowMut"] 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-gamesconfiguration1_configuration] path = "../gamesconfiguration1_configuration" -version = "1.0.4+20161207" +version = "1.0.4+20170511" diff --git a/gen/gamesconfiguration1_configuration-cli/README.md b/gen/gamesconfiguration1_configuration-cli/README.md index 8d178af766..94164ce53e 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 *20161207*. The CLI is at version *1.0.4*. +This documentation was generated from the *Games Configuration* API at revision *20170511*. The CLI is at version *1.0.4*. ```bash gamesconfiguration1-configuration [options] diff --git a/gen/gamesconfiguration1_configuration-cli/mkdocs.yml b/gen/gamesconfiguration1_configuration-cli/mkdocs.yml index 87b2fcad3f..ba2b6ab7dd 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.4+20161207 +site_name: Games Configuration v1.0.4+20170511 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 66b29d2a3e..43ed9a66ad 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.4+20161207") + .version("1.0.4+20170511") .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 9a816284d9..22d8643a3c 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.4+20161207" +version = "1.0.4+20170511" 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.4+20161207" +documentation = "https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511" license = "MIT" keywords = ["gamesConfiguration", "google", "protocol", "web", "api"] diff --git a/gen/gamesconfiguration1_configuration/README.md b/gen/gamesconfiguration1_configuration/README.md index 8b6e19deef..3c8f0c82f1 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.4+20161207*, where *20161207* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Games Configuration* crate version *1.0.4+20170511*, where *20170511* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161207/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html) ... -* [achievement configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.AchievementConfiguration.html) - * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.AchievementConfigurationUpdateCall.html) -* [image configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.ImageConfiguration.html) - * [*upload*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) -* [leaderboard configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.LeaderboardConfiguration.html) - * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationUpdateCall.html) +* [achievement configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfiguration.html) + * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.AchievementConfigurationUpdateCall.html) +* [image configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.ImageConfiguration.html) + * [*upload*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) +* [leaderboard configurations](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfiguration.html) + * [*delete*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationDeleteCall.html), [*get*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationGetCall.html), [*insert*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationInsertCall.html), [*list*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationListCall.html), [*patch*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationPatchCall.html) and [*update*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/struct.LeaderboardConfigurationUpdateCall.html) Upload supported by ... -* [*upload image configurations*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/struct.ImageConfigurationUploadCall.html) +* [*upload image configurations*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/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.4+20161207/google_gamesconfiguration1_configuration/struct.GamesConfiguration.html)** +* **[Hub](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/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.4+20161207/google_gamesconfiguration1_configuration/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/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.4+20161207/google_gamesconfiguration1_configuration/trait.Part.html)** + * **[Parts](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/google_gamesconfiguration1_configuration/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/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. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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")`. @@ -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-gamesconfiguration1_configuration/1.0.4+20161207/google_gamesconfiguration1_configuration/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/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.4+20170511/google_gamesconfiguration1_configuration/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/google_gamesconfiguration1_configuration/trait.RequestValue.html) and -[decodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20161207/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.4+20170511/google_gamesconfiguration1_configuration/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/google_gamesconfiguration1_configuration/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gamesconfiguration1_configuration/1.0.4+20170511/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 9cfa925f53..c02e64543e 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.4+20161207*, where *20161207* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Games Configuration* crate version *1.0.4+20170511*, where *20170511* is the exact revision of the *gamesConfiguration:v1configuration* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Games Configuration* *v1_configuration* API can be found at the //! [official documentation site](https://developers.google.com/games/services). @@ -185,7 +185,7 @@ // 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 +// 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)] @@ -312,8 +312,6 @@ pub struct GamesConfiguration { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for GamesConfiguration {} @@ -326,8 +324,6 @@ impl<'a, C, A> GamesConfiguration client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/games/v1configuration/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -350,26 +346,6 @@ impl<'a, C, A> GamesConfiguration self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/games/v1configuration/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1123,9 +1099,9 @@ impl<'a, C, A> ImageConfigurationUploadCall<'a, C, A> where C: BorrowMut AchievementConfigurationListCall<'a, C, A> where C: BorrowMut AchievementConfigurationUpdateCall<'a, C, A> where C: BorrowMut AchievementConfigurationInsertCall<'a, C, A> where C: BorrowMut AchievementConfigurationGetCall<'a, C, A> where C: BorrowMut AchievementConfigurationPatchCall<'a, C, A> where C: BorrowMut AchievementConfigurationDeleteCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationInsertCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationGetCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationPatchCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationUpdateCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationListCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationDeleteCall<'a, C, A> where C: BorrowMut LeaderboardConfigurationDeleteCall<'a, C, A> where C: BorrowMut"] 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-gamesmanagement1_management] path = "../gamesmanagement1_management" -version = "1.0.4+20161207" +version = "1.0.4+20170511" diff --git a/gen/gamesmanagement1_management-cli/README.md b/gen/gamesmanagement1_management-cli/README.md index 08d35210d8..3a8da98a43 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 *20161207*. The CLI is at version *1.0.4*. +This documentation was generated from the *Games Management* API at revision *20170511*. The CLI is at version *1.0.4*. ```bash gamesmanagement1-management [options] diff --git a/gen/gamesmanagement1_management-cli/mkdocs.yml b/gen/gamesmanagement1_management-cli/mkdocs.yml index 22bb1c238d..5d92bd6a3a 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.4+20161207 +site_name: Games Management v1.0.4+20170511 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 cefd24d4c3..93e170864f 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.4+20161207") + .version("1.0.4+20170511") .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 7de56aded5..ba10bdead5 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.4+20161207" +version = "1.0.4+20170511" 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.4+20161207" +documentation = "https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511" license = "MIT" keywords = ["gamesManagement", "google", "protocol", "web", "api"] diff --git a/gen/gamesmanagement1_management/README.md b/gen/gamesmanagement1_management/README.md index 1a0420a805..05dd21fff3 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.4+20161207*, where *20161207* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Games Management* crate version *1.0.4+20170511*, where *20170511* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161207/google_gamesmanagement1_management/struct.GamesManagement.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.GamesManagement.html) ... * achievements - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.AchievementResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.AchievementResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.AchievementResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.AchievementResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.AchievementResetMultipleForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.AchievementResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.AchievementResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.AchievementResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.AchievementResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.AchievementResetMultipleForAllPlayerCall.html) * applications - * [*list hidden*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.ApplicationListHiddenCall.html) + * [*list hidden*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.ApplicationListHiddenCall.html) * events - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.EventResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.EventResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.EventResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.EventResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.EventResetMultipleForAllPlayerCall.html) -* [players](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.Player.html) - * [*hide*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.PlayerHideCall.html) and [*unhide*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.PlayerUnhideCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.EventResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.EventResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.EventResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.EventResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.EventResetMultipleForAllPlayerCall.html) +* [players](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.Player.html) + * [*hide*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.PlayerHideCall.html) and [*unhide*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.PlayerUnhideCall.html) * quests - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.QuestResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.QuestResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.QuestResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.QuestResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.QuestResetMultipleForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.QuestResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.QuestResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.QuestResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.QuestResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.QuestResetMultipleForAllPlayerCall.html) * rooms - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.RoomResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.RoomResetForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.RoomResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.RoomResetForAllPlayerCall.html) * scores - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.ScoreResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.ScoreResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.ScoreResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.ScoreResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.ScoreResetMultipleForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.ScoreResetCall.html), [*reset all*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.ScoreResetAllCall.html), [*reset all for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.ScoreResetAllForAllPlayerCall.html), [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.ScoreResetForAllPlayerCall.html) and [*reset multiple for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.ScoreResetMultipleForAllPlayerCall.html) * turn based matches - * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.TurnBasedMatcheResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/struct.TurnBasedMatcheResetForAllPlayerCall.html) + * [*reset*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/struct.TurnBasedMatcheResetCall.html) and [*reset for all players*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/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.4+20161207/google_gamesmanagement1_management/struct.GamesManagement.html)** +* **[Hub](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/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.4+20161207/google_gamesmanagement1_management/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/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.4+20161207/google_gamesmanagement1_management/trait.Part.html)** + * **[Parts](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/google_gamesmanagement1_management/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/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. @@ -130,17 +130,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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")`. @@ -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-gamesmanagement1_management/1.0.4+20161207/google_gamesmanagement1_management/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/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.4+20170511/google_gamesmanagement1_management/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/google_gamesmanagement1_management/trait.RequestValue.html) and -[decodable](https://docs.rs/google-gamesmanagement1_management/1.0.4+20161207/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.4+20170511/google_gamesmanagement1_management/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/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.4+20170511/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.4+20161207/google_gamesmanagement1_management/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gamesmanagement1_management/1.0.4+20170511/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 b85a7e5b3a..d2db13471f 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.4+20161207*, where *20161207* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Games Management* crate version *1.0.4+20170511*, where *20170511* is the exact revision of the *gamesManagement:v1management* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Games Management* *v1_management* API can be found at the //! [official documentation site](https://developers.google.com/games/services). @@ -185,7 +185,7 @@ // 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 +// 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)] @@ -314,8 +314,6 @@ pub struct GamesManagement { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for GamesManagement {} @@ -328,8 +326,6 @@ impl<'a, C, A> GamesManagement client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/games/v1management/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -367,26 +363,6 @@ impl<'a, C, A> GamesManagement self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/games/v1management/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1567,7 +1543,7 @@ impl<'a, C, A> AchievementResetAllForAllPlayerCall<'a, C, A> where C: BorrowMut< } - let mut url = self.hub._base_url.clone() + "achievements/resetAllForAllPlayers"; + let mut url = "https://www.googleapis.com/games/v1management/achievements/resetAllForAllPlayers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -1760,7 +1736,7 @@ impl<'a, C, A> AchievementResetForAllPlayerCall<'a, C, A> where C: BorrowMut AchievementResetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "achievements/{achievementId}/reset"; + let mut url = "https://www.googleapis.com/games/v1management/achievements/{achievementId}/reset".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -2224,7 +2200,7 @@ impl<'a, C, A> AchievementResetMultipleForAllPlayerCall<'a, C, A> where C: Borro } - let mut url = self.hub._base_url.clone() + "achievements/resetMultipleForAllPlayers"; + let mut url = "https://www.googleapis.com/games/v1management/achievements/resetMultipleForAllPlayers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -2440,7 +2416,7 @@ impl<'a, C, A> AchievementResetAllCall<'a, C, A> where C: BorrowMut PlayerHideCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "applications/{applicationId}/players/hidden/{playerId}"; + let mut url = "https://www.googleapis.com/games/v1management/applications/{applicationId}/players/hidden/{playerId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -2881,7 +2857,7 @@ impl<'a, C, A> PlayerUnhideCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "applications/{applicationId}/players/hidden/{playerId}"; + let mut url = "https://www.googleapis.com/games/v1management/applications/{applicationId}/players/hidden/{playerId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -3120,7 +3096,7 @@ impl<'a, C, A> ScoreResetMultipleForAllPlayerCall<'a, C, A> where C: BorrowMut ScoreResetAllForAllPlayerCall<'a, C, A> where C: BorrowMut ScoreResetAllCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "scores/reset"; + let mut url = "https://www.googleapis.com/games/v1management/scores/reset".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -3730,7 +3706,7 @@ impl<'a, C, A> ScoreResetForAllPlayerCall<'a, C, A> where C: BorrowMut ScoreResetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "leaderboards/{leaderboardId}/scores/reset"; + let mut url = "https://www.googleapis.com/games/v1management/leaderboards/{leaderboardId}/scores/reset".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -4187,7 +4163,7 @@ impl<'a, C, A> TurnBasedMatcheResetCall<'a, C, A> where C: BorrowMut TurnBasedMatcheResetForAllPlayerCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "turnbasedmatches/resetForAllPlayers"; + let mut url = "https://www.googleapis.com/games/v1management/turnbasedmatches/resetForAllPlayers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -4582,7 +4558,7 @@ impl<'a, C, A> ApplicationListHiddenCall<'a, C, A> where C: BorrowMut RoomResetForAllPlayerCall<'a, C, A> where C: BorrowMut RoomResetCall<'a, C, A> where C: BorrowMut, A: oau } - let mut url = self.hub._base_url.clone() + "rooms/reset"; + let mut url = "https://www.googleapis.com/games/v1management/rooms/reset".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -5210,7 +5186,7 @@ impl<'a, C, A> QuestResetAllForAllPlayerCall<'a, C, A> where C: BorrowMut QuestResetMultipleForAllPlayerCall<'a, C, A> where C: BorrowMut QuestResetAllCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "quests/reset"; + let mut url = "https://www.googleapis.com/games/v1management/quests/reset".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -5816,7 +5792,7 @@ impl<'a, C, A> QuestResetForAllPlayerCall<'a, C, A> where C: BorrowMut QuestResetCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "quests/{questId}/reset"; + let mut url = "https://www.googleapis.com/games/v1management/quests/{questId}/reset".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -6262,7 +6238,7 @@ impl<'a, C, A> EventResetAllForAllPlayerCall<'a, C, A> where C: BorrowMut EventResetCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "events/{eventId}/reset"; + let mut url = "https://www.googleapis.com/games/v1management/events/{eventId}/reset".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -6677,7 +6653,7 @@ impl<'a, C, A> EventResetAllCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "events/reset"; + let mut url = "https://www.googleapis.com/games/v1management/events/reset".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Game.as_ref().to_string(), ()); } @@ -6875,7 +6851,7 @@ impl<'a, C, A> EventResetMultipleForAllPlayerCall<'a, C, A> where C: BorrowMut EventResetForAllPlayerCall<'a, C, A> where C: BorrowMut EventResetForAllPlayerCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Gan {} @@ -325,8 +323,6 @@ impl<'a, C, A> Gan client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/gan/v1beta1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -358,26 +354,6 @@ impl<'a, C, A> Gan self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/gan/v1beta1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1750,7 +1726,7 @@ impl<'a, C, A> PublisherListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{role}/{roleId}/publishers"; + let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/publishers".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2029,7 +2005,7 @@ impl<'a, C, A> PublisherGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{role}/{roleId}/publisher"; + let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/publisher".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2268,7 +2244,7 @@ impl<'a, C, A> LinkInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{role}/{roleId}/link"; + let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/link".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2519,7 +2495,7 @@ impl<'a, C, A> LinkGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{role}/{roleId}/link/{linkId}"; + let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/link/{linkId}".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2825,7 +2801,7 @@ impl<'a, C, A> LinkListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{role}/{roleId}/links"; + let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/links".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -3209,7 +3185,7 @@ impl<'a, C, A> ReportGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{role}/{roleId}/report/{reportType}"; + let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/report/{reportType}".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -3535,7 +3511,7 @@ impl<'a, C, A> CcOfferListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "publishers/{publisher}/ccOffers"; + let mut url = "https://www.googleapis.com/gan/v1beta1/publishers/{publisher}/ccOffers".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -3770,7 +3746,7 @@ impl<'a, C, A> AdvertiserGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{role}/{roleId}/advertiser"; + let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/advertiser".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -4037,7 +4013,7 @@ impl<'a, C, A> AdvertiserListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{role}/{roleId}/advertisers"; + let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/advertisers".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -4391,7 +4367,7 @@ impl<'a, C, A> EventListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{role}/{roleId}/events"; + let mut url = "https://www.googleapis.com/gan/v1beta1/{role}/{roleId}/events".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -4657,3 +4633,4 @@ impl<'a, C, A> EventListCall<'a, C, A> where C: BorrowMut, A: oau } + diff --git a/gen/genomics1-cli/Cargo.toml b/gen/genomics1-cli/Cargo.toml index a2949f82e6..cecbb3cc8a 100644 --- a/gen/genomics1-cli/Cargo.toml +++ b/gen/genomics1-cli/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-genomics1-cli" -version = "1.0.4+20160928" +version = "1.0.4+20170520" 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" -homepage = "https://cloud.google.com/genomics/" +homepage = "https://cloud.google.com/genomics" documentation = "http://byron.github.io/google-apis-rs/google_genomics1_cli" license = "MIT" keywords = ["genomics", "google", "cli"] @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-genomics1] path = "../genomics1" -version = "1.0.4+20160928" +version = "1.0.4+20170520" diff --git a/gen/genomics1-cli/README.md b/gen/genomics1-cli/README.md index 246a068afe..e08f97019a 100644 --- a/gen/genomics1-cli/README.md +++ b/gen/genomics1-cli/README.md @@ -11,7 +11,7 @@ capabilities. Errors will be printed to standard error, and cause the program's If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. Everything else about the *genomics* API can be found at the -[official documentation site](https://cloud.google.com/genomics/). +[official documentation site](https://cloud.google.com/genomics). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *genomics* API at revision *20160928*. The CLI is at version *1.0.4*. +This documentation was generated from the *genomics* API at revision *20170520*. The CLI is at version *1.0.4*. ```bash genomics1 [options] @@ -72,7 +72,6 @@ genomics1 [options] search (-r )... [-p ]... [-o ] reads search (-r )... [-p ]... [-o ] - stream (-r )... [-p ]... [-o ] references bases-list [-p ]... [-o ] get [-p ]... [-o ] @@ -88,7 +87,6 @@ genomics1 [options] merge (-r )... [-p ]... [-o ] patch (-r )... [-p ]... [-o ] search (-r )... [-p ]... [-o ] - stream (-r )... [-p ]... [-o ] variantsets create (-r )... [-p ]... [-o ] delete [-p ]... [-o ] diff --git a/gen/genomics1-cli/mkdocs.yml b/gen/genomics1-cli/mkdocs.yml index 88fc887c03..7998e2a063 100644 --- a/gen/genomics1-cli/mkdocs.yml +++ b/gen/genomics1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: genomics v1.0.4+20160928 +site_name: genomics v1.0.4+20170520 site_url: http://byron.github.io/google-apis-rs/google-genomics1-cli site_description: A complete library to interact with genomics (protocol v1) @@ -45,7 +45,6 @@ pages: - ['readgroupsets_patch.md', 'Readgroupsets', 'Patch'] - ['readgroupsets_search.md', 'Readgroupsets', 'Search'] - ['reads_search.md', 'Reads', 'Search'] -- ['reads_stream.md', 'Reads', 'Stream'] - ['references_bases-list.md', 'References', 'Bases List'] - ['references_get.md', 'References', 'Get'] - ['references_search.md', 'References', 'Search'] @@ -58,7 +57,6 @@ pages: - ['variants_merge.md', 'Variants', 'Merge'] - ['variants_patch.md', 'Variants', 'Patch'] - ['variants_search.md', 'Variants', 'Search'] -- ['variants_stream.md', 'Variants', 'Stream'] - ['variantsets_create.md', 'Variantsets', 'Create'] - ['variantsets_delete.md', 'Variantsets', 'Delete'] - ['variantsets_export.md', 'Variantsets', 'Export'] diff --git a/gen/genomics1-cli/src/main.rs b/gen/genomics1-cli/src/main.rs index af630a84b8..250943052d 100644 --- a/gen/genomics1-cli/src/main.rs +++ b/gen/genomics1-cli/src/main.rs @@ -157,9 +157,7 @@ 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 })), - "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 })), "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 })), @@ -170,7 +168,9 @@ 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 })), - "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 })), "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"]); @@ -454,9 +454,7 @@ 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 })), - "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 })), "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 })), @@ -467,7 +465,9 @@ 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 })), - "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 })), "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"]); @@ -559,8 +559,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-uri" => Some(("sourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -753,9 +753,9 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "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"]); @@ -843,8 +843,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "source-uri" => Some(("sourceUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -1739,8 +1739,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())))); @@ -2315,9 +2315,9 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "reference-names" => Some(("referenceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "export-uri" => Some(("exportUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-names" => Some(("referenceNames", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "project-id" => Some(("projectId", 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())))); @@ -2726,8 +2726,8 @@ impl<'n> Engine<'n> { "end" => Some(("end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "read-group-ids" => Some(("readGroupIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "read-group-set-ids" => Some(("readGroupSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { @@ -2791,97 +2791,6 @@ impl<'n> Engine<'n> { } } - fn _reads_stream(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "end" => Some(("end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "total-shards" => Some(("totalShards", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "read-group-set-id" => Some(("readGroupSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "shard" => Some(("shard", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "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!["end", "project-id", "read-group-set-id", "reference-name", "shard", "start", "total-shards"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::StreamReadsRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.reads().stream(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 _references_bases_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.references().bases_list(opt.value_of("reference-id").unwrap_or("")); @@ -3164,10 +3073,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "md5checksums" => Some(("md5checksums", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "assembly-id" => Some(("assemblyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "accessions" => Some(("accessions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "assembly-id" => Some(("assemblyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["accessions", "assembly-id", "md5checksums", "page-size", "page-token"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -3255,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 })), - "reference-bases" => Some(("referenceBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "names" => Some(("names", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "alternate-bases" => Some(("alternateBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "quality" => Some(("quality", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-bases" => Some(("referenceBases", 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())))); @@ -3452,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())))); @@ -3629,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 })), - "reference-bases" => Some(("referenceBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "names" => Some(("names", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "alternate-bases" => Some(("alternateBases", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "quality" => Some(("quality", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), - "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "reference-bases" => Some(("referenceBases", 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())))); @@ -3730,10 +3639,10 @@ impl<'n> Engine<'n> { "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "max-calls" => Some(("maxCalls", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "call-set-ids" => Some(("callSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "variant-set-ids" => Some(("variantSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "variant-name" => Some(("variantName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "variant-set-ids" => Some(("variantSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "call-set-ids" => Some(("callSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["call-set-ids", "end", "max-calls", "page-size", "page-token", "reference-name", "start", "variant-name", "variant-set-ids"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -3795,96 +3704,6 @@ impl<'n> Engine<'n> { } } - fn _variants_stream(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - - let mut field_cursor = FieldCursor::default(); - let mut object = json::value::Value::Object(Default::default()); - - for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let last_errc = err.issues.len(); - let (key, value) = parse_kv_arg(&*kvarg, err, false); - let mut temp_cursor = field_cursor.clone(); - if let Err(field_err) = temp_cursor.set(&*key) { - err.issues.push(field_err); - } - if value.is_none() { - field_cursor = temp_cursor.clone(); - if err.issues.len() > last_errc { - err.issues.remove(last_errc); - } - continue; - } - - let type_info: Option<(&'static str, JsonTypeInfo)> = - match &temp_cursor.to_string()[..] { - "variant-set-id" => Some(("variantSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "end" => Some(("end", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "start" => Some(("start", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "call-set-ids" => Some(("callSetIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "reference-name" => Some(("referenceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["call-set-ids", "end", "project-id", "reference-name", "start", "variant-set-id"]); - err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); - None - } - }; - if let Some((field_cursor_str, type_info)) = type_info { - FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); - } - } - let mut request: api::StreamVariantsRequest = json::value::from_value(object).unwrap(); - let mut call = self.hub.variants().stream(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 _variantsets_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -3908,9 +3727,9 @@ 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 })), - "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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 })), "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -4049,10 +3868,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "project-id" => Some(("projectId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "bigquery-table" => Some(("bigqueryTable", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "bigquery-dataset" => Some(("bigqueryDataset", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), "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"]); @@ -4190,9 +4009,9 @@ 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 })), - "reference-set-id" => Some(("referenceSetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "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 })), "dataset-id" => Some(("datasetId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { @@ -4510,9 +4329,6 @@ impl<'n> Engine<'n> { ("search", Some(opt)) => { call_result = self._reads_search(opt, dry_run, &mut err); }, - ("stream", Some(opt)) => { - call_result = self._reads_stream(opt, dry_run, &mut err); - }, _ => { err.issues.push(CLIError::MissingMethodError("reads".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -4573,9 +4389,6 @@ impl<'n> Engine<'n> { ("search", Some(opt)) => { call_result = self._variants_search(opt, dry_run, &mut err); }, - ("stream", Some(opt)) => { - call_result = self._variants_stream(opt, dry_run, &mut err); - }, _ => { err.issues.push(CLIError::MissingMethodError("variants".to_string())); writeln!(io::stderr(), "{}\n", opt.usage()).ok(); @@ -4696,7 +4509,20 @@ fn main() { let arg_data = [ ("annotations", "methods: 'batch-create', 'create', 'delete', 'get', 'search' and 'update'", vec![ ("batch-create", - Some(r##"Creates one or more new annotations atomically. All annotations must belong to the same annotation set. Caller must have WRITE permission for this annotation set. For optimal performance, batch positionally adjacent annotations together. If the request has a systemic issue, such as an attempt to write to an inaccessible annotation set, the entire RPC will fail accordingly. For lesser data issues, when possible an error will be isolated to the corresponding batch entry in the response; the remaining well formed annotations will be created normally. For details on the requirements for each individual annotation resource, see CreateAnnotation."##), + Some(r##"Creates one or more new annotations atomically. All annotations must + belong to the same annotation set. Caller must have WRITE + permission for this annotation set. For optimal performance, batch + positionally adjacent annotations together. + + If the request has a systemic issue, such as an attempt to write to + an inaccessible annotation set, the entire RPC will fail accordingly. For + lesser data issues, when possible an error will be isolated to the + corresponding batch entry in the response; the remaining well formed + annotations will be created normally. + + For details on the requirements for each individual annotation resource, + see + CreateAnnotation."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotations_batch-create", vec![ (Some(r##"kv"##), @@ -4718,7 +4544,28 @@ fn main() { Some(false)), ]), ("create", - Some(r##"Creates a new annotation. Caller must have WRITE permission for the associated annotation set. The following fields are required: * annotationSetId * referenceName or referenceId ### Transcripts For annotations of type TRANSCRIPT, the following fields of transcript must be provided: * exons.start * exons.end All other fields may be optionally specified, unless documented as being server-generated (for example, the `id` field). The annotated range must be no longer than 100Mbp (mega base pairs). See the Annotation resource for additional restrictions on each field."##), + Some(r##"Creates a new annotation. Caller must have WRITE permission + for the associated annotation set. + + The following fields are required: + + * annotationSetId + * referenceName or + referenceId + + ### Transcripts + + For annotations of type TRANSCRIPT, the following fields of + transcript must be provided: + + * exons.start + * exons.end + + All other fields may be optionally specified, unless documented as being + server-generated (for example, the `id` field). The annotated + range must be no longer than 100Mbp (mega base pairs). See the + Annotation resource + for additional restrictions on each field."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotations_create", vec![ (Some(r##"kv"##), @@ -4740,7 +4587,8 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes an annotation. Caller must have WRITE permission for the associated annotation set."##), + Some(r##"Deletes an annotation. Caller must have WRITE permission for + the associated annotation set."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotations_delete", vec![ (Some(r##"annotation-id"##), @@ -4762,7 +4610,8 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Gets an annotation. Caller must have READ permission for the associated annotation set."##), + Some(r##"Gets an annotation. Caller must have READ permission + for the associated annotation set."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotations_get", vec![ (Some(r##"annotation-id"##), @@ -4784,7 +4633,13 @@ fn main() { Some(false)), ]), ("search", - Some(r##"Searches for annotations that match the given criteria. Results are ordered by genomic coordinate (by reference sequence, then position). Annotations with equivalent genomic coordinates are returned in an unspecified order. This order is consistent, such that two queries for the same content (regardless of page size) yield annotations in the same order across their respective streams of paginated responses. Caller must have READ permission for the queried annotation sets."##), + Some(r##"Searches for annotations that match the given criteria. Results are + ordered by genomic coordinate (by reference sequence, then position). + Annotations with equivalent genomic coordinates are returned in an + unspecified order. This order is consistent, such that two queries for the + same content (regardless of page size) yield annotations in the same order + across their respective streams of paginated responses. Caller must have + READ permission for the queried annotation sets."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotations_search", vec![ (Some(r##"kv"##), @@ -4806,7 +4661,8 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates an annotation. Caller must have WRITE permission for the associated dataset."##), + Some(r##"Updates an annotation. Caller must have + WRITE permission for the associated dataset."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotations_update", vec![ (Some(r##"annotation-id"##), @@ -4837,7 +4693,16 @@ fn main() { ("annotationsets", "methods: 'create', 'delete', 'get', 'search' and 'update'", vec![ ("create", - Some(r##"Creates a new annotation set. Caller must have WRITE permission for the associated dataset. The following fields are required: * datasetId * referenceSetId All other fields may be optionally specified, unless documented as being server-generated (for example, the `id` field)."##), + Some(r##"Creates a new annotation set. Caller must have WRITE permission for the + associated dataset. + + The following fields are required: + + * datasetId + * referenceSetId + + All other fields may be optionally specified, unless documented as being + server-generated (for example, the `id` field)."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotationsets_create", vec![ (Some(r##"kv"##), @@ -4859,7 +4724,8 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes an annotation set. Caller must have WRITE permission for the associated annotation set."##), + Some(r##"Deletes an annotation set. Caller must have WRITE permission + for the associated annotation set."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotationsets_delete", vec![ (Some(r##"annotation-set-id"##), @@ -4881,7 +4747,8 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Gets an annotation set. Caller must have READ permission for the associated dataset."##), + Some(r##"Gets an annotation set. Caller must have READ permission for + the associated dataset."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotationsets_get", vec![ (Some(r##"annotation-set-id"##), @@ -4903,7 +4770,11 @@ fn main() { Some(false)), ]), ("search", - Some(r##"Searches for annotation sets that match the given criteria. Annotation sets are returned in an unspecified order. This order is consistent, such that two queries for the same content (regardless of page size) yield annotation sets in the same order across their respective streams of paginated responses. Caller must have READ permission for the queried datasets."##), + Some(r##"Searches for annotation sets that match the given criteria. Annotation sets + are returned in an unspecified order. This order is consistent, such that + two queries for the same content (regardless of page size) yield annotation + sets in the same order across their respective streams of paginated + responses. Caller must have READ permission for the queried datasets."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotationsets_search", vec![ (Some(r##"kv"##), @@ -4925,7 +4796,9 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates an annotation set. The update must respect all mutability restrictions and other invariants described on the annotation set resource. Caller must have WRITE permission for the associated dataset."##), + Some(r##"Updates an annotation set. The update must respect all mutability + restrictions and other invariants described on the annotation set resource. + Caller must have WRITE permission for the associated dataset."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/annotationsets_update", vec![ (Some(r##"annotation-set-id"##), @@ -4956,7 +4829,11 @@ fn main() { ("callsets", "methods: 'create', 'delete', 'get', 'patch' and 'search'", vec![ ("create", - Some(r##"Creates a new call set. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Creates a new call set. + + For the definitions of call sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/callsets_create", vec![ (Some(r##"kv"##), @@ -4978,7 +4855,11 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes a call set. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Deletes a call set. + + For the definitions of call sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/callsets_delete", vec![ (Some(r##"call-set-id"##), @@ -5000,7 +4881,11 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Gets a call set by ID. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Gets a call set by ID. + + For the definitions of call sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/callsets_get", vec![ (Some(r##"call-set-id"##), @@ -5022,7 +4907,13 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates a call set. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics."##), + Some(r##"Updates a call set. + + For the definitions of call sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/callsets_patch", vec![ (Some(r##"call-set-id"##), @@ -5050,7 +4941,14 @@ fn main() { Some(false)), ]), ("search", - Some(r##"Gets a list of call sets matching the criteria. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178)."##), + Some(r##"Gets a list of call sets matching the criteria. + + For the definitions of call sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Implements + [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178)."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/callsets_search", vec![ (Some(r##"kv"##), @@ -5075,7 +4973,11 @@ fn main() { ("datasets", "methods: 'create', 'delete', 'get', 'get-iam-policy', 'list', 'patch', 'set-iam-policy', 'test-iam-permissions' and 'undelete'", vec![ ("create", - Some(r##"Creates a new dataset. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Creates a new dataset. + + For the definitions of datasets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_create", vec![ (Some(r##"kv"##), @@ -5097,7 +4999,16 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes a dataset and all of its contents (all read group sets, reference sets, variant sets, call sets, annotation sets, etc.) This is reversible (up to one week after the deletion) via the datasets.undelete operation. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Deletes a dataset and all of its contents (all read group sets, + reference sets, variant sets, call sets, annotation sets, etc.) + This is reversible (up to one week after the deletion) via + the + datasets.undelete + operation. + + For the definitions of datasets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_delete", vec![ (Some(r##"dataset-id"##), @@ -5119,7 +5030,11 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Gets a dataset by ID. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Gets a dataset by ID. + + For the definitions of datasets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_get", vec![ (Some(r##"dataset-id"##), @@ -5141,12 +5056,21 @@ fn main() { Some(false)), ]), ("get-iam-policy", - Some(r##"Gets the access control policy for the dataset. This is empty if the policy or resource does not exist. See Getting a Policy for more information. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Gets the access control policy for the dataset. This is empty if the + policy or resource does not exist. + + See Getting a + Policy for more information. + + For the definitions of datasets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_get-iam-policy", vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which policy is being specified. Format is `datasets/`."##), + Some(r##"REQUIRED: The resource for which policy is being specified. Format is + `datasets/`."##), Some(true), Some(false)), @@ -5169,7 +5093,11 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Lists datasets within a project. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Lists datasets within a project. + + For the definitions of datasets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_list", vec![ (Some(r##"v"##), @@ -5185,7 +5113,13 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates a dataset. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics."##), + Some(r##"Updates a dataset. + + For the definitions of datasets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_patch", vec![ (Some(r##"dataset-id"##), @@ -5213,12 +5147,21 @@ fn main() { Some(false)), ]), ("set-iam-policy", - Some(r##"Sets the access control policy on the specified dataset. Replaces any existing policy. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) See Setting a Policy for more information."##), + Some(r##"Sets the access control policy on the specified dataset. Replaces any + existing policy. + + For the definitions of datasets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + See Setting a + Policy for more information."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_set-iam-policy", vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which policy is being specified. Format is `datasets/`."##), + Some(r##"REQUIRED: The resource for which policy is being specified. Format is + `datasets/`."##), Some(true), Some(false)), @@ -5241,12 +5184,19 @@ fn main() { Some(false)), ]), ("test-iam-permissions", - Some(r##"Returns permissions that a caller has on the specified resource. See Testing Permissions for more information. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Returns permissions that a caller has on the specified resource. + See Testing + Permissions for more information. + + For the definitions of datasets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_test-iam-permissions", vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which policy is being specified. Format is `datasets/`."##), + Some(r##"REQUIRED: The resource for which policy is being specified. Format is + `datasets/`."##), Some(true), Some(false)), @@ -5269,7 +5219,13 @@ fn main() { Some(false)), ]), ("undelete", - Some(r##"Undeletes a dataset by restoring a dataset which was deleted via this API. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This operation is only possible for a week after the deletion occurred."##), + Some(r##"Undeletes a dataset by restoring a dataset which was deleted via this API. + + For the definitions of datasets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + This operation is only possible for a week after the deletion occurred."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/datasets_undelete", vec![ (Some(r##"dataset-id"##), @@ -5328,7 +5284,9 @@ fn main() { 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."##), + Some(r##"Gets the latest state of a long-running operation. Clients can use this + method to poll the operation result at intervals as recommended by the API + service."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/operations_get", vec![ (Some(r##"name"##), @@ -5375,7 +5333,19 @@ fn main() { ("readgroupsets", "methods: 'coveragebuckets-list', 'delete', 'export', 'get', 'import', 'patch' and 'search'", vec![ ("coveragebuckets-list", - Some(r##"Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Coverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set."##), + Some(r##"Lists fixed width coverage buckets for a read group set, each of which + correspond to a range of a reference sequence. Each bucket summarizes + coverage information across its corresponding genomic range. + + For the definitions of read group sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Coverage is defined as the number of reads which are aligned to a given + base in the reference sequence. Coverage buckets are available at several + precomputed bucket widths, enabling retrieval of various coverage 'zoom + levels'. The caller must have READ permissions for the target read group + set."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_coveragebuckets-list", vec![ (Some(r##"read-group-set-id"##), @@ -5397,12 +5367,17 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes a read group set. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Deletes a read group set. + + For the definitions of read group sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_delete", vec![ (Some(r##"read-group-set-id"##), None, - Some(r##"The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set."##), + Some(r##"The ID of the read group set to be deleted. The caller must have WRITE + permissions to the dataset associated with this read group set."##), Some(true), Some(false)), @@ -5419,12 +5394,22 @@ fn main() { Some(false)), ]), ("export", - Some(r##"Exports a read group set to a BAM file in Google Cloud Storage. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Note that currently there may be some differences between exported BAM files and the original BAM file at the time of import. See ImportReadGroupSets for caveats."##), + Some(r##"Exports a read group set to a BAM file in Google Cloud Storage. + + For the definitions of read group sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Note that currently there may be some differences between exported BAM + files and the original BAM file at the time of import. See + ImportReadGroupSets + for caveats."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_export", vec![ (Some(r##"read-group-set-id"##), None, - Some(r##"Required. The ID of the read group set to export. The caller must have READ access to this read group set."##), + Some(r##"Required. The ID of the read group set to export. The caller must have + READ access to this read group set."##), Some(true), Some(false)), @@ -5447,7 +5432,11 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Gets a read group set by ID. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Gets a read group set by ID. + + For the definitions of read group sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_get", vec![ (Some(r##"read-group-set-id"##), @@ -5469,7 +5458,24 @@ fn main() { Some(false)), ]), ("import", - Some(r##"Creates read group sets by asynchronously importing the provided information. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) The caller must have WRITE permissions to the dataset. ## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import - Tags will be converted to strings - tag types are not preserved - Comments (`@CO`) in the input file header will not be preserved - Original header order of references (`@SQ`) will not be preserved - Any reverse stranded unmapped reads will be reverse complemented, and their qualities (also the "BQ" and "OQ" tags, if any) will be reversed - Unmapped reads will be stripped of positional information (reference name and position)"##), + Some(r##"Creates read group sets by asynchronously importing the provided + information. + + For the definitions of read group sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + The caller must have WRITE permissions to the dataset. + + ## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import + + - Tags will be converted to strings - tag types are not preserved + - Comments (`@CO`) in the input file header will not be preserved + - Original header order of references (`@SQ`) will not be preserved + - Any reverse stranded unmapped reads will be reverse complemented, and + their qualities (also the "BQ" and "OQ" tags, if any) will be reversed + - Unmapped reads will be stripped of positional information (reference name + and position)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_import", vec![ (Some(r##"kv"##), @@ -5491,12 +5497,19 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates a read group set. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics."##), + Some(r##"Updates a read group set. + + For the definitions of read group sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_patch", vec![ (Some(r##"read-group-set-id"##), None, - Some(r##"The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set."##), + Some(r##"The ID of the read group set to be updated. The caller must have WRITE + permissions to the dataset associated with this read group set."##), Some(true), Some(false)), @@ -5519,7 +5532,14 @@ fn main() { Some(false)), ]), ("search", - Some(r##"Searches for read group sets matching the criteria. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135)."##), + Some(r##"Searches for read group sets matching the criteria. + + For the definitions of read group sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Implements + [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135)."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/readgroupsets_search", vec![ (Some(r##"kv"##), @@ -5542,9 +5562,32 @@ fn main() { ]), ]), - ("reads", "methods: 'search' and 'stream'", vec![ + ("reads", "methods: 'search'", vec![ ("search", - Some(r##"Gets a list of reads for one or more read group sets. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Reads search operates over a genomic coordinate space of reference sequence & position defined over the reference sequences to which the requested read group sets are aligned. If a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads. All reads returned (including reads on subsequent pages) are ordered by genomic coordinate (by reference sequence, then position). Reads with equivalent genomic coordinates are returned in an unspecified order. This order is consistent, such that two queries for the same content (regardless of page size) yield reads in the same order across their respective streams of paginated responses. Implements [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85)."##), + Some(r##"Gets a list of reads for one or more read group sets. + + For the definitions of read group sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Reads search operates over a genomic coordinate space of reference sequence + & position defined over the reference sequences to which the requested + read group sets are aligned. + + If a target positional range is specified, search returns all reads whose + alignment to the reference genome overlap the range. A query which + specifies only read group set IDs yields all reads in those read group + sets, including unmapped reads. + + All reads returned (including reads on subsequent pages) are ordered by + genomic coordinate (by reference sequence, then position). Reads with + equivalent genomic coordinates are returned in an unspecified order. This + order is consistent, such that two queries for the same content (regardless + of page size) yield reads in the same order across their respective streams + of paginated responses. + + Implements + [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85)."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/reads_search", vec![ (Some(r##"kv"##), @@ -5559,28 +5602,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("stream", - Some(r##"Returns a stream of all the reads matching the search request, ordered by reference name, position, and ID."##), - "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/reads_stream", - 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"##), @@ -5591,7 +5612,14 @@ fn main() { ("references", "methods: 'bases-list', 'get' and 'search'", vec![ ("bases-list", - Some(r##"Lists the bases in a reference, optionally restricted to a range. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221)."##), + Some(r##"Lists the bases in a reference, optionally restricted to a range. + + For the definitions of references and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Implements + [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221)."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/references_bases-list", vec![ (Some(r##"reference-id"##), @@ -5613,7 +5641,14 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Gets a reference. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158)."##), + Some(r##"Gets a reference. + + For the definitions of references and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Implements + [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158)."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/references_get", vec![ (Some(r##"reference-id"##), @@ -5635,7 +5670,14 @@ fn main() { Some(false)), ]), ("search", - Some(r##"Searches for references which match the given criteria. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146)."##), + Some(r##"Searches for references which match the given criteria. + + For the definitions of references and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Implements + [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146)."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/references_search", vec![ (Some(r##"kv"##), @@ -5660,7 +5702,14 @@ fn main() { ("referencesets", "methods: 'get' and 'search'", vec![ ("get", - Some(r##"Gets a reference set. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83)."##), + Some(r##"Gets a reference set. + + For the definitions of references and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Implements + [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83)."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/referencesets_get", vec![ (Some(r##"reference-set-id"##), @@ -5682,7 +5731,14 @@ fn main() { Some(false)), ]), ("search", - Some(r##"Searches for reference sets which match the given criteria. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71)"##), + Some(r##"Searches for reference sets which match the given criteria. + + For the definitions of references and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Implements + [GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/referencesets_search", vec![ (Some(r##"kv"##), @@ -5705,9 +5761,13 @@ fn main() { ]), ]), - ("variants", "methods: 'create', 'delete', 'get', 'import', 'merge', 'patch', 'search' and 'stream'", vec![ + ("variants", "methods: 'create', 'delete', 'get', 'import', 'merge', 'patch' and 'search'", vec![ ("create", - Some(r##"Creates a new variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Creates a new variant. + + For the definitions of variants and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_create", vec![ (Some(r##"kv"##), @@ -5729,7 +5789,11 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes a variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Deletes a variant. + + For the definitions of variants and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_delete", vec![ (Some(r##"variant-id"##), @@ -5751,7 +5815,11 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Gets a variant by ID. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Gets a variant by ID. + + For the definitions of variants and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_get", vec![ (Some(r##"variant-id"##), @@ -5773,7 +5841,24 @@ fn main() { Some(false)), ]), ("import", - Some(r##"Creates variant data by asynchronously importing the provided information. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) The variants for import will be merged with any existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant, and Variant info fields are merged as specified in infoMergeConfig. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set."##), + Some(r##"Creates variant data by asynchronously importing the provided information. + + For the definitions of variant sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + The variants for import will be merged with any existing variant that + matches its reference sequence, start, end, reference bases, and + alternative bases. If no such variant exists, a new one will be created. + + When variants are merged, the call information from the new variant + is added to the existing variant, and Variant info fields are merged + as specified in + infoMergeConfig. + As a special case, for single-sample VCF files, QUAL and FILTER fields will + be moved to the call level; these are sometimes interpreted in a + call-specific context. + Imported VCF headers are appended to the metadata already in a variant set."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_import", vec![ (Some(r##"kv"##), @@ -5795,7 +5880,97 @@ fn main() { Some(false)), ]), ("merge", - Some(r##"Merges the given variants with existing variants. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant. Variant info fields are merged as specified in the infoMergeConfig field of the MergeVariantsRequest. Please exercise caution when using this method! It is easy to introduce mistakes in existing variants and difficult to back out of them. For example, suppose you were trying to merge a new variant with an existing one and both variants contain calls that belong to callsets with the same callset ID. // Existing variant - irrelevant fields trimmed for clarity { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 0, 1 ], } ] } // New variant with conflicting call information { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 1, 1 ], } ] } The resulting merged variant would overwrite the existing calls with those from the new variant: { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 1, 1 ], } ] } This may be the desired outcome, but it is up to the user to determine if if that is indeed the case."##), + Some(r##"Merges the given variants with existing variants. + + For the definitions of variants and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Each variant will be + merged with an existing variant that matches its reference sequence, + start, end, reference bases, and alternative bases. If no such variant + exists, a new one will be created. + + When variants are merged, the call information from the new variant + is added to the existing variant. Variant info fields are merged as + specified in the + infoMergeConfig + field of the MergeVariantsRequest. + + Please exercise caution when using this method! It is easy to introduce + mistakes in existing variants and difficult to back out of them. For + example, + suppose you were trying to merge a new variant with an existing one and + both + variants contain calls that belong to callsets with the same callset ID. + + // Existing variant - irrelevant fields trimmed for clarity + { + "variantSetId": "10473108253681171589", + "referenceName": "1", + "start": "10582", + "referenceBases": "G", + "alternateBases": [ + "A" + ], + "calls": [ + { + "callSetId": "10473108253681171589-0", + "callSetName": "CALLSET0", + "genotype": [ + 0, + 1 + ], + } + ] + } + + // New variant with conflicting call information + { + "variantSetId": "10473108253681171589", + "referenceName": "1", + "start": "10582", + "referenceBases": "G", + "alternateBases": [ + "A" + ], + "calls": [ + { + "callSetId": "10473108253681171589-0", + "callSetName": "CALLSET0", + "genotype": [ + 1, + 1 + ], + } + ] + } + + The resulting merged variant would overwrite the existing calls with those + from the new variant: + + { + "variantSetId": "10473108253681171589", + "referenceName": "1", + "start": "10582", + "referenceBases": "G", + "alternateBases": [ + "A" + ], + "calls": [ + { + "callSetId": "10473108253681171589-0", + "callSetName": "CALLSET0", + "genotype": [ + 1, + 1 + ], + } + ] + } + + This may be the desired outcome, but it is up to the user to determine if + if that is indeed the case."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_merge", vec![ (Some(r##"kv"##), @@ -5817,7 +5992,14 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates a variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics. Returns the modified variant without its calls."##), + Some(r##"Updates a variant. + + For the definitions of variants and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + This method supports patch semantics. Returns the modified variant without + its calls."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_patch", vec![ (Some(r##"variant-id"##), @@ -5845,7 +6027,14 @@ fn main() { Some(false)), ]), ("search", - Some(r##"Gets a list of variants matching the criteria. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126)."##), + Some(r##"Gets a list of variants matching the criteria. + + For the definitions of variants and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Implements + [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126)."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_search", vec![ (Some(r##"kv"##), @@ -5860,28 +6049,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("stream", - Some(r##"Returns a stream of all the variants matching the search request, ordered by reference name, position, and ID."##), - "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variants_stream", - 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"##), @@ -5892,7 +6059,15 @@ fn main() { ("variantsets", "methods: 'create', 'delete', 'export', 'get', 'patch' and 'search'", vec![ ("create", - Some(r##"Creates a new variant set. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) The provided variant set must have a valid `datasetId` set - all other fields are optional. Note that the `id` field will be ignored, as this is assigned by the server."##), + Some(r##"Creates a new variant set. + + For the definitions of variant sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + The provided variant set must have a valid `datasetId` set - all other + fields are optional. Note that the `id` field will be ignored, as this is + assigned by the server."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_create", vec![ (Some(r##"kv"##), @@ -5914,7 +6089,12 @@ fn main() { Some(false)), ]), ("delete", - Some(r##"Deletes a variant set including all variants, call sets, and calls within. This is not reversible. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Deletes a variant set including all variants, call sets, and calls within. + This is not reversible. + + For the definitions of variant sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_delete", vec![ (Some(r##"variant-set-id"##), @@ -5936,12 +6116,17 @@ fn main() { Some(false)), ]), ("export", - Some(r##"Exports variant set data to an external destination. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Exports variant set data to an external destination. + + For the definitions of variant sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_export", vec![ (Some(r##"variant-set-id"##), None, - Some(r##"Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set."##), + Some(r##"Required. The ID of the variant set that contains variant data which + should be exported. The caller must have READ access to this variant set."##), Some(true), Some(false)), @@ -5964,7 +6149,11 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Gets a variant set by ID. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Gets a variant set by ID. + + For the definitions of variant sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_get", vec![ (Some(r##"variant-set-id"##), @@ -5986,7 +6175,11 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"Updates a variant set using patch semantics. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), + Some(r##"Updates a variant set using patch semantics. + + For the definitions of variant sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics)"##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_patch", vec![ (Some(r##"variant-set-id"##), @@ -6014,7 +6207,14 @@ fn main() { Some(false)), ]), ("search", - Some(r##"Returns a list of all variant sets matching search criteria. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49)."##), + Some(r##"Returns a list of all variant sets matching search criteria. + + For the definitions of variant sets and other genomics resources, see + [Fundamentals of Google + Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + + Implements + [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49)."##), "Details at http://byron.github.io/google-apis-rs/google_genomics1_cli/variantsets_search", vec![ (Some(r##"kv"##), @@ -6041,8 +6241,8 @@ fn main() { let mut app = App::new("genomics1") .author("Sebastian Thiel ") - .version("1.0.4+20160928") - .about("Stores, processes, explores and shares genomic data.") + .version("1.0.4+20170520") + .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") .long("scope") diff --git a/gen/genomics1/Cargo.toml b/gen/genomics1/Cargo.toml index 6a3b057245..5a2e55e57c 100644 --- a/gen/genomics1/Cargo.toml +++ b/gen/genomics1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-genomics1" -version = "1.0.4+20160928" +version = "1.0.4+20170520" 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.4+20160928" +homepage = "https://cloud.google.com/genomics" +documentation = "https://docs.rs/google-genomics1/1.0.4+20170520" license = "MIT" keywords = ["genomics", "google", "protocol", "web", "api"] diff --git a/gen/genomics1/README.md b/gen/genomics1/README.md index e16873f78a..6a1a26323f 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.4+20160928*, where *20160928* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *genomics* crate version *1.0.4+20170520*, where *20170520* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *genomics* *v1* API can be found at the -[official documentation site](https://cloud.google.com/genomics/). +[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.4+20160928/google_genomics1/struct.Genomics.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.Genomics.html) ... -* [annotations](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.Annotation.html) - * [*batch create*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationBatchCreateCall.html), [*create*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationGetCall.html), [*search*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationSearchCall.html) and [*update*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationUpdateCall.html) +* [annotations](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.Annotation.html) + * [*batch create*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationBatchCreateCall.html), [*create*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationGetCall.html), [*search*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationSearchCall.html) and [*update*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationUpdateCall.html) * annotationsets - * [*create*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationsetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationsetGetCall.html), [*search*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationsetSearchCall.html) and [*update*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.AnnotationsetUpdateCall.html) + * [*create*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationsetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationsetGetCall.html), [*search*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationsetSearchCall.html) and [*update*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.AnnotationsetUpdateCall.html) * callsets - * [*create*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.CallsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.CallsetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.CallsetGetCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.CallsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.CallsetSearchCall.html) -* [datasets](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.Dataset.html) - * [*create*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.DatasetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.DatasetGetCall.html), [*get iam policy*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.DatasetGetIamPolicyCall.html), [*list*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.DatasetPatchCall.html), [*set iam policy*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.DatasetSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.DatasetTestIamPermissionCall.html) and [*undelete*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.DatasetUndeleteCall.html) -* [operations](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.Operation.html) - * [*cancel*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.OperationCancelCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.OperationListCall.html) + * [*create*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.CallsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.CallsetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.CallsetGetCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.CallsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.CallsetSearchCall.html) +* [datasets](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.Dataset.html) + * [*create*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.DatasetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.DatasetDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.DatasetGetCall.html), [*get iam policy*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.DatasetGetIamPolicyCall.html), [*list*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.DatasetListCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.DatasetPatchCall.html), [*set iam policy*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.DatasetSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.DatasetTestIamPermissionCall.html) and [*undelete*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.DatasetUndeleteCall.html) +* [operations](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.Operation.html) + * [*cancel*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.OperationCancelCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.OperationListCall.html) * readgroupsets - * [*coveragebuckets list*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReadgroupsetCoveragebucketListCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReadgroupsetDeleteCall.html), [*export*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReadgroupsetExportCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReadgroupsetGetCall.html), [*import*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReadgroupsetImportCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReadgroupsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReadgroupsetSearchCall.html) -* [reads](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.Read.html) - * [*search*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReadSearchCall.html) and [*stream*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReadStreamCall.html) -* [references](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.Reference.html) - * [*bases list*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReferenceBaseListCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReferenceGetCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReferenceSearchCall.html) + * [*coveragebuckets list*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReadgroupsetCoveragebucketListCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReadgroupsetDeleteCall.html), [*export*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReadgroupsetExportCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReadgroupsetGetCall.html), [*import*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReadgroupsetImportCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReadgroupsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReadgroupsetSearchCall.html) +* [reads](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.Read.html) + * [*search*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReadSearchCall.html) +* [references](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.Reference.html) + * [*bases list*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReferenceBaseListCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReferenceGetCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReferenceSearchCall.html) * referencesets - * [*get*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReferencesetGetCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.ReferencesetSearchCall.html) -* [variants](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.Variant.html) - * [*create*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantGetCall.html), [*import*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantImportCall.html), [*merge*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantMergeCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantPatchCall.html), [*search*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantSearchCall.html) and [*stream*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantStreamCall.html) + * [*get*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReferencesetGetCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.ReferencesetSearchCall.html) +* [variants](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.Variant.html) + * [*create*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantDeleteCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantGetCall.html), [*import*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantImportCall.html), [*merge*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantMergeCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantSearchCall.html) * variantsets - * [*create*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantsetDeleteCall.html), [*export*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantsetExportCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantsetGetCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/struct.VariantsetSearchCall.html) + * [*create*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantsetCreateCall.html), [*delete*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantsetDeleteCall.html), [*export*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantsetExportCall.html), [*get*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantsetGetCall.html), [*patch*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/struct.VariantsetPatchCall.html) and [*search*](https://docs.rs/google-genomics1/1.0.4+20170520/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.4+20160928/google_genomics1/struct.Genomics.html)** +* **[Hub](https://docs.rs/google-genomics1/1.0.4+20170520/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.4+20160928/google_genomics1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-genomics1/1.0.4+20170520/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.4+20160928/google_genomics1/trait.Part.html)** + * **[Parts](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-genomics1/1.0.4+20160928/google_genomics1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-genomics1/1.0.4+20170520/google_genomics1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -150,17 +150,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-genomics1/1.0.4+20160928/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.4+20170520/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.4+20160928/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.4+20170520/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.4+20160928/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.4+20170520/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.4+20160928/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.4+20170520/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")`. @@ -170,29 +170,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.4+20160928/google_genomics1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-genomics1/1.0.4+20160928/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.4+20170520/google_genomics1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-genomics1/1.0.4+20170520/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.4+20160928/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.4+20170520/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.4+20160928/google_genomics1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-genomics1/1.0.4+20160928/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.4+20170520/google_genomics1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-genomics1/1.0.4+20170520/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.4+20160928/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.4+20170520/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.4+20160928/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.4+20170520/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.4+20160928/google_genomics1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-genomics1/1.0.4+20170520/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 64ffd2b429..e1a493ecb5 100644 --- a/gen/genomics1/src/lib.rs +++ b/gen/genomics1/src/lib.rs @@ -2,10 +2,10 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *genomics* crate version *1.0.4+20160928*, where *20160928* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *genomics* crate version *1.0.4+20170520*, where *20170520* is the exact revision of the *genomics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *genomics* *v1* API can be found at the -//! [official documentation site](https://cloud.google.com/genomics/). +//! [official documentation site](https://cloud.google.com/genomics). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/genomics1). //! # Features //! @@ -24,13 +24,13 @@ //! * readgroupsets //! * [*coveragebuckets list*](struct.ReadgroupsetCoveragebucketListCall.html), [*delete*](struct.ReadgroupsetDeleteCall.html), [*export*](struct.ReadgroupsetExportCall.html), [*get*](struct.ReadgroupsetGetCall.html), [*import*](struct.ReadgroupsetImportCall.html), [*patch*](struct.ReadgroupsetPatchCall.html) and [*search*](struct.ReadgroupsetSearchCall.html) //! * [reads](struct.Read.html) -//! * [*search*](struct.ReadSearchCall.html) and [*stream*](struct.ReadStreamCall.html) +//! * [*search*](struct.ReadSearchCall.html) //! * [references](struct.Reference.html) //! * [*bases list*](struct.ReferenceBaseListCall.html), [*get*](struct.ReferenceGetCall.html) and [*search*](struct.ReferenceSearchCall.html) //! * referencesets //! * [*get*](struct.ReferencesetGetCall.html) and [*search*](struct.ReferencesetSearchCall.html) //! * [variants](struct.Variant.html) -//! * [*create*](struct.VariantCreateCall.html), [*delete*](struct.VariantDeleteCall.html), [*get*](struct.VariantGetCall.html), [*import*](struct.VariantImportCall.html), [*merge*](struct.VariantMergeCall.html), [*patch*](struct.VariantPatchCall.html), [*search*](struct.VariantSearchCall.html) and [*stream*](struct.VariantStreamCall.html) +//! * [*create*](struct.VariantCreateCall.html), [*delete*](struct.VariantDeleteCall.html), [*get*](struct.VariantGetCall.html), [*import*](struct.VariantImportCall.html), [*merge*](struct.VariantMergeCall.html), [*patch*](struct.VariantPatchCall.html) and [*search*](struct.VariantSearchCall.html) //! * variantsets //! * [*create*](struct.VariantsetCreateCall.html), [*delete*](struct.VariantsetDeleteCall.html), [*export*](struct.VariantsetExportCall.html), [*get*](struct.VariantsetGetCall.html), [*patch*](struct.VariantsetPatchCall.html) and [*search*](struct.VariantsetSearchCall.html) //! @@ -205,7 +205,7 @@ // 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 +// 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)] @@ -250,8 +250,8 @@ 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 { - /// Manage your data in Google Cloud Storage - DevstorageReadWrite, + /// View and manage Genomics data + Full, /// View Genomics data Readonly, @@ -259,8 +259,8 @@ pub enum Scope { /// View and manage your data across Google Cloud Platform services CloudPlatform, - /// View and manage Genomics data - Full, + /// Manage your data in Google Cloud Storage + DevstorageReadWrite, /// View and manage your data in Google BigQuery Bigquery, @@ -269,10 +269,10 @@ pub enum Scope { impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { - Scope::DevstorageReadWrite => "https://www.googleapis.com/auth/devstorage.read_write", + Scope::Full => "https://www.googleapis.com/auth/genomics", Scope::Readonly => "https://www.googleapis.com/auth/genomics.readonly", Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", - Scope::Full => "https://www.googleapis.com/auth/genomics", + Scope::DevstorageReadWrite => "https://www.googleapis.com/auth/devstorage.read_write", Scope::Bigquery => "https://www.googleapis.com/auth/bigquery", } } @@ -353,8 +353,6 @@ pub struct Genomics { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Genomics {} @@ -367,8 +365,6 @@ impl<'a, C, A> Genomics client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://genomics.googleapis.com/".to_string(), - _root_url: "https://genomics.googleapis.com/".to_string(), } } @@ -415,65 +411,29 @@ impl<'a, C, A> Genomics self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://genomics.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://genomics.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // 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*). -/// -/// * [stream variants](struct.VariantStreamCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StreamVariantsResponse { - /// no description provided - pub variants: Option>, -} - -impl ResponseResult for StreamVariantsResponse {} - - /// 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 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 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 OMIM id for this condition. + /// Search for these IDs at http://omim.org/ + #[serde(rename="omimId")] + pub omim_id: Option, + /// The MedGen concept id associated with this gene. + /// Search for these IDs at http://www.ncbi.nlm.nih.gov/medgen/ + #[serde(rename="conceptId")] + pub concept_id: Option, /// A set of names for the condition. pub names: Option>, } @@ -492,13 +452,17 @@ impl Part for ClinicalCondition {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchVariantSetsRequest { - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. #[serde(rename="pageToken")] pub page_token: Option, - /// Exactly one dataset ID must be provided here. Only variant sets which belong to this dataset will be returned. + /// Exactly one dataset ID must be provided here. Only variant sets which + /// belong to this dataset will be returned. #[serde(rename="datasetIds")] pub dataset_ids: Option>, - /// The maximum number of results to return in a single page. If unspecified, defaults to 1024. + /// The maximum number of results to return in a single page. If unspecified, + /// defaults to 1024. #[serde(rename="pageSize")] pub page_size: Option, } @@ -517,115 +481,88 @@ impl RequestValue for SearchVariantSetsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ExportReadGroupSetRequest { - /// 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. 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. + /// 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, + /// 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, } impl RequestValue for ExportReadGroupSetRequest {} -/// The read group set search request. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [search readgroupsets](struct.ReadgroupsetSearchCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SearchReadGroupSetsRequest { - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. - #[serde(rename="pageToken")] - pub page_token: Option, - /// Restricts this query to read group sets within the given datasets. At least one ID must be provided. - #[serde(rename="datasetIds")] - pub dataset_ids: Option>, - /// Only return read group sets for which a substring of the name matches this string. - pub name: Option, - /// The maximum number of results to return in a single page. If unspecified, defaults to 256. The maximum value is 1024. - #[serde(rename="pageSize")] - pub page_size: Option, -} - -impl RequestValue for SearchReadGroupSetsRequest {} - - -/// 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 VariantAnnotation { - /// Google annotation IDs of the transcripts affected by this variant. These should be provided when the variant is created. - #[serde(rename="transcriptIds")] - pub transcript_ids: Option>, - /// The alternate allele for this variant. If multiple alternate alleles exist at this location, create a separate variant for each one, as they may represent distinct conditions. - #[serde(rename="alternateBases")] - pub alternate_bases: Option, - /// Describes the clinical significance of a variant. It is adapted from the ClinVar controlled vocabulary for clinical significance described at: http://www.ncbi.nlm.nih.gov/clinvar/docs/clinsig/ - #[serde(rename="clinicalSignificance")] - pub clinical_significance: Option, - /// The set of conditions associated with this variant. A condition describes the way a variant influences human health. - pub conditions: Option>, - /// Type has been adapted from ClinVar's list of variant types. - #[serde(rename="type")] - pub type_: Option, - /// Effect of the variant on the coding sequence. - pub effect: Option, - /// Google annotation ID of the gene affected by this variant. This should be provided when the variant is created. - #[serde(rename="geneId")] - pub gene_id: Option, -} - -impl Part for VariantAnnotation {} - - -/// 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 Entry { - /// The creation status. - pub status: Option, - /// The created annotation, if creation was successful. - pub annotation: Option, -} - -impl Part for Entry {} - - /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Program { + /// The 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, /// The version of the program run. pub version: Option, - /// The user specified locally unique ID of the program. Used along with `prevProgramId` to define an ordering between programs. + /// The user specified locally unique ID of the program. Used along with + /// `prevProgramId` to define an ordering between programs. pub id: Option, - /// The display name of the program. This is typically the colloquial name of the tool used, for example 'bwa' or 'picard'. + /// 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 {} +/// 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 VariantAnnotation { + /// Google annotation IDs of the transcripts affected by this variant. These + /// should be provided when the variant is created. + #[serde(rename="transcriptIds")] + pub transcript_ids: Option>, + /// The alternate allele for this variant. If multiple alternate alleles + /// exist at this location, create a separate variant for each one, as they + /// may represent distinct conditions. + #[serde(rename="alternateBases")] + pub alternate_bases: Option, + /// Describes the clinical significance of a variant. + /// It is adapted from the ClinVar controlled vocabulary for clinical + /// significance described at: + /// http://www.ncbi.nlm.nih.gov/clinvar/docs/clinsig/ + #[serde(rename="clinicalSignificance")] + pub clinical_significance: Option, + /// The set of conditions associated with this variant. + /// A condition describes the way a variant influences human health. + pub conditions: Option>, + /// Type has been adapted from ClinVar's list of variant types. + #[serde(rename="type")] + pub type_: Option, + /// Effect of the variant on the coding sequence. + pub effect: Option, + /// Google annotation ID of the gene affected by this variant. This should + /// be provided when the variant is created. + #[serde(rename="geneId")] + pub gene_id: Option, +} + +impl Part for VariantAnnotation {} + + /// The variant data import request. /// /// # Activities @@ -640,23 +577,44 @@ pub struct ImportVariantsRequest { /// Required. The variant set to which variant data should be imported. #[serde(rename="variantSetId")] pub variant_set_id: Option, - /// The format of the variant data being imported. If unspecified, defaults to to `VCF`. - pub format: Option, - /// A list of URIs referencing variant files in Google Cloud Storage. URIs can include wildcards [as described here](https://cloud.google.com/storage/docs/gsutil/addlhelp/WildcardNames). Note that recursive wildcards ('**') are not supported. - #[serde(rename="sourceUris")] - pub source_uris: Option>, - /// A mapping between info field keys and the InfoMergeOperations to be performed on them. This is plumbed down to the MergeVariantRequests 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". + /// 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). + /// Note that recursive wildcards ('**') are not supported. + #[serde(rename="sourceUris")] + pub source_uris: Option>, + /// A mapping between info field keys and the InfoMergeOperations to + /// be performed on them. This is plumbed down to the MergeVariantRequests + /// generated by the resulting import job. + #[serde(rename="infoMergeConfig")] + pub info_merge_config: Option>, + /// The format of the variant data being imported. If unspecified, defaults to + /// to `VCF`. + pub format: Option, } impl RequestValue for ImportVariantsRequest {} -/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`. +/// 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 /// @@ -679,17 +637,71 @@ 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` which can be used for common error conditions. # Language mapping The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and the `Status` message can be used in a variety of environments, either with or without APIs, to provide 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 purpose. - Batch operations. If a client uses batch request and batch response, the `Status` message should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the `Status` message. - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any stripping needed for security/privacy reasons. +/// 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. + /// 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 will be a common set of message types for APIs to use. + /// A list of messages that carry the error details. There will be a + /// common set of message types for APIs to use. pub details: Option>>, } @@ -707,13 +719,21 @@ impl Part for Status {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListCoverageBucketsResponse { - /// The coverage buckets. The list of buckets is sparse; a bucket with 0 overlapping reads is not returned. A bucket never crosses more than one reference sequence. Each bucket has width `bucketWidth`, unless its end is the end of the reference sequence. - #[serde(rename="coverageBuckets")] - pub coverage_buckets: Option>, - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// The length of each coverage bucket in base pairs. Note that buckets at the end of a reference sequence may be shorter. This value is omitted if the bucket width is infinity (the default behaviour, with no range or `targetBucketWidth`). + /// 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 length of each coverage bucket in base pairs. Note that buckets at the + /// end of a reference sequence may be shorter. This value is omitted if the + /// bucket width is infinity (the default behaviour, with no range or + /// `targetBucketWidth`). #[serde(rename="bucketWidth")] pub bucket_width: Option, } @@ -732,7 +752,8 @@ impl ResponseResult for ListCoverageBucketsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. pub permissions: Option>, } @@ -750,7 +771,9 @@ impl ResponseResult for TestIamPermissionsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchAnnotationsResponse { - /// 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. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The matching annotations. @@ -760,26 +783,57 @@ pub struct SearchAnnotationsResponse { impl ResponseResult for SearchAnnotationsResponse {} -/// A transcript represents the assertion that a particular region of the reference genome may be transcribed as RNA. +/// A transcript represents the assertion that a particular region of the +/// reference genome may be transcribed as RNA. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Transcript { - /// The range of the coding sequence for this transcript, if any. To determine the exact ranges of coding sequence, intersect this range with those of the exons, if any. If there are any exons, the codingSequence must start and end within them. Note that in some cases, the reference genome will not exactly match the observed mRNA transcript e.g. due to variance in the source genome from reference. In these cases, exon.frame will not necessarily match the expected reference reading frame and coding exon reference bases cannot necessarily be concatenated to produce the original transcript mRNA. + /// The range of the coding sequence for this transcript, if any. To determine + /// the exact ranges of coding sequence, intersect this range with those of the + /// exons, if any. If there are any + /// exons, the + /// codingSequence must start + /// and end within them. + /// + /// Note that in some cases, the reference genome will not exactly match the + /// observed mRNA transcript e.g. due to variance in the source genome from + /// reference. In these cases, + /// exon.frame will not necessarily + /// match the expected reference reading frame and coding exon reference bases + /// cannot necessarily be concatenated to produce the original transcript mRNA. #[serde(rename="codingSequence")] pub coding_sequence: Option, + /// The exons that compose + /// this transcript. This field should be unset for genomes where transcript + /// splicing does not occur, for example prokaryotes. + /// + /// Introns are regions of the transcript that are not included in the + /// spliced RNA product. Though not explicitly modeled here, intron ranges can + /// be deduced; all regions of this transcript that are not exons are introns. + /// + /// Exonic sequences do not necessarily code for a translational product + /// (amino acids). Only the regions of exons bounded by the + /// codingSequence correspond + /// to coding DNA sequence. + /// + /// 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, - /// The exons that compose this transcript. This field should be unset for genomes where transcript splicing does not occur, for example prokaryotes. Introns are regions of the transcript that are not included in the spliced RNA product. Though not explicitly modeled here, intron ranges can be deduced; all regions of this transcript that are not exons are introns. Exonic sequences do not necessarily code for a translational product (amino acids). Only the regions of exons bounded by the codingSequence correspond to coding DNA sequence. Exons are ordered by start position and may not overlap. - pub exons: Option>, } impl Part for Transcript {} -/// An annotation describes a region of reference genome. The value of an annotation may be one of several canonical types, supplemented by arbitrary info tags. An annotation is not inherently associated with a specific sample or individual (though a client could choose to use annotations in this way). Example canonical annotation types are `GENE` and `VARIANT`. +/// An annotation describes a region of reference genome. The value of an +/// annotation may be one of several canonical types, supplemented by arbitrary +/// info tags. An annotation is not inherently associated with a specific +/// sample or individual (though a client could choose to use annotations in +/// this way). Example canonical annotation types are `GENE` and +/// `VARIANT`. /// /// # Activities /// @@ -795,7 +849,8 @@ impl Part for Transcript {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Annotation { - /// A map of additional read alignment information. This must be of the form map (string key mapping to a list of string values). + /// A map of additional read alignment information. This must be of the form + /// map (string key mapping to a list of string values). pub info: Option>>, /// The ID of the Google Genomics reference associated with this range. #[serde(rename="referenceId")] @@ -804,24 +859,34 @@ pub struct Annotation { pub end: Option, /// The display name of this annotation. pub name: 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 of type `VARIANT`. + /// 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, + /// 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 + /// of type `VARIANT`. pub variant: Option, /// The start position of the range on the reference, 0-based inclusive. pub start: Option, /// The annotation set to which this annotation belongs. #[serde(rename="annotationSetId")] pub annotation_set_id: Option, - /// The display name corresponding to the reference specified by `referenceId`, for example `chr1`, `1`, or `chrX`. + /// The display name corresponding to the reference specified by + /// `referenceId`, for example `chr1`, `1`, or `chrX`. #[serde(rename="referenceName")] pub reference_name: Option, - /// Whether this range refers to the reverse strand, as opposed to the forward strand. Note that regardless of this field, the start/end position of the range always refer to the forward strand. + /// Whether this range refers to the reverse strand, as opposed to the forward + /// strand. Note that regardless of this field, the start/end position of the + /// range always refer to the forward strand. #[serde(rename="reverseStrand")] pub reverse_strand: 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, /// The server-generated annotation ID, unique across all annotations. pub id: Option, } @@ -862,7 +927,8 @@ pub struct MergeVariantsRequest { pub variant_set_id: Option, /// The variants to be merged with existing variants. pub variants: Option>, - /// A mapping between info field keys and the InfoMergeOperations to be performed on them. + /// A mapping between info field keys and the InfoMergeOperations to + /// be performed on them. #[serde(rename="infoMergeConfig")] pub info_merge_config: Option>, } @@ -870,26 +936,34 @@ pub struct MergeVariantsRequest { impl RequestValue for MergeVariantsRequest {} -/// Metadata describes a single piece of variant call metadata. These data include a top level key and either a single value string (value) or a list of key-value pairs (info.) Value and info are mutually exclusive. +/// Metadata describes a single piece of variant call metadata. +/// These data include a top level key and either a single value string (value) +/// or a list of key-value pairs (info.) +/// Value and info are mutually exclusive. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VariantSetMetadata { - /// Remaining structured metadata key-value pairs. This must be of the form map (string key mapping to a list of string values). + /// Remaining structured metadata key-value pairs. This must be of the form + /// map (string key mapping to a list of string values). pub info: Option>>, /// A textual description of this metadata. pub description: Option, /// The top-level key. pub key: Option, - /// The type of data. Possible types include: Integer, Float, Flag, Character, and String. + /// The type of data. Possible types include: Integer, Float, + /// Flag, Character, and String. #[serde(rename="type")] pub type_: Option, - /// The number of values that can be included in a field described by this metadata. + /// The number of values that can be included in a field described by this + /// metadata. pub number: Option, /// The value field for simple metadata pub value: Option, - /// User-provided ID field, not enforced by this API. Two or more pieces of structured metadata with identical id and key fields are considered equivalent. + /// User-provided ID field, not enforced by this API. + /// Two or more pieces of structured metadata with identical + /// id and key fields are considered equivalent. pub id: Option, } @@ -907,7 +981,17 @@ impl Part for VariantSetMetadata {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TestIamPermissionsRequest { - /// REQUIRED: The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. Allowed permissions are: * `genomics.datasets.create` * `genomics.datasets.delete` * `genomics.datasets.get` * `genomics.datasets.list` * `genomics.datasets.update` * `genomics.datasets.getIamPolicy` * `genomics.datasets.setIamPolicy` + /// REQUIRED: The set of permissions to check for the 'resource'. + /// Permissions with wildcards (such as '*' or 'storage.*') are not allowed. + /// Allowed permissions are: + /// + /// * `genomics.datasets.create` + /// * `genomics.datasets.delete` + /// * `genomics.datasets.get` + /// * `genomics.datasets.list` + /// * `genomics.datasets.update` + /// * `genomics.datasets.getIamPolicy` + /// * `genomics.datasets.setIamPolicy` pub permissions: Option>, } @@ -930,7 +1014,11 @@ pub struct ExternalId { impl Part for ExternalId {} -/// A call set is a collection of variant calls, typically for one sample. It belongs to a variant set. For more genomics resource definitions, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// A call set is a collection of variant calls, typically for one sample. It +/// belongs to a variant set. +/// +/// For more genomics resource definitions, see [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Activities /// @@ -943,9 +1031,14 @@ impl Part for ExternalId {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CallSet { - /// A map of additional call set information. This must be of the form map (string key mapping to a list of string values). + /// A map of additional call set information. This must be of the form + /// map (string key mapping to a list of string values). pub info: Option>>, - /// The IDs of the variant sets this call set belongs to. This field must have exactly length one, as a call set belongs to a single variant set. This field is repeated for compatibility with the [GA4GH 0.5.1 API](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variants.avdl#L76). + /// The IDs of the variant sets this call set belongs to. This field must + /// have exactly length one, as a call set belongs to a single variant set. + /// This field is repeated for compatibility with the + /// [GA4GH 0.5.1 + /// API](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variants.avdl#L76). #[serde(rename="variantSetIds")] pub variant_set_ids: Option>, /// The call set name. @@ -964,7 +1057,10 @@ impl Resource for CallSet {} impl ResponseResult for CallSet {} -/// An abstraction for referring to a genomic position, in relation to some already known reference. For now, represents a genomic position as a reference name, a base number on that reference (0-based), and a determination of forward or reverse strand. +/// An abstraction for referring to a genomic position, in relation to some +/// already known reference. For now, represents a genomic position as a +/// reference name, a base number on that reference (0-based), and a +/// determination of forward or reverse strand. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -972,7 +1068,8 @@ impl ResponseResult for CallSet {} pub struct Position { /// The 0-based offset from the start of the forward strand for that reference. pub position: Option, - /// Whether this position is on the reverse strand, as opposed to the forward strand. + /// Whether this position is on the reverse strand, as opposed to the forward + /// strand. #[serde(rename="reverseStrand")] pub reverse_strand: Option, /// The name of the reference in whatever reference set is being used. @@ -983,21 +1080,36 @@ pub struct Position { impl Part for Position {} -/// ReferenceBound records an upper bound for the starting coordinate of variants in a particular reference. +/// The call set search request. /// -/// 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*). +/// +/// * [search callsets](struct.CallsetSearchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ReferenceBound { - /// An upper bound (inclusive) on the starting coordinate of any variant in the reference sequence. - #[serde(rename="upperBound")] - pub upper_bound: Option, - /// The name of the reference associated with this reference bound. - #[serde(rename="referenceName")] - pub reference_name: Option, +pub struct SearchCallSetsRequest { + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. + #[serde(rename="pageToken")] + pub page_token: Option, + /// Restrict the query to call sets within the given variant sets. At least one + /// ID must be provided. + #[serde(rename="variantSetIds")] + pub variant_set_ids: Option>, + /// Only return call sets for which a substring of the name matches this + /// string. + pub name: Option, + /// The maximum number of results to return in a single page. If unspecified, + /// defaults to 1024. + #[serde(rename="pageSize")] + pub page_size: Option, } -impl Part for ReferenceBound {} +impl RequestValue for SearchCallSetsRequest {} /// There is no detailed description. @@ -1007,15 +1119,45 @@ impl Part for ReferenceBound {} /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [batch create annotations](struct.AnnotationBatchCreateCall.html) (response) +/// * [search annotations](struct.AnnotationSearchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BatchCreateAnnotationsResponse { - /// The resulting per-annotation entries, ordered consistently with the original request. - pub entries: Option>, +pub struct SearchAnnotationsRequest { + /// The start position of the range on the reference, 0-based inclusive. If + /// specified, + /// referenceId or + /// referenceName + /// must be specified. Defaults to 0. + pub start: Option, + /// The ID of the reference to query. + #[serde(rename="referenceId")] + pub reference_id: Option, + /// The end position of the range on the reference, 0-based exclusive. If + /// referenceId or + /// referenceName + /// must be specified, Defaults to the length of the reference. + pub end: Option, + /// The maximum number of results to return in a single page. If unspecified, + /// defaults to 256. The maximum value is 2048. + #[serde(rename="pageSize")] + pub page_size: Option, + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. + #[serde(rename="pageToken")] + pub page_token: Option, + /// The name of the reference to query, within the reference set associated + /// with this query. + #[serde(rename="referenceName")] + pub reference_name: Option, + /// Required. The annotation sets to search within. The caller must have + /// `READ` access to these annotation sets. + /// All queried annotation sets must have the same type. + #[serde(rename="annotationSetIds")] + pub annotation_set_ids: Option>, } -impl ResponseResult for BatchCreateAnnotationsResponse {} +impl RequestValue for SearchAnnotationsRequest {} /// The dataset list response. @@ -1029,7 +1171,9 @@ impl ResponseResult for BatchCreateAnnotationsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListDatasetsResponse { - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The list of matching Datasets. @@ -1050,16 +1194,30 @@ 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. + /// 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. + /// A list of URIs pointing at [BAM + /// files](https://samtools.github.io/hts-specs/SAMv1.pdf) + /// in Google Cloud Storage. + /// Those URIs can include wildcards (*), but do not add or remove + /// matching files before import has completed. + /// + /// Note that Google Cloud Storage object listing is only eventually + /// consistent: files added may be not be immediately visible to + /// everyone. Thus, if using a wildcard it is preferable not to start + /// the import immediately after the files are created. #[serde(rename="sourceUris")] pub source_uris: Option>, - /// The partition strategy describes how read groups are partitioned into read group sets. + /// The partition strategy describes how read groups are partitioned into read + /// group sets. #[serde(rename="partitionStrategy")] pub partition_strategy: Option, - /// Required. The ID of the dataset these read group sets will belong to. The caller must have WRITE permissions to this dataset. + /// Required. The ID of the dataset these read group sets will belong to. The + /// caller must have WRITE permissions to this dataset. #[serde(rename="datasetId")] pub dataset_id: Option, } @@ -1067,7 +1225,13 @@ pub struct ImportReadGroupSetsRequest { impl RequestValue for ImportReadGroupSetsRequest {} -/// A reference is a canonical assembled DNA sequence, intended to act as a reference coordinate space for other genomic annotations. A single reference might represent the human chromosome 1 or mitochandrial DNA, for instance. A reference belongs to one or more reference sets. For more genomics resource definitions, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// A reference is a canonical assembled DNA sequence, intended to act as a +/// reference coordinate space for other genomic annotations. A single reference +/// might represent the human chromosome 1 or mitochandrial DNA, for instance. A +/// reference belongs to one or more reference sets. +/// +/// For more genomics resource definitions, see [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Activities /// @@ -1080,16 +1244,20 @@ 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. + /// MD5 of the upper-case sequence excluding all whitespace characters (this + /// is equivalent to SQ:M5 in SAM). This value is represented in lower case + /// hexadecimal format. pub md5checksum: Option, /// The length of this reference's sequence. pub length: Option, /// The name of this reference, for example `22`. pub name: Option, - /// The URI from which the sequence was obtained. Typically specifies a FASTA format file. + /// The URI from which the sequence was obtained. Typically specifies a FASTA + /// format file. #[serde(rename="sourceUri")] pub source_uri: Option, - /// All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally with a version number, for example `GCF_000001405.26`. + /// 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. @@ -1103,49 +1271,54 @@ impl Resource for Reference {} impl ResponseResult for Reference {} -/// The variant data export request. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [export variantsets](struct.VariantsetExportCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ExportVariantSetRequest { - /// Required. The Google Cloud project ID that owns the destination BigQuery dataset. The caller must have WRITE access to this project. This project will also own the resulting export job. - #[serde(rename="projectId")] - pub project_id: Option, - /// The format for the exported data. - pub format: Option, - /// Required. The BigQuery dataset to export data to. This dataset must already exist. Note that this is distinct from the Genomics concept of "dataset". - #[serde(rename="bigqueryDataset")] - pub bigquery_dataset: Option, - /// If provided, only variant call information from the specified call sets will be exported. By default all variant calls are exported. - #[serde(rename="callSetIds")] - pub call_set_ids: Option>, - /// Required. The BigQuery table to export data to. If the table doesn't exist, it will be created. If it already exists, it will be overwritten. - #[serde(rename="bigqueryTable")] - pub bigquery_table: Option, -} - -impl RequestValue for ExportVariantSetRequest {} - - -/// Associates `members` with a `role`. +/// A call represents the determination of genotype with respect to a particular +/// variant. It may include associated information such as quality and phasing. +/// For example, a call might assign a probability of 0.32 to the occurrence of +/// a SNP named rs1234 in a call set with the name NA12345. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Binding { - /// Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. Required - pub role: Option, - /// Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@gmail.com` or `joe@example.com`. * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`. * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`. * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`. - pub members: Option>, +pub struct VariantCall { + /// A map of additional variant call information. This must be of the form + /// map (string key mapping to a list of string values). + pub info: Option>>, + /// The genotype of this variant call. Each value represents either the value + /// of the `referenceBases` field or a 1-based index into + /// `alternateBases`. If a variant had a `referenceBases` + /// value of `T` and an `alternateBases` + /// value of `["A", "C"]`, and the `genotype` was + /// `[2, 1]`, that would mean the call + /// represented the heterozygous value `CA` for this variant. + /// If the `genotype` was instead `[0, 1]`, the + /// represented value would be `TA`. Ordering of the + /// genotype values is important if the `phaseset` is present. + /// If a genotype is not called (that is, a `.` is present in the + /// GT string) -1 is returned. + pub genotype: Option>, + /// The ID of the call set this variant call belongs to. + #[serde(rename="callSetId")] + pub call_set_id: Option, + /// If this field is present, this variant call's genotype ordering implies + /// the phase of the bases and is consistent with any other variant calls in + /// the same reference sequence which have the same phaseset value. + /// When importing data from VCF, if the genotype data was phased but no + /// phase set was specified this field will be set to `*`. + pub phaseset: Option, + /// The genotype likelihoods for this variant call. Each array entry + /// represents how likely a specific genotype is for this call. The value + /// ordering is defined by the GL tag in the VCF spec. + /// If Phred-scaled genotype likelihood scores (PL) are available and + /// log10(P) genotype likelihood scores (GL) are not, PL scores are converted + /// to GL scores. If both are available, PL scores are stored in `info`. + #[serde(rename="genotypeLikelihood")] + pub genotype_likelihood: Option>, + /// The name of the call set this variant call belongs to. + #[serde(rename="callSetName")] + pub call_set_name: Option, } -impl Part for Binding {} +impl Part for VariantCall {} /// There is no detailed description. @@ -1159,17 +1332,24 @@ impl Part for Binding {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchReferencesRequest { - /// If present, return references for which the md5checksum matches exactly. + /// If present, return references for which the + /// md5checksum matches exactly. pub md5checksums: Option>, - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. #[serde(rename="pageToken")] pub page_token: Option, /// If present, return only references which belong to this reference set. #[serde(rename="referenceSetId")] pub reference_set_id: Option, - /// If present, return references for which a prefix of any of sourceAccessions match any of these strings. Accession numbers typically have a main number and a version, for example `GCF_000001405.26`. + /// If present, return references for which a prefix of any of + /// sourceAccessions match + /// any of these strings. Accession numbers typically have a main number and a + /// version, for example `GCF_000001405.26`. pub accessions: Option>, - /// The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 4096. + /// The maximum number of results to return in a single page. If unspecified, + /// defaults to 1024. The maximum value is 4096. #[serde(rename="pageSize")] pub page_size: Option, } @@ -1186,13 +1366,19 @@ pub struct Experiment { /// The sequencing center used as part of this experiment. #[serde(rename="sequencingCenter")] pub sequencing_center: Option, - /// A client-supplied library identifier; a library is a collection of DNA fragments which have been prepared for sequencing from a sample. This field is important for quality control as error or bias can be introduced during sample preparation. + /// A client-supplied library identifier; a library is a collection of DNA + /// fragments which have been prepared for sequencing from a sample. This + /// field is important for quality control as error or bias can be introduced + /// during sample preparation. #[serde(rename="libraryId")] pub library_id: Option, - /// The instrument model used as part of this experiment. This maps to sequencing technology in the SAM spec. + /// The instrument model used as part of this experiment. This maps to + /// sequencing technology in the SAM spec. #[serde(rename="instrumentModel")] pub instrument_model: Option, - /// The platform unit used as part of this experiment, for example flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the @RG PU field in the SAM spec. + /// The platform unit used as part of this experiment, for example + /// flowcell-barcode.lane for Illumina or slide for SOLiD. Corresponds to the + /// @RG PU field in the SAM spec. #[serde(rename="platformUnit")] pub platform_unit: Option, } @@ -1206,14 +1392,19 @@ impl Part for Experiment {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ReadGroup { - /// A map of additional read group information. This must be of the form map (string key mapping to a list of string values). + /// A map of additional read group information. This must be of the form + /// map (string key mapping to a list of string values). pub info: Option>>, - /// The predicted insert size of this read group. The insert size is the length the sequenced DNA fragment from end-to-end, not including the adapters. + /// The predicted insert size of this read group. The insert size is the length + /// the sequenced DNA fragment from end-to-end, not including the adapters. #[serde(rename="predictedInsertSize")] pub predicted_insert_size: Option, - /// A free-form text description of this read group. - pub description: Option, - /// The programs used to generate this read group. Programs are always identical for all read groups within a read group set. For this reason, only the first read group in a returned set will have this field populated. + /// The read group name. This corresponds to the @RG ID field in the SAM spec. + pub name: Option, + /// The programs used to generate this read group. Programs are always + /// identical for all read groups within a read group set. For this reason, + /// only the first read group in a returned set will have this field + /// populated. pub programs: Option>, /// A client-supplied sample identifier for the reads in this read group. #[serde(rename="sampleId")] @@ -1223,13 +1414,15 @@ pub struct ReadGroup { /// The reference set the reads in this read group are aligned to. #[serde(rename="referenceSetId")] pub reference_set_id: Option, - /// The server-generated read group ID, unique for all read groups. Note: This is different than the @RG ID field in the SAM spec. For that value, see name. + /// The server-generated read group ID, unique for all read groups. + /// Note: This is different than the @RG ID field in the SAM spec. For that + /// value, see name. pub id: Option, /// The dataset to which this read group belongs. #[serde(rename="datasetId")] pub dataset_id: Option, - /// The read group name. This corresponds to the @RG ID field in the SAM spec. - pub name: Option, + /// A free-form text description of this read group. + pub description: Option, } impl Part for ReadGroup {} @@ -1246,7 +1439,9 @@ impl Part for ReadGroup {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchReadGroupSetsResponse { - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The list of matching read group sets. @@ -1257,7 +1452,8 @@ pub struct SearchReadGroupSetsResponse { impl ResponseResult for SearchReadGroupSetsResponse {} -/// This resource represents a long-running operation that is the result of a network API call. +/// This resource represents a long-running operation that is the result of a +/// network API call. /// /// # Activities /// @@ -1276,11 +1472,13 @@ impl ResponseResult for SearchReadGroupSetsResponse {} pub struct Operation { /// An OperationMetadata object. This will always be returned with the Operation. 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. + /// 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, - /// If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If importing Variants, an ImportVariantsResponse is returned. For exports, an empty response is returned. + /// If importing ReadGroupSets, an ImportReadGroupSetsResponse is returned. If importing Variants, an ImportVariantsResponse is returned. For pipelines and exports, an empty response is returned. pub response: Option>, - /// The server-assigned name, which is only unique within the same service that originally returns it. For example: `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` + /// The server-assigned name, which is only unique within the same service that originally returns it. For example: `operations/CJHU7Oi_ChDrveSpBRjfuL-qzoWAgEw` pub name: Option, /// The error result of the operation in case of failure or cancellation. pub error: Option, @@ -1290,31 +1488,36 @@ impl Resource for Operation {} impl ResponseResult for Operation {} -/// The call set search request. +/// The read group set search request. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [search callsets](struct.CallsetSearchCall.html) (request) +/// * [search readgroupsets](struct.ReadgroupsetSearchCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SearchCallSetsRequest { - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. +pub struct SearchReadGroupSetsRequest { + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. #[serde(rename="pageToken")] pub page_token: Option, - /// Restrict the query to call sets within the given variant sets. At least one ID must be provided. - #[serde(rename="variantSetIds")] - pub variant_set_ids: Option>, - /// Only return call sets for which a substring of the name matches this string. + /// Restricts this query to read group sets within the given datasets. At least + /// one ID must be provided. + #[serde(rename="datasetIds")] + pub dataset_ids: Option>, + /// Only return read group sets for which a substring of the name matches this + /// string. pub name: Option, - /// The maximum number of results to return in a single page. If unspecified, defaults to 1024. + /// The maximum number of results to return in a single page. If unspecified, + /// defaults to 256. The maximum value is 1024. #[serde(rename="pageSize")] pub page_size: Option, } -impl RequestValue for SearchCallSetsRequest {} +impl RequestValue for SearchReadGroupSetsRequest {} /// Request message for `SetIamPolicy` method. @@ -1328,37 +1531,54 @@ impl RequestValue for SearchCallSetsRequest {} /// #[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. + /// REQUIRED: The complete policy to be applied to the `resource`. The size of + /// the policy is limited to a few 10s of KB. An empty policy is a + /// valid policy but certain Cloud Platform services (such as Projects) + /// might reject them. pub policy: Option, } impl RequestValue for SetIamPolicyRequest {} -/// A call represents the determination of genotype with respect to a particular variant. It may include associated information such as quality and phasing. For example, a call might assign a probability of 0.32 to the occurrence of a SNP named rs1234 in a call set with the name NA12345. +/// Associates `members` with a `role`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct VariantCall { - /// A map of additional variant call information. This must be of the form map (string key mapping to a list of string values). - pub info: Option>>, - /// The genotype of this variant call. Each value represents either the value of the `referenceBases` field or a 1-based index into `alternateBases`. If a variant had a `referenceBases` value of `T` and an `alternateBases` value of `["A", "C"]`, and the `genotype` was `[2, 1]`, that would mean the call represented the heterozygous value `CA` for this variant. If the `genotype` was instead `[0, 1]`, the represented value would be `TA`. Ordering of the genotype values is important if the `phaseset` is present. If a genotype is not called (that is, a `.` is present in the GT string) -1 is returned. - pub genotype: Option>, - /// The ID of the call set this variant call belongs to. - #[serde(rename="callSetId")] - pub call_set_id: Option, - /// If this field is present, this variant call's genotype ordering implies the phase of the bases and is consistent with any other variant calls in the same reference sequence which have the same phaseset value. When importing data from VCF, if the genotype data was phased but no phase set was specified this field will be set to `*`. - pub phaseset: Option, - /// The genotype likelihoods for this variant call. Each array entry represents how likely a specific genotype is for this call. The value ordering is defined by the GL tag in the VCF spec. If Phred-scaled genotype likelihood scores (PL) are available and log10(P) genotype likelihood scores (GL) are not, PL scores are converted to GL scores. If both are available, PL scores are stored in `info`. - #[serde(rename="genotypeLikelihood")] - pub genotype_likelihood: Option>, - /// The name of the call set this variant call belongs to. - #[serde(rename="callSetName")] - pub call_set_name: Option, +pub struct Binding { + /// Role that is assigned to `members`. + /// For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + /// Required + pub role: Option, + /// Specifies the identities requesting access for a Cloud Platform resource. + /// `members` can have the following values: + /// + /// * `allUsers`: A special identifier that represents anyone who is + /// on the internet; with or without a Google account. + /// + /// * `allAuthenticatedUsers`: A special identifier that represents anyone + /// who is authenticated with a Google account or a service account. + /// + /// * `user:{emailid}`: An email address that represents a specific Google + /// account. For example, `alice@gmail.com` or `joe@example.com`. + /// + /// + /// * `serviceAccount:{emailid}`: An email address that represents a service + /// account. For example, `my-other-app@appspot.gserviceaccount.com`. + /// + /// * `group:{emailid}`: An email address that represents a Google group. + /// For example, `admins@example.com`. + /// + /// + /// * `domain:{domain}`: A Google Apps domain name that represents all the + /// users of that domain. For example, `google.com` or `example.com`. + /// + /// + pub members: Option>, } -impl Part for VariantCall {} +impl Part for Binding {} /// There is no detailed description. @@ -1372,19 +1592,72 @@ impl Part for VariantCall {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListBasesResponse { - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// The offset position (0-based) of the given `sequence` from the start of this `Reference`. This value will differ for each page in a paginated request. - pub offset: Option, /// A substring of the bases that make up this reference. pub sequence: Option, + /// 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, } impl ResponseResult for ListBasesResponse {} -/// 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). +/// ReferenceBound records an upper bound for the starting coordinate of +/// variants in a particular reference. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReferenceBound { + /// An upper bound (inclusive) on the starting coordinate of any + /// variant in the reference sequence. + #[serde(rename="upperBound")] + pub upper_bound: Option, + /// The name of the reference associated with this reference bound. + #[serde(rename="referenceName")] + pub reference_name: Option, +} + +impl Part for ReferenceBound {} + + +/// Defines an Identity and Access Management (IAM) policy. It is used to +/// specify access control policies for Cloud Platform resources. +/// +/// +/// 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 /// @@ -1396,12 +1669,23 @@ impl ResponseResult for ListBasesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. + /// Multiple `bindings` must not be specified for the same `role`. + /// `bindings` with no members will result in an error. pub bindings: Option>, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// If no `etag` is provided in the call to `setIamPolicy`, then the existing + /// policy is overwritten blindly. + pub etag: Option, /// Version of the `Policy`. The default version is 0. pub version: Option, - /// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. - pub etag: Option, } impl ResponseResult for Policy {} @@ -1418,37 +1702,130 @@ impl ResponseResult for Policy {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchVariantsRequest { - /// The end of the window, 0-based exclusive. If unspecified or 0, defaults to the length of the reference. + /// The end of the window, 0-based exclusive. If unspecified or 0, defaults to + /// the length of the reference. pub end: Option, - /// The maximum number of variants to return in a single page. If unspecified, defaults to 5000. The maximum value is 10000. + /// The maximum number of variants to return in a single page. If unspecified, + /// defaults to 5000. The maximum value is 10000. #[serde(rename="pageSize")] pub page_size: Option, - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. #[serde(rename="pageToken")] pub page_token: Option, - /// The maximum number of calls to return in a single page. Note that this limit may be exceeded in the event that a matching variant contains more calls than the requested maximum. If unspecified, defaults to 5000. The maximum value is 10000. + /// The maximum number of calls to return in a single page. Note that this + /// limit may be exceeded in the event that a matching variant contains more + /// calls than the requested maximum. If unspecified, defaults to 5000. The + /// maximum value is 10000. #[serde(rename="maxCalls")] pub max_calls: Option, - /// The beginning of the window (0-based, inclusive) for which overlapping variants should be returned. If unspecified, defaults to 0. + /// The beginning of the window (0-based, inclusive) for which + /// overlapping variants should be returned. If unspecified, defaults to 0. pub start: Option, - /// Only return variant calls which belong to call sets with these ids. Leaving this blank returns all variant calls. If a variant has no calls belonging to any of these call sets, it won't be returned at all. - #[serde(rename="callSetIds")] - pub call_set_ids: Option>, + /// At most one variant set ID must be provided. Only variants from this + /// variant set will be returned. If omitted, a call set id must be included in + /// the request. + #[serde(rename="variantSetIds")] + pub variant_set_ids: Option>, /// Only return variants which have exactly this name. #[serde(rename="variantName")] pub variant_name: Option, /// Required. Only return variants in this reference sequence. #[serde(rename="referenceName")] pub reference_name: Option, - /// At most one variant set ID must be provided. Only variants from this variant set will be returned. If omitted, a call set id must be included in the request. - #[serde(rename="variantSetIds")] - pub variant_set_ids: Option>, + /// Only return variant calls which belong to call sets with these ids. + /// Leaving this blank returns all variant calls. If a variant has no + /// calls belonging to any of these call sets, it won't be returned at all. + #[serde(rename="callSetIds")] + pub call_set_ids: Option>, } impl RequestValue for SearchVariantsRequest {} -/// A read alignment describes a linear alignment of a string of DNA to a reference sequence, in addition to metadata about the fragment (the molecule of DNA sequenced) and the read (the bases which were read by the sequencer). A read is equivalent to a line in a SAM file. A read belongs to exactly one read group and exactly one read group set. For more genomics resource definitions, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) ### Reverse-stranded reads Mapped reads (reads having a non-null `alignment`) can be aligned to either the forward or the reverse strand of their associated reference. Strandedness of a mapped read is encoded by `alignment.position.reverseStrand`. If we consider the reference to be a forward-stranded coordinate space of `[0, reference.length)` with `0` as the left-most position and `reference.length` as the right-most position, reads are always aligned left to right. That is, `alignment.position.position` always refers to the left-most reference coordinate and `alignment.cigar` describes the alignment of this read to the reference from left to right. All per-base fields such as `alignedSequence` and `alignedQuality` share this same left-to-right orientation; this is true of reads which are aligned to either strand. For reverse-stranded reads, this means that `alignedSequence` is the reverse complement of the bases that were originally reported by the sequencing machine. ### Generating a reference-aligned sequence string When interacting with mapped reads, it's often useful to produce a string representing the local alignment of the read to reference. The following pseudocode demonstrates one way of doing this: out = "" offset = 0 for c in read.alignment.cigar { switch c.operation { case "ALIGNMENT_MATCH", "SEQUENCE_MATCH", "SEQUENCE_MISMATCH": out += read.alignedSequence[offset:offset+c.operationLength] offset += c.operationLength break case "CLIP_SOFT", "INSERT": offset += c.operationLength break case "PAD": out += repeat("*", c.operationLength) break case "DELETE": out += repeat("-", c.operationLength) break case "SKIP": out += repeat(" ", c.operationLength) break case "CLIP_HARD": break } } return out ### Converting to SAM's CIGAR string The following pseudocode generates a SAM CIGAR string from the `cigar` field. Note that this is a lossy conversion (`cigar.referenceSequence` is lost). cigarMap = { "ALIGNMENT_MATCH": "M", "INSERT": "I", "DELETE": "D", "SKIP": "N", "CLIP_SOFT": "S", "CLIP_HARD": "H", "PAD": "P", "SEQUENCE_MATCH": "=", "SEQUENCE_MISMATCH": "X", } cigarStr = "" for c in read.alignment.cigar { cigarStr += c.operationLength + cigarMap[c.operation] } return cigarStr +/// A read alignment describes a linear alignment of a string of DNA to a +/// reference sequence, in addition to metadata +/// about the fragment (the molecule of DNA sequenced) and the read (the bases +/// which were read by the sequencer). A read is equivalent to a line in a SAM +/// file. A read belongs to exactly one read group and exactly one +/// read group set. +/// +/// For more genomics resource definitions, see [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// ### Reverse-stranded reads +/// +/// Mapped reads (reads having a non-null `alignment`) can be aligned to either +/// the forward or the reverse strand of their associated reference. Strandedness +/// of a mapped read is encoded by `alignment.position.reverseStrand`. +/// +/// If we consider the reference to be a forward-stranded coordinate space of +/// `[0, reference.length)` with `0` as the left-most position and +/// `reference.length` as the right-most position, reads are always aligned left +/// to right. That is, `alignment.position.position` always refers to the +/// left-most reference coordinate and `alignment.cigar` describes the alignment +/// of this read to the reference from left to right. All per-base fields such as +/// `alignedSequence` and `alignedQuality` share this same left-to-right +/// orientation; this is true of reads which are aligned to either strand. For +/// reverse-stranded reads, this means that `alignedSequence` is the reverse +/// complement of the bases that were originally reported by the sequencing +/// machine. +/// +/// ### Generating a reference-aligned sequence string +/// +/// When interacting with mapped reads, it's often useful to produce a string +/// representing the local alignment of the read to reference. The following +/// pseudocode demonstrates one way of doing this: +/// +/// out = "" +/// offset = 0 +/// for c in read.alignment.cigar { +/// switch c.operation { +/// case "ALIGNMENT_MATCH", "SEQUENCE_MATCH", "SEQUENCE_MISMATCH": +/// out += read.alignedSequence[offset:offset+c.operationLength] +/// offset += c.operationLength +/// break +/// case "CLIP_SOFT", "INSERT": +/// offset += c.operationLength +/// break +/// case "PAD": +/// out += repeat("*", c.operationLength) +/// break +/// case "DELETE": +/// out += repeat("-", c.operationLength) +/// break +/// case "SKIP": +/// out += repeat(" ", c.operationLength) +/// break +/// case "CLIP_HARD": +/// break +/// } +/// } +/// return out +/// +/// ### Converting to SAM's CIGAR string +/// +/// The following pseudocode generates a SAM CIGAR string from the +/// `cigar` field. Note that this is a lossy conversion +/// (`cigar.referenceSequence` is lost). +/// +/// cigarMap = { +/// "ALIGNMENT_MATCH": "M", +/// "INSERT": "I", +/// "DELETE": "D", +/// "SKIP": "N", +/// "CLIP_SOFT": "S", +/// "CLIP_HARD": "H", +/// "PAD": "P", +/// "SEQUENCE_MATCH": "=", +/// "SEQUENCE_MISMATCH": "X", +/// } +/// cigarStr = "" +/// for c in read.alignment.cigar { +/// cigarStr += c.operationLength + cigarMap[c.operation] +/// } +/// return cigarStr /// /// # Activities /// @@ -1456,56 +1833,94 @@ impl RequestValue for SearchVariantsRequest {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [search reads](struct.ReadSearchCall.html) (none) -/// * [stream reads](struct.ReadStreamCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Read { - /// The ID of the read group set this read belongs to. A read belongs to exactly one read group set. + /// The ID of the read group set this read belongs to. A read belongs to + /// exactly one read group set. #[serde(rename="readGroupSetId")] pub read_group_set_id: Option, - /// Whether this read did not pass filters, such as platform or vendor quality controls (SAM flag 0x200). + /// Whether this read did not pass filters, such as platform or vendor quality + /// controls (SAM flag 0x200). #[serde(rename="failedVendorQualityChecks")] pub failed_vendor_quality_checks: Option, /// The fragment name. Equivalent to QNAME (query template name) in SAM. #[serde(rename="fragmentName")] pub fragment_name: Option, - /// The mapping of the primary alignment of the `(readNumber+1)%numberReads` read in the fragment. It replaces mate position and mate strand in SAM. + /// The mapping of the primary alignment of the + /// `(readNumber+1)%numberReads` read in the fragment. It replaces + /// mate position and mate strand in SAM. #[serde(rename="nextMatePosition")] pub next_mate_position: Option, - /// Whether this alignment is supplementary. Equivalent to SAM flag 0x800. Supplementary alignments are used in the representation of a chimeric alignment. In a chimeric alignment, a read is split into multiple linear alignments that map to different reference contigs. The first linear alignment in the read will be designated as the representative alignment; the remaining linear alignments will be designated as supplementary alignments. These alignments may have different mapping quality scores. In each linear alignment in a chimeric alignment, the read will be hard clipped. The `alignedSequence` and `alignedQuality` fields in the alignment record will only represent the bases for its respective linear alignment. + /// Whether this alignment is supplementary. Equivalent to SAM flag 0x800. + /// Supplementary alignments are used in the representation of a chimeric + /// alignment. In a chimeric alignment, a read is split into multiple + /// linear alignments that map to different reference contigs. The first + /// linear alignment in the read will be designated as the representative + /// alignment; the remaining linear alignments will be designated as + /// supplementary alignments. These alignments may have different mapping + /// quality scores. In each linear alignment in a chimeric alignment, the read + /// will be hard clipped. The `alignedSequence` and + /// `alignedQuality` fields in the alignment record will only + /// represent the bases for its respective linear alignment. #[serde(rename="supplementaryAlignment")] pub supplementary_alignment: Option, /// The observed length of the fragment, equivalent to TLEN in SAM. #[serde(rename="fragmentLength")] pub fragment_length: Option, - /// The server-generated read ID, unique across all reads. This is different from the `fragmentName`. - pub id: Option, - /// The linear alignment for this alignment record. This field is null for unmapped reads. + /// The read number in sequencing. 0-based and less than numberReads. This + /// field replaces SAM flag 0x40 and 0x80. + #[serde(rename="readNumber")] + pub read_number: Option, + /// The linear alignment for this alignment record. This field is null for + /// unmapped reads. pub alignment: Option, - /// A map of additional read alignment information. This must be of the form map (string key mapping to a list of string values). + /// A map of additional read alignment information. This must be of the form + /// map (string key mapping to a list of string values). pub info: Option>>, /// The fragment is a PCR or optical duplicate (SAM flag 0x400). #[serde(rename="duplicateFragment")] pub duplicate_fragment: Option, + /// The quality of the read sequence contained in this alignment record + /// (equivalent to QUAL in SAM). + /// `alignedSequence` and `alignedQuality` may be shorter than the full read + /// sequence and quality. This will occur if the alignment is part of a + /// chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR + /// for this read will begin/end with a hard clip operator that will indicate + /// the length of the excised sequence. + #[serde(rename="alignedQuality")] + pub aligned_quality: Option>, + /// The server-generated read ID, unique across all reads. This is different + /// from the `fragmentName`. + pub id: Option, + /// The orientation and the distance between reads from the fragment are + /// consistent with the sequencing protocol (SAM flag 0x2). + #[serde(rename="properPlacement")] + pub proper_placement: Option, + /// The ID of the read group this read belongs to. A read belongs to exactly + /// one read group. This is a server-generated ID which is distinct from SAM's + /// RG tag (for that value, see + /// ReadGroup.name). + #[serde(rename="readGroupId")] + pub read_group_id: Option, /// The number of reads in the fragment (extension to SAM flag 0x1). #[serde(rename="numberReads")] pub number_reads: Option, - /// The read number in sequencing. 0-based and less than numberReads. This field replaces SAM flag 0x40 and 0x80. - #[serde(rename="readNumber")] - pub read_number: Option, - /// The orientation and the distance between reads from the fragment are consistent with the sequencing protocol (SAM flag 0x2). - #[serde(rename="properPlacement")] - pub proper_placement: Option, - /// The ID of the read group this read belongs to. A read belongs to exactly one read group. This is a server-generated ID which is distinct from SAM's RG tag (for that value, see ReadGroup.name). - #[serde(rename="readGroupId")] - pub read_group_id: Option, - /// The quality of the read sequence contained in this alignment record (equivalent to QUAL in SAM). `alignedSequence` and `alignedQuality` may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence. - #[serde(rename="alignedQuality")] - pub aligned_quality: Option>, - /// The bases of the read sequence contained in this alignment record, **without CIGAR operations applied** (equivalent to SEQ in SAM). `alignedSequence` and `alignedQuality` may be shorter than the full read sequence and quality. This will occur if the alignment is part of a chimeric alignment, or if the read was trimmed. When this occurs, the CIGAR for this read will begin/end with a hard clip operator that will indicate the length of the excised sequence. + /// The bases of the read sequence contained in this alignment record, + /// **without CIGAR operations applied** (equivalent to SEQ in SAM). + /// `alignedSequence` and `alignedQuality` may be + /// shorter than the full read sequence and quality. This will occur if the + /// alignment is part of a chimeric alignment, or if the read was trimmed. When + /// this occurs, the CIGAR for this read will begin/end with a hard clip + /// operator that will indicate the length of the excised sequence. #[serde(rename="alignedSequence")] pub aligned_sequence: Option, - /// Whether this alignment is secondary. Equivalent to SAM flag 0x100. A secondary alignment represents an alternative to the primary alignment for this read. Aligners may return secondary alignments if a read can map ambiguously to multiple coordinates in the genome. By convention, each read has one and only one alignment where both `secondaryAlignment` and `supplementaryAlignment` are false. + /// Whether this alignment is secondary. Equivalent to SAM flag 0x100. + /// A secondary alignment represents an alternative to the primary alignment + /// for this read. Aligners may return secondary alignments if a read can map + /// ambiguously to multiple coordinates in the genome. By convention, each read + /// has one and only one alignment where both `secondaryAlignment` + /// and `supplementaryAlignment` are false. #[serde(rename="secondaryAlignment")] pub secondary_alignment: Option, } @@ -1513,54 +1928,74 @@ pub struct Read { impl Resource for Read {} -/// A variant represents a change in DNA sequence relative to a reference sequence. For example, a variant could represent a SNP or an insertion. Variants belong to a variant set. For more genomics resource definitions, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Each of the calls on a variant represent a determination of genotype with respect to that variant. For example, a call might assign probability of 0.32 to the occurrence of a SNP named rs1234 in a sample named NA12345. A call belongs to a call set, which contains related calls typically from one sample. +/// A variant represents a change in DNA sequence relative to a reference +/// sequence. For example, a variant could represent a SNP or an insertion. +/// Variants belong to a variant set. +/// +/// For more genomics resource definitions, see [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// Each of the calls on a variant represent a determination of genotype with +/// respect to that variant. For example, a call might assign probability of 0.32 +/// to the occurrence of a SNP named rs1234 in a sample named NA12345. A call +/// belongs to a call set, which contains related calls typically from one +/// sample. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [patch variants](struct.VariantPatchCall.html) (request|response) +/// * [import variants](struct.VariantImportCall.html) (none) /// * [delete variants](struct.VariantDeleteCall.html) (none) /// * [create variants](struct.VariantCreateCall.html) (request|response) /// * [get variants](struct.VariantGetCall.html) (response) -/// * [import variants](struct.VariantImportCall.html) (none) +/// * [patch variants](struct.VariantPatchCall.html) (request|response) /// * [merge variants](struct.VariantMergeCall.html) (none) /// * [search variants](struct.VariantSearchCall.html) (none) -/// * [stream variants](struct.VariantStreamCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Variant { - /// A map of additional variant information. This must be of the form map (string key mapping to a list of string values). + /// A map of additional variant information. This must be of the form + /// map (string key mapping to a list of string values). pub info: Option>>, /// The ID of the variant set this variant belongs to. #[serde(rename="variantSetId")] pub variant_set_id: Option, - /// The end position (0-based) of this variant. This corresponds to the first base after the last base in the reference allele. So, the length of the reference allele is (end - start). This is useful for variants that don't explicitly give alternate bases, for example large deletions. + /// The end position (0-based) of this variant. This corresponds to the first + /// base after the last base in the reference allele. So, the length of + /// the reference allele is (end - start). This is useful for variants + /// that don't explicitly give alternate bases, for example large deletions. pub end: Option, - /// The variant calls for this particular variant. Each one represents the determination of genotype with respect to this variant. + /// The variant calls for this particular variant. Each one represents the + /// determination of genotype with respect to this variant. pub calls: Option>, /// The date this variant was created, in milliseconds from the epoch. pub created: Option, - /// The server-generated variant ID, unique across all variants. - pub id: Option, - /// A list of filters (normally quality filters) this variant has failed. `PASS` indicates this variant has passed all filters. + /// The reference bases for this variant. They start at the given + /// position. + #[serde(rename="referenceBases")] + pub reference_bases: Option, + /// A list of filters (normally quality filters) this variant has failed. + /// `PASS` indicates this variant has passed all filters. pub filter: Option>, - /// The position at which this variant occurs (0-based). This corresponds to the first base of the string of reference bases. + /// The position at which this variant occurs (0-based). + /// This corresponds to the first base of the string of reference bases. pub start: Option, /// Names for the variant, for example a RefSNP ID. pub names: Option>, /// The bases that appear instead of the reference bases. #[serde(rename="alternateBases")] pub alternate_bases: Option>, - /// The reference on which this variant occurs. (such as `chr20` or `X`) + /// The reference on which this variant occurs. + /// (such as `chr20` or `X`) #[serde(rename="referenceName")] pub reference_name: Option, - /// A measure of how likely this variant is to be real. A higher value is better. + /// A measure of how likely this variant is to be real. + /// A higher value is better. pub quality: Option, - /// The reference bases for this variant. They start at the given position. - #[serde(rename="referenceBases")] - pub reference_bases: Option, + /// The server-generated variant ID, unique across all variants. + pub id: Option, } impl RequestValue for Variant {} @@ -1579,7 +2014,9 @@ impl ResponseResult for Variant {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchAnnotationSetsResponse { - /// 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. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The matching annotation sets. @@ -1596,11 +2033,27 @@ impl ResponseResult for SearchAnnotationSetsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Exon { - /// The start position of the exon on this annotation's reference sequence, 0-based inclusive. Note that this is relative to the reference start, and **not** the containing annotation start. + /// The start position of the exon on this annotation's reference sequence, + /// 0-based inclusive. Note that this is relative to the reference start, and + /// **not** the containing annotation start. pub start: Option, - /// The frame of this exon. Contains a value of 0, 1, or 2, which indicates the offset of the first coding base of the exon within the reading frame of the coding DNA sequence, if any. This field is dependent on the strandedness of this annotation (see Annotation.reverse_strand). For forward stranded annotations, this offset is relative to the exon.start. For reverse strand annotations, this offset is relative to the exon.end `- 1`. Unset if this exon does not intersect the coding sequence. Upon creation of a transcript, the frame must be populated for all or none of the coding exons. + /// The frame of this exon. Contains a value of 0, 1, or 2, which indicates + /// the offset of the first coding base of the exon within the reading frame + /// of the coding DNA sequence, if any. This field is dependent on the + /// strandedness of this annotation (see + /// Annotation.reverse_strand). + /// For forward stranded annotations, this offset is relative to the + /// exon.start. For reverse + /// strand annotations, this offset is relative to the + /// exon.end `- 1`. + /// + /// Unset if this exon does not intersect the coding sequence. Upon creation + /// of a transcript, the frame must be populated for all or none of the + /// coding exons. pub frame: Option, - /// The end position of the exon on this annotation's reference sequence, 0-based exclusive. Note that this is relative to the reference start, and *not* the containing annotation start. + /// The end position of the exon on this annotation's reference sequence, + /// 0-based exclusive. Note that this is relative to the reference start, and + /// *not* the containing annotation start. pub end: Option, } @@ -1618,7 +2071,9 @@ impl Part for Exon {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchVariantsResponse { - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The list of matching Variants. @@ -1634,9 +2089,13 @@ impl ResponseResult for SearchVariantsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CodingSequence { - /// The start of the coding sequence on this annotation's reference sequence, 0-based inclusive. Note that this position is relative to the reference start, and *not* the containing annotation start. + /// The start of the coding sequence on this annotation's reference sequence, + /// 0-based inclusive. Note that this position is relative to the reference + /// start, and *not* the containing annotation start. pub start: Option, - /// The end of the coding sequence on this annotation's reference sequence, 0-based exclusive. Note that this position is relative to the reference start, and *not* the containing annotation start. + /// The end of the coding sequence on this annotation's reference sequence, + /// 0-based exclusive. Note that this position is relative to the reference + /// start, and *not* the containing annotation start. pub end: Option, } @@ -1654,11 +2113,18 @@ 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 annotation set, callers should not reuse `request_id`s when writing different batches of annotations - behavior in this case is undefined. A common approach is to use a UUID. For batch jobs where worker crashes are a possibility, consider using some unique variant of a worker or run ID. + /// 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 + /// annotation set, callers should not reuse `request_id`s when writing + /// different batches of annotations - behavior in this case is undefined. + /// A common approach is to use a UUID. For batch jobs where worker crashes are + /// 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 {} @@ -1675,7 +2141,9 @@ impl RequestValue for BatchCreateAnnotationsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchReferenceSetsResponse { - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The matching references sets. @@ -1686,7 +2154,14 @@ pub struct SearchReferenceSetsResponse { impl ResponseResult for SearchReferenceSetsResponse {} -/// A reference set is a set of references which typically comprise a reference assembly for a species, such as `GRCh38` which is representative of the human genome. A reference set defines a common coordinate space for comparing reference-aligned experimental data. A reference set contains 1 or more references. For more genomics resource definitions, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// A reference set is a set of references which typically comprise a reference +/// assembly for a species, such as `GRCh38` which is representative +/// of the human genome. A reference set defines a common coordinate space for +/// comparing reference-aligned experimental data. A reference set contains 1 or +/// more references. +/// +/// For more genomics resource definitions, see [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Activities /// @@ -1702,21 +2177,31 @@ pub struct ReferenceSet { /// The URI from which the references were obtained. #[serde(rename="sourceUri")] pub source_uri: Option, - /// The IDs of the reference objects that are part of this set. `Reference.md5checksum` must be unique within this set. + /// The IDs of the reference objects that are part of this set. + /// `Reference.md5checksum` must be unique within this set. #[serde(rename="referenceIds")] pub reference_ids: Option>, /// Public id of this reference set, such as `GRCh37`. #[serde(rename="assemblyId")] pub assembly_id: Option, - /// All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally with a version number, for example `NC_000001.11`. + /// All known corresponding accession IDs in INSDC (GenBank/ENA/DDBJ) ideally + /// with a version number, for example `NC_000001.11`. #[serde(rename="sourceAccessions")] pub source_accessions: Option>, - /// ID from http://www.ncbi.nlm.nih.gov/taxonomy (for example, 9606 for human) indicating the species which this reference set is intended to model. Note that contained references may specify a different `ncbiTaxonId`, as assemblies may contain reference sequences which do not belong to the modeled species, for example EBV in a human reference genome. + /// ID from http://www.ncbi.nlm.nih.gov/taxonomy (for example, 9606 for human) + /// indicating the species which this reference set is intended to model. Note + /// that contained references may specify a different `ncbiTaxonId`, as + /// assemblies may contain reference sequences which do not belong to the + /// modeled species, for example EBV in a human reference genome. #[serde(rename="ncbiTaxonId")] pub ncbi_taxon_id: Option, /// The server-generated reference set ID, unique across all reference sets. pub id: Option, - /// Order-independent MD5 checksum which identifies this reference set. The checksum is computed by sorting all lower case hexidecimal string `reference.md5checksum` (for all reference in this set) in ascending lexicographic order, concatenating, and taking the MD5 of that value. The resulting value is represented in lower case hexadecimal format. + /// Order-independent MD5 checksum which identifies this reference set. The + /// checksum is computed by sorting all lower case hexidecimal string + /// `reference.md5checksum` (for all reference in this set) in + /// ascending lexicographic order, concatenating, and taking the MD5 of that + /// value. The resulting value is represented in lower case hexadecimal format. pub md5checksum: Option, } @@ -1724,7 +2209,11 @@ impl Resource for ReferenceSet {} impl ResponseResult for ReferenceSet {} -/// A variant set is a collection of call sets and variants. It contains summary statistics of those contents. A variant set belongs to a dataset. For more genomics resource definitions, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// A variant set is a collection of call sets and variants. It contains summary +/// statistics of those contents. A variant set belongs to a dataset. +/// +/// For more genomics resource definitions, see [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Activities /// @@ -1737,14 +2226,24 @@ impl ResponseResult for ReferenceSet {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct VariantSet { - /// 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")] - pub reference_bounds: Option>, /// The metadata associated with this variant set. pub metadata: Option>, - /// The reference set to which the variant set is mapped. The reference set describes the alignment provenance of the variant set, while the `referenceBounds` describe the shape of the actual variant data. The reference set's reference names are a superset of those found in the `referenceBounds`. For example, given a variant set that is mapped to the GRCh38 reference set and contains a single variant on reference 'X', `referenceBounds` would contain only an entry for 'X', while the associated reference set enumerates all possible references: '1', '2', 'X', 'Y', 'MT', etc. + /// A textual description of this variant set. + pub description: 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")] + pub reference_bounds: Option>, + /// The reference set to which the variant set is mapped. The reference set + /// describes the alignment provenance of the variant set, while the + /// `referenceBounds` describe the shape of the actual variant data. The + /// reference set's reference names are a superset of those found in the + /// `referenceBounds`. + /// + /// For example, given a variant set that is mapped to the GRCh38 reference set + /// and contains a single variant on reference 'X', `referenceBounds` would + /// contain only an entry for 'X', while the associated reference set + /// enumerates all possible references: '1', '2', 'X', 'Y', 'MT', etc. #[serde(rename="referenceSetId")] pub reference_set_id: Option, /// The server-generated variant set ID, unique across all variant sets. @@ -1752,8 +2251,8 @@ pub struct VariantSet { /// The dataset to which this variant set belongs. #[serde(rename="datasetId")] pub dataset_id: Option, - /// A textual description of this variant set. - pub description: Option, + /// User-specified, mutable name. + pub name: Option, } impl RequestValue for VariantSet {} @@ -1761,39 +2260,40 @@ impl Resource for VariantSet {} impl ResponseResult for VariantSet {} -/// There is no detailed description. +/// The variant data export request. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [search annotations](struct.AnnotationSearchCall.html) (request) +/// * [export variantsets](struct.VariantsetExportCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SearchAnnotationsRequest { - /// The start position of the range on the reference, 0-based inclusive. If specified, referenceId or referenceName must be specified. Defaults to 0. - pub start: Option, - /// The ID of the reference to query. - #[serde(rename="referenceId")] - pub reference_id: Option, - /// The end position of the range on the reference, 0-based exclusive. If referenceId or referenceName must be specified, Defaults to the length of the reference. - pub end: Option, - /// The maximum number of results to return in a single page. If unspecified, defaults to 256. The maximum value is 2048. - #[serde(rename="pageSize")] - pub page_size: Option, - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. - #[serde(rename="pageToken")] - pub page_token: Option, - /// The name of the reference to query, within the reference set associated with this query. - #[serde(rename="referenceName")] - pub reference_name: Option, - /// Required. The annotation sets to search within. The caller must have `READ` access to these annotation sets. All queried annotation sets must have the same type. - #[serde(rename="annotationSetIds")] - pub annotation_set_ids: Option>, +pub struct ExportVariantSetRequest { + /// Required. The BigQuery dataset to export data to. This dataset must already + /// exist. Note that this is distinct from the Genomics concept of "dataset". + #[serde(rename="bigqueryDataset")] + pub bigquery_dataset: Option, + /// The format for the exported data. + pub format: Option, + /// If provided, only variant call information from the specified call sets + /// will be exported. By default all variant calls are exported. + #[serde(rename="callSetIds")] + pub call_set_ids: Option>, + /// Required. The Google Cloud project ID that owns the destination + /// BigQuery dataset. The caller must have WRITE access to this project. This + /// project will also own the resulting export job. + #[serde(rename="projectId")] + pub project_id: Option, + /// Required. The BigQuery table to export data to. + /// If the table doesn't exist, it will be created. If it already exists, it + /// will be overwritten. + #[serde(rename="bigqueryTable")] + pub bigquery_table: Option, } -impl RequestValue for SearchAnnotationsRequest {} +impl RequestValue for ExportVariantSetRequest {} /// The read search request. @@ -1807,23 +2307,35 @@ impl RequestValue for SearchAnnotationsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchReadsRequest { - /// The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified. - pub start: Option, - /// The IDs of the read groups sets within which to search for reads. All specified read group sets must be aligned against a common set of reference sequences; this defines the genomic coordinates for the query. Must specify one of `readGroupSetIds` or `readGroupIds`. - #[serde(rename="readGroupSetIds")] - pub read_group_set_ids: Option>, - /// The IDs of the read groups within which to search for reads. All specified read groups must belong to the same read group sets. Must specify one of `readGroupSetIds` or `readGroupIds`. - #[serde(rename="readGroupIds")] - pub read_group_ids: Option>, - /// The maximum number of results to return in a single page. If unspecified, defaults to 256. The maximum value is 2048. - #[serde(rename="pageSize")] - pub page_size: Option, - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. #[serde(rename="pageToken")] pub page_token: Option, - /// The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified. + /// The IDs of the read groups sets within which to search for reads. All + /// specified read group sets must be aligned against a common set of reference + /// sequences; this defines the genomic coordinates for the query. Must specify + /// one of `readGroupSetIds` or `readGroupIds`. + #[serde(rename="readGroupSetIds")] + pub read_group_set_ids: Option>, + /// The IDs of the read groups within which to search for reads. All specified + /// read groups must belong to the same read group sets. Must specify one of + /// `readGroupSetIds` or `readGroupIds`. + #[serde(rename="readGroupIds")] + pub read_group_ids: Option>, + /// The maximum number of results to return in a single page. If unspecified, + /// defaults to 256. The maximum value is 2048. + #[serde(rename="pageSize")] + pub page_size: Option, + /// The start position of the range on the reference, 0-based inclusive. If + /// specified, `referenceName` must also be specified. + pub start: Option, + /// The end position of the range on the reference, 0-based exclusive. If + /// specified, `referenceName` must also be specified. pub end: Option, - /// The reference sequence name, for example `chr1`, `1`, or `chrX`. If set to `*`, only unmapped reads are returned. If unspecified, all reads (mapped and unmapped) are returned. + /// The reference sequence name, for example `chr1`, `1`, or `chrX`. If set to + /// `*`, only unmapped reads are returned. If unspecified, all reads (mapped + /// and unmapped) are returned. #[serde(rename="referenceName")] pub reference_name: Option, } @@ -1841,7 +2353,8 @@ pub struct Range { pub start: Option, /// The end position of the range on the reference, 0-based exclusive. pub end: Option, - /// The reference sequence name, for example `chr1`, `1`, or `chrX`. + /// The reference sequence name, for example `chr1`, + /// `1`, or `chrX`. #[serde(rename="referenceName")] pub reference_name: Option, } @@ -1849,6 +2362,25 @@ pub struct Range { impl Part for Range {} +/// There is no detailed description. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [batch create annotations](struct.AnnotationBatchCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BatchCreateAnnotationsResponse { + /// The resulting per-annotation entries, ordered consistently with the + /// original request. + pub entries: Option>, +} + +impl ResponseResult for BatchCreateAnnotationsResponse {} + + /// There is no detailed description. /// /// # Activities @@ -1860,58 +2392,73 @@ impl Part for Range {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchAnnotationSetsRequest { - /// 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. + /// 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, - /// Only return annotations sets for which a substring of the name matches this string (case insensitive). + /// Only return annotations sets for which a substring of the name matches this + /// string (case insensitive). pub name: Option, - /// The maximum number of results to return in a single page. If unspecified, defaults to 128. The maximum value is 1024. + /// The maximum number of results to return in a single page. If unspecified, + /// 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. + /// If specified, only annotation sets associated with the given reference set + /// are returned. #[serde(rename="referenceSetId")] pub reference_set_id: Option, - /// If specified, only annotation sets that have any of these types are returned. + /// 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>, } impl RequestValue for SearchAnnotationSetsRequest {} -/// There is no detailed description. +/// The read search response. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [undelete datasets](struct.DatasetUndeleteCall.html) (request) +/// * [search reads](struct.ReadSearchCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UndeleteDatasetRequest { _never_set: Option } - -impl RequestValue for UndeleteDatasetRequest {} - - -/// 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*). -/// -/// * [stream reads](struct.ReadStreamCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StreamReadsResponse { - /// no description provided +pub struct SearchReadsResponse { + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of matching alignments sorted by mapped genomic coordinate, + /// if any, ascending in position within the same reference. Unmapped reads, + /// which have no position, are returned contiguously and are sorted in + /// ascending lexicographic order by fragment name. pub alignments: Option>, } -impl ResponseResult for StreamReadsResponse {} +impl ResponseResult for SearchReadsResponse {} + + +/// 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 Entry { + /// The creation status. + pub status: Option, + /// The created annotation, if creation was successful. + pub annotation: Option, +} + +impl Part for Entry {} /// There is no detailed description. @@ -1925,7 +2472,9 @@ impl ResponseResult for StreamReadsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchReferencesResponse { - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The matching references. @@ -1935,39 +2484,17 @@ pub struct SearchReferencesResponse { impl ResponseResult for SearchReferencesResponse {} -/// The stream variants request. +/// A read group set is a logical collection of read groups, which are +/// collections of reads produced by a sequencer. A read group set typically +/// models reads corresponding to one sample, sequenced one way, and aligned one +/// way. /// -/// # Activities +/// * A read group set belongs to one dataset. +/// * A read group belongs to one read group set. +/// * A read belongs to one read group. /// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [stream variants](struct.VariantStreamCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StreamVariantsRequest { - /// The beginning of the window (0-based, inclusive) for which overlapping variants should be returned. - pub start: Option, - /// The variant set ID from which to stream variants. - #[serde(rename="variantSetId")] - pub variant_set_id: Option, - /// The end of the window (0-based, exclusive) for which overlapping variants should be returned. - pub end: Option, - /// Required. Only return variants in this reference sequence. - #[serde(rename="referenceName")] - pub reference_name: Option, - /// The Google Cloud project ID which will be billed for this access. The caller must have WRITE access to this project. Required. - #[serde(rename="projectId")] - pub project_id: Option, - /// Only return variant calls which belong to call sets with these IDs. Leaving this blank returns all variant calls. - #[serde(rename="callSetIds")] - pub call_set_ids: Option>, -} - -impl RequestValue for StreamVariantsRequest {} - - -/// A read group set is a logical collection of read groups, which are collections of reads produced by a sequencer. A read group set typically models reads corresponding to one sample, sequenced one way, and aligned one way. * A read group set belongs to one dataset. * A read group belongs to one read group set. * A read belongs to one read group. For more genomics resource definitions, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// For more genomics resource definitions, see [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Activities /// @@ -1984,14 +2511,16 @@ pub struct ReadGroupSet { /// The dataset to which this read group set belongs. #[serde(rename="datasetId")] pub dataset_id: Option, - /// The read group set name. By default this will be initialized to the sample name of the sequenced data contained in this set. + /// The read group set name. By default this will be initialized to the sample + /// name of the sequenced data contained in this set. pub name: Option, /// The reference set to which the reads in this read group set are aligned. #[serde(rename="referenceSetId")] pub reference_set_id: Option, /// The server-generated read group set ID, unique for all read group sets. pub id: Option, - /// The read groups in this set. There are typically 1-10 read groups in a read group set. + /// The read groups in this set. There are typically 1-10 read groups in a read + /// group set. #[serde(rename="readGroups")] pub read_groups: Option>, /// The filename of the original source file for this read group set, if any. @@ -2003,40 +2532,6 @@ impl Resource for ReadGroupSet {} impl ResponseResult for ReadGroupSet {} -/// The stream reads 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*). -/// -/// * [stream reads](struct.ReadStreamCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct StreamReadsRequest { - /// The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified. - pub start: Option, - /// The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified. - pub end: Option, - /// Specifying `totalShards` causes a disjoint subset of the normal response payload to be returned for each query with a unique `shard` parameter specified. A best effort is made to yield equally sized shards. Sharding can be used to distribute processing amongst workers, where each worker is assigned a unique `shard` number and all workers specify the same `totalShards` number. The union of reads returned for all sharded queries `[0, totalShards)` is equal to those returned by a single unsharded query. Queries for different values of `totalShards` with common divisors will share shard boundaries. For example, streaming `shard` 2 of 5 `totalShards` yields the same results as streaming `shard`s 4 and 5 of 10 `totalShards`. This property can be leveraged for adaptive retries. - #[serde(rename="totalShards")] - pub total_shards: Option, - /// The ID of the read group set from which to stream reads. - #[serde(rename="readGroupSetId")] - pub read_group_set_id: Option, - /// The reference sequence name, for example `chr1`, `1`, or `chrX`. If set to *, only unmapped reads are returned. - #[serde(rename="referenceName")] - pub reference_name: Option, - /// The Google Cloud project ID which will be billed for this access. The caller must have WRITE access to this project. Required. - #[serde(rename="projectId")] - pub project_id: Option, - /// Restricts results to a shard containing approximately `1/totalShards` of the normal response payload for this query. Results from a sharded request are disjoint from those returned by all queries which differ only in their shard parameter. A shard may yield 0 results; this is especially likely for large values of `totalShards`. Valid values are `[0, totalShards)`. - pub shard: Option, -} - -impl RequestValue for StreamReadsRequest {} - - /// The response message for Operations.ListOperations. /// /// # Activities @@ -2058,7 +2553,8 @@ pub struct ListOperationsResponse { impl ResponseResult for ListOperationsResponse {} -/// A linear alignment can be represented by one CIGAR string. Describes the mapped position and local alignment of the read to the reference. +/// A linear alignment can be represented by one CIGAR string. Describes the +/// mapped position and local alignment of the read to the reference. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -2066,9 +2562,14 @@ impl ResponseResult for ListOperationsResponse {} pub struct LinearAlignment { /// The position of this alignment. pub position: Option, - /// Represents the local alignment of this sequence (alignment matches, indels, etc) against the reference. + /// Represents the local alignment of this sequence (alignment matches, indels, + /// etc) against the reference. pub cigar: Option>, - /// The mapping quality of this alignment. Represents how likely the read maps to this position as opposed to other locations. Specifically, this is -10 log10 Pr(mapping position is wrong), rounded to the nearest integer. + /// The mapping quality of this alignment. Represents how likely + /// the read maps to this position as opposed to other locations. + /// + /// Specifically, this is -10 log10 Pr(mapping position is wrong), rounded to + /// the nearest integer. #[serde(rename="mappingQuality")] pub mapping_quality: Option, } @@ -2076,7 +2577,9 @@ pub struct LinearAlignment { impl Part for LinearAlignment {} -/// An annotation set is a logical grouping of annotations that share consistent type information and provenance. Examples of annotation sets include 'all genes from refseq', and 'all variant annotations from ClinVar'. +/// An annotation set is a logical grouping of annotations that share consistent +/// type information and provenance. Examples of annotation sets include 'all +/// genes from refseq', and 'all variant annotations from ClinVar'. /// /// # Activities /// @@ -2089,19 +2592,22 @@ impl Part for LinearAlignment {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AnnotationSet { - /// A map of additional read alignment information. This must be of the form map (string key mapping to a list of string values). + /// A map of additional read alignment information. This must be of the form + /// map (string key mapping to a list of string values). pub info: Option>>, /// The display name for this annotation set. pub name: Option, - /// The source URI describing the file from which this annotation set was generated, if any. + /// The source URI describing the file from which this annotation set was + /// generated, if any. #[serde(rename="sourceUri")] pub source_uri: Option, - /// The ID of the reference set that defines the coordinate space for this set's annotations. - #[serde(rename="referenceSetId")] - pub reference_set_id: Option, /// The type of annotations contained within this set. #[serde(rename="type")] pub type_: Option, + /// The ID of the reference set that defines the coordinate space for this + /// set's annotations. + #[serde(rename="referenceSetId")] + pub reference_set_id: Option, /// The server-generated annotation set ID, unique across all annotation sets. pub id: Option, /// The dataset to which this annotation set belongs. @@ -2120,7 +2626,10 @@ impl ResponseResult for AnnotationSet {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CigarUnit { - /// `referenceSequence` is only used at mismatches (`SEQUENCE_MISMATCH`) and deletions (`DELETE`). Filling this field replaces SAM's MD tag. If the relevant information is not available, this field is unset. + /// `referenceSequence` is only used at mismatches + /// (`SEQUENCE_MISMATCH`) and deletions (`DELETE`). + /// Filling this field replaces SAM's MD tag. If the relevant information is + /// not available, this field is unset. #[serde(rename="referenceSequence")] pub reference_sequence: Option, /// no description provided @@ -2133,7 +2642,10 @@ pub struct CigarUnit { impl Part for CigarUnit {} -/// A Dataset is a collection of genomic data. For more genomics resource definitions, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// A Dataset is a collection of genomic data. +/// +/// For more genomics resource definitions, see [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Activities /// @@ -2195,7 +2707,9 @@ impl RequestValue for CancelOperationRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchVariantSetsResponse { - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The variant sets belonging to the requested dataset. @@ -2206,13 +2720,15 @@ pub struct SearchVariantSetsResponse { impl ResponseResult for SearchVariantSetsResponse {} -/// A bucket over which read coverage has been precomputed. A bucket corresponds to a specific range of the reference sequence. +/// A bucket over which read coverage has been precomputed. A bucket corresponds +/// to a specific range of the reference sequence. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CoverageBucket { - /// The average number of reads which are aligned to each individual reference base in this bucket. + /// The average number of reads which are aligned to each individual + /// reference base in this bucket. #[serde(rename="meanCoverage")] pub mean_coverage: Option, /// The genomic coordinate range spanned by this bucket. @@ -2233,7 +2749,9 @@ impl Part for CoverageBucket {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchCallSetsResponse { - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results. + /// The continuation token, which is used to page through large result sets. + /// Provide this value in a subsequent request to return the next page of + /// results. This field will be empty if there aren't any additional results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The list of matching call sets. @@ -2255,43 +2773,45 @@ impl ResponseResult for SearchCallSetsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchReferenceSetsRequest { - /// If present, return reference sets for which the md5checksum matches exactly. + /// If present, return reference sets for which the + /// md5checksum matches exactly. pub md5checksums: Option>, - /// If present, return reference sets for which a substring of their `assemblyId` matches this string (case insensitive). - #[serde(rename="assemblyId")] - pub assembly_id: Option, - /// If present, return reference sets for which a prefix of any of sourceAccessions match any of these strings. Accession numbers typically have a main number and a version, for example `NC_000001.11`. - pub accessions: Option>, - /// The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 4096. - #[serde(rename="pageSize")] - pub page_size: Option, - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. #[serde(rename="pageToken")] pub page_token: Option, + /// If present, return reference sets for which a prefix of any of + /// sourceAccessions + /// match any of these strings. Accession numbers typically have a main number + /// and a version, for example `NC_000001.11`. + pub accessions: Option>, + /// The maximum number of results to return in a single page. If unspecified, + /// defaults to 1024. The maximum value is 4096. + #[serde(rename="pageSize")] + pub page_size: Option, + /// If present, return reference sets for which a substring of their + /// `assemblyId` matches this string (case insensitive). + #[serde(rename="assemblyId")] + pub assembly_id: Option, } impl RequestValue for SearchReferenceSetsRequest {} -/// The read search response. +/// There is no detailed description. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [search reads](struct.ReadSearchCall.html) (response) +/// * [undelete datasets](struct.DatasetUndeleteCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct SearchReadsResponse { - /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. This field will be empty if there aren't any additional results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of matching alignments sorted by mapped genomic coordinate, if any, ascending in position within the same reference. Unmapped reads, which have no position, are returned contiguously and are sorted in ascending lexicographic order by fragment name. - pub alignments: Option>, -} +pub struct UndeleteDatasetRequest { _never_set: Option } -impl ResponseResult for SearchReadsResponse {} +impl RequestValue for UndeleteDatasetRequest {} @@ -2358,7 +2878,9 @@ 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. + /// 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 /// @@ -2436,7 +2958,11 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new dataset. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Creates a new dataset. + /// + /// For the definitions of datasets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -2453,7 +2979,16 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a dataset and all of its contents (all read group sets, reference sets, variant sets, call sets, annotation sets, etc.) This is reversible (up to one week after the deletion) via the datasets.undelete operation. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Deletes a dataset and all of its contents (all read group sets, + /// reference sets, variant sets, call sets, annotation sets, etc.) + /// This is reversible (up to one week after the deletion) via + /// the + /// datasets.undelete + /// operation. + /// + /// For the definitions of datasets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -2470,7 +3005,13 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Undeletes a dataset by restoring a dataset which was deleted via this API. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This operation is only possible for a week after the deletion occurred. + /// Undeletes a dataset by restoring a dataset which was deleted via this API. + /// + /// For the definitions of datasets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// This operation is only possible for a week after the deletion occurred. /// /// # Arguments /// @@ -2489,12 +3030,21 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the access control policy on the specified dataset. Replaces any existing policy. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) See Setting a Policy for more information. + /// Sets the access control policy on the specified dataset. Replaces any + /// existing policy. + /// + /// For the definitions of datasets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// See Setting a + /// Policy for more information. /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which policy is being specified. Format is `datasets/`. + /// * `resource` - REQUIRED: The resource for which policy is being specified. Format is + /// `datasets/`. pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> DatasetSetIamPolicyCall<'a, C, A> { DatasetSetIamPolicyCall { hub: self.hub, @@ -2508,12 +3058,19 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns permissions that a caller has on the specified resource. See Testing Permissions for more information. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Returns permissions that a caller has on the specified resource. + /// See Testing + /// Permissions for more information. + /// + /// For the definitions of datasets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which policy is being specified. Format is `datasets/`. + /// * `resource` - REQUIRED: The resource for which policy is being specified. Format is + /// `datasets/`. pub fn test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> DatasetTestIamPermissionCall<'a, C, A> { DatasetTestIamPermissionCall { hub: self.hub, @@ -2527,7 +3084,11 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a dataset by ID. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Gets a dataset by ID. + /// + /// For the definitions of datasets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -2544,7 +3105,11 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists datasets within a project. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Lists datasets within a project. + /// + /// For the definitions of datasets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) pub fn list(&self) -> DatasetListCall<'a, C, A> { DatasetListCall { hub: self.hub, @@ -2559,12 +3124,21 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the access control policy for the dataset. This is empty if the policy or resource does not exist. See Getting a Policy for more information. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Gets the access control policy for the dataset. This is empty if the + /// policy or resource does not exist. + /// + /// See Getting a + /// Policy for more information. + /// + /// For the definitions of datasets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which policy is being specified. Format is `datasets/`. + /// * `resource` - REQUIRED: The resource for which policy is being specified. Format is + /// `datasets/`. pub fn get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> DatasetGetIamPolicyCall<'a, C, A> { DatasetGetIamPolicyCall { hub: self.hub, @@ -2578,7 +3152,13 @@ impl<'a, C, A> DatasetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a dataset. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics. + /// Updates a dataset. + /// + /// For the definitions of datasets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// This method supports patch semantics. /// /// # Arguments /// @@ -2639,7 +3219,14 @@ impl<'a, C, A> ReferencesetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Searches for reference sets which match the given criteria. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71) + /// Searches for reference sets which match the given criteria. + /// + /// For the definitions of references and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Implements + /// [GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71) /// /// # Arguments /// @@ -2656,7 +3243,14 @@ impl<'a, C, A> ReferencesetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a reference set. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83). + /// Gets a reference set. + /// + /// For the definitions of references and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Implements + /// [GlobalAllianceApi.getReferenceSet](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L83). /// /// # Arguments /// @@ -2714,7 +3308,14 @@ impl<'a, C, A> CallsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a list of call sets matching the criteria. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). + /// Gets a list of call sets matching the criteria. + /// + /// For the definitions of call sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Implements + /// [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). /// /// # Arguments /// @@ -2731,7 +3332,13 @@ impl<'a, C, A> CallsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a call set. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics. + /// Updates a call set. + /// + /// For the definitions of call sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// This method supports patch semantics. /// /// # Arguments /// @@ -2751,7 +3358,11 @@ impl<'a, C, A> CallsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new call set. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Creates a new call set. + /// + /// For the definitions of call sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -2768,7 +3379,11 @@ impl<'a, C, A> CallsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a call set. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Deletes a call set. + /// + /// For the definitions of call sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -2785,7 +3400,11 @@ impl<'a, C, A> CallsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a call set by ID. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Gets a call set by ID. + /// + /// For the definitions of call sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -2826,7 +3445,7 @@ impl<'a, C, A> CallsetMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Genomics::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `search(...)` and `stream(...)` +/// // like `search(...)` /// // to build up your call. /// let rb = hub.reads(); /// # } @@ -2843,7 +3462,30 @@ impl<'a, C, A> ReadMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a list of reads for one or more read group sets. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Reads search operates over a genomic coordinate space of reference sequence & position defined over the reference sequences to which the requested read group sets are aligned. If a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads. All reads returned (including reads on subsequent pages) are ordered by genomic coordinate (by reference sequence, then position). Reads with equivalent genomic coordinates are returned in an unspecified order. This order is consistent, such that two queries for the same content (regardless of page size) yield reads in the same order across their respective streams of paginated responses. Implements [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85). + /// Gets a list of reads for one or more read group sets. + /// + /// For the definitions of read group sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Reads search operates over a genomic coordinate space of reference sequence + /// & position defined over the reference sequences to which the requested + /// read group sets are aligned. + /// + /// If a target positional range is specified, search returns all reads whose + /// alignment to the reference genome overlap the range. A query which + /// specifies only read group set IDs yields all reads in those read group + /// sets, including unmapped reads. + /// + /// All reads returned (including reads on subsequent pages) are ordered by + /// genomic coordinate (by reference sequence, then position). Reads with + /// equivalent genomic coordinates are returned in an unspecified order. This + /// order is consistent, such that two queries for the same content (regardless + /// of page size) yield reads in the same order across their respective streams + /// of paginated responses. + /// + /// Implements + /// [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85). /// /// # Arguments /// @@ -2857,23 +3499,6 @@ impl<'a, C, A> ReadMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Returns a stream of all the reads matching the search request, ordered by reference name, position, and ID. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn stream(&self, request: StreamReadsRequest) -> ReadStreamCall<'a, C, A> { - ReadStreamCall { - hub: self.hub, - _request: request, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -2918,12 +3543,22 @@ impl<'a, C, A> ReadgroupsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Exports a read group set to a BAM file in Google Cloud Storage. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Note that currently there may be some differences between exported BAM files and the original BAM file at the time of import. See ImportReadGroupSets for caveats. + /// Exports a read group set to a BAM file in Google Cloud Storage. + /// + /// For the definitions of read group sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Note that currently there may be some differences between exported BAM + /// files and the original BAM file at the time of import. See + /// ImportReadGroupSets + /// for caveats. /// /// # Arguments /// /// * `request` - No description provided. - /// * `readGroupSetId` - Required. The ID of the read group set to export. The caller must have READ access to this read group set. + /// * `readGroupSetId` - Required. The ID of the read group set to export. The caller must have + /// READ access to this read group set. pub fn export(&self, request: ExportReadGroupSetRequest, read_group_set_id: &str) -> ReadgroupsetExportCall<'a, C, A> { ReadgroupsetExportCall { hub: self.hub, @@ -2937,7 +3572,24 @@ impl<'a, C, A> ReadgroupsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates read group sets by asynchronously importing the provided information. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) The caller must have WRITE permissions to the dataset. ## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import - Tags will be converted to strings - tag types are not preserved - Comments (`@CO`) in the input file header will not be preserved - Original header order of references (`@SQ`) will not be preserved - Any reverse stranded unmapped reads will be reverse complemented, and their qualities (also the "BQ" and "OQ" tags, if any) will be reversed - Unmapped reads will be stripped of positional information (reference name and position) + /// Creates read group sets by asynchronously importing the provided + /// information. + /// + /// For the definitions of read group sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// The caller must have WRITE permissions to the dataset. + /// + /// ## Notes on [BAM](https://samtools.github.io/hts-specs/SAMv1.pdf) import + /// + /// - Tags will be converted to strings - tag types are not preserved + /// - Comments (`@CO`) in the input file header will not be preserved + /// - Original header order of references (`@SQ`) will not be preserved + /// - Any reverse stranded unmapped reads will be reverse complemented, and + /// their qualities (also the "BQ" and "OQ" tags, if any) will be reversed + /// - Unmapped reads will be stripped of positional information (reference name + /// and position) /// /// # Arguments /// @@ -2954,12 +3606,19 @@ impl<'a, C, A> ReadgroupsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a read group set. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics. + /// Updates a read group set. + /// + /// For the definitions of read group sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// This method supports patch semantics. /// /// # Arguments /// /// * `request` - No description provided. - /// * `readGroupSetId` - The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set. + /// * `readGroupSetId` - The ID of the read group set to be updated. The caller must have WRITE + /// permissions to the dataset associated with this read group set. pub fn patch(&self, request: ReadGroupSet, read_group_set_id: &str) -> ReadgroupsetPatchCall<'a, C, A> { ReadgroupsetPatchCall { hub: self.hub, @@ -2974,7 +3633,11 @@ impl<'a, C, A> ReadgroupsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a read group set by ID. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Gets a read group set by ID. + /// + /// For the definitions of read group sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -2991,7 +3654,19 @@ impl<'a, C, A> ReadgroupsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Coverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set. + /// Lists fixed width coverage buckets for a read group set, each of which + /// correspond to a range of a reference sequence. Each bucket summarizes + /// coverage information across its corresponding genomic range. + /// + /// For the definitions of read group sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Coverage is defined as the number of reads which are aligned to a given + /// base in the reference sequence. Coverage buckets are available at several + /// precomputed bucket widths, enabling retrieval of various coverage 'zoom + /// levels'. The caller must have READ permissions for the target read group + /// set. /// /// # Arguments /// @@ -3014,11 +3689,16 @@ impl<'a, C, A> ReadgroupsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a read group set. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Deletes a read group set. + /// + /// For the definitions of read group sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// - /// * `readGroupSetId` - The ID of the read group set to be deleted. The caller must have WRITE permissions to the dataset associated with this read group set. + /// * `readGroupSetId` - The ID of the read group set to be deleted. The caller must have WRITE + /// permissions to the dataset associated with this read group set. pub fn delete(&self, read_group_set_id: &str) -> ReadgroupsetDeleteCall<'a, C, A> { ReadgroupsetDeleteCall { hub: self.hub, @@ -3031,7 +3711,14 @@ impl<'a, C, A> ReadgroupsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Searches for read group sets matching the criteria. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135). + /// Searches for read group sets matching the criteria. + /// + /// For the definitions of read group sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Implements + /// [GlobalAllianceApi.searchReadGroupSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L135). /// /// # Arguments /// @@ -3089,7 +3776,14 @@ impl<'a, C, A> ReferenceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the bases in a reference, optionally restricted to a range. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221). + /// Lists the bases in a reference, optionally restricted to a range. + /// + /// For the definitions of references and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Implements + /// [GlobalAllianceApi.getReferenceBases](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L221). /// /// # Arguments /// @@ -3110,7 +3804,14 @@ impl<'a, C, A> ReferenceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Searches for references which match the given criteria. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). + /// Searches for references which match the given criteria. + /// + /// For the definitions of references and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Implements + /// [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). /// /// # Arguments /// @@ -3127,7 +3828,14 @@ impl<'a, C, A> ReferenceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a reference. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). + /// Gets a reference. + /// + /// For the definitions of references and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Implements + /// [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). /// /// # Arguments /// @@ -3168,7 +3876,7 @@ impl<'a, C, A> ReferenceMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Genomics::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `create(...)`, `delete(...)`, `get(...)`, `import(...)`, `merge(...)`, `patch(...)`, `search(...)` and `stream(...)` +/// // like `create(...)`, `delete(...)`, `get(...)`, `import(...)`, `merge(...)`, `patch(...)` and `search(...)` /// // to build up your call. /// let rb = hub.variants(); /// # } @@ -3185,7 +3893,14 @@ impl<'a, C, A> VariantMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a list of variants matching the criteria. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). + /// Gets a list of variants matching the criteria. + /// + /// For the definitions of variants and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Implements + /// [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). /// /// # Arguments /// @@ -3202,7 +3917,11 @@ impl<'a, C, A> VariantMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Deletes a variant. + /// + /// For the definitions of variants and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -3219,7 +3938,11 @@ impl<'a, C, A> VariantMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a variant by ID. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Gets a variant by ID. + /// + /// For the definitions of variants and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -3236,7 +3959,97 @@ impl<'a, C, A> VariantMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Merges the given variants with existing variants. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant. Variant info fields are merged as specified in the infoMergeConfig field of the MergeVariantsRequest. Please exercise caution when using this method! It is easy to introduce mistakes in existing variants and difficult to back out of them. For example, suppose you were trying to merge a new variant with an existing one and both variants contain calls that belong to callsets with the same callset ID. // Existing variant - irrelevant fields trimmed for clarity { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 0, 1 ], } ] } // New variant with conflicting call information { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 1, 1 ], } ] } The resulting merged variant would overwrite the existing calls with those from the new variant: { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 1, 1 ], } ] } This may be the desired outcome, but it is up to the user to determine if if that is indeed the case. + /// Merges the given variants with existing variants. + /// + /// For the definitions of variants and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Each variant will be + /// merged with an existing variant that matches its reference sequence, + /// start, end, reference bases, and alternative bases. If no such variant + /// exists, a new one will be created. + /// + /// When variants are merged, the call information from the new variant + /// is added to the existing variant. Variant info fields are merged as + /// specified in the + /// infoMergeConfig + /// field of the MergeVariantsRequest. + /// + /// Please exercise caution when using this method! It is easy to introduce + /// mistakes in existing variants and difficult to back out of them. For + /// example, + /// suppose you were trying to merge a new variant with an existing one and + /// both + /// variants contain calls that belong to callsets with the same callset ID. + /// + /// // Existing variant - irrelevant fields trimmed for clarity + /// { + /// "variantSetId": "10473108253681171589", + /// "referenceName": "1", + /// "start": "10582", + /// "referenceBases": "G", + /// "alternateBases": [ + /// "A" + /// ], + /// "calls": [ + /// { + /// "callSetId": "10473108253681171589-0", + /// "callSetName": "CALLSET0", + /// "genotype": [ + /// 0, + /// 1 + /// ], + /// } + /// ] + /// } + /// + /// // New variant with conflicting call information + /// { + /// "variantSetId": "10473108253681171589", + /// "referenceName": "1", + /// "start": "10582", + /// "referenceBases": "G", + /// "alternateBases": [ + /// "A" + /// ], + /// "calls": [ + /// { + /// "callSetId": "10473108253681171589-0", + /// "callSetName": "CALLSET0", + /// "genotype": [ + /// 1, + /// 1 + /// ], + /// } + /// ] + /// } + /// + /// The resulting merged variant would overwrite the existing calls with those + /// from the new variant: + /// + /// { + /// "variantSetId": "10473108253681171589", + /// "referenceName": "1", + /// "start": "10582", + /// "referenceBases": "G", + /// "alternateBases": [ + /// "A" + /// ], + /// "calls": [ + /// { + /// "callSetId": "10473108253681171589-0", + /// "callSetName": "CALLSET0", + /// "genotype": [ + /// 1, + /// 1 + /// ], + /// } + /// ] + /// } + /// + /// This may be the desired outcome, but it is up to the user to determine if + /// if that is indeed the case. /// /// # Arguments /// @@ -3253,24 +4066,11 @@ impl<'a, C, A> VariantMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates variant data by asynchronously importing the provided information. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) The variants for import will be merged with any existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant, and Variant info fields are merged as specified in infoMergeConfig. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set. + /// Creates a new variant. /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn import(&self, request: ImportVariantsRequest) -> VariantImportCall<'a, C, A> { - VariantImportCall { - hub: self.hub, - _request: request, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Creates a new variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// For the definitions of variants and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -3287,7 +4087,48 @@ impl<'a, C, A> VariantMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics. Returns the modified variant without its calls. + /// Creates variant data by asynchronously importing the provided information. + /// + /// For the definitions of variant sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// The variants for import will be merged with any existing variant that + /// matches its reference sequence, start, end, reference bases, and + /// alternative bases. If no such variant exists, a new one will be created. + /// + /// When variants are merged, the call information from the new variant + /// is added to the existing variant, and Variant info fields are merged + /// as specified in + /// infoMergeConfig. + /// As a special case, for single-sample VCF files, QUAL and FILTER fields will + /// be moved to the call level; these are sometimes interpreted in a + /// call-specific context. + /// Imported VCF headers are appended to the metadata already in a variant set. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn import(&self, request: ImportVariantsRequest) -> VariantImportCall<'a, C, A> { + VariantImportCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a variant. + /// + /// For the definitions of variants and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// This method supports patch semantics. Returns the modified variant without + /// its calls. /// /// # Arguments /// @@ -3304,23 +4145,6 @@ impl<'a, C, A> VariantMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Returns a stream of all the variants matching the search request, ordered by reference name, position, and ID. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn stream(&self, request: StreamVariantsRequest) -> VariantStreamCall<'a, C, A> { - VariantStreamCall { - hub: self.hub, - _request: request, - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -3365,7 +4189,8 @@ impl<'a, C, A> AnnotationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates an annotation. Caller must have WRITE permission for the associated dataset. + /// Updates an annotation. Caller must have + /// WRITE permission for the associated dataset. /// /// # Arguments /// @@ -3385,7 +4210,8 @@ impl<'a, C, A> AnnotationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets an annotation. Caller must have READ permission for the associated annotation set. + /// Gets an annotation. Caller must have READ permission + /// for the associated annotation set. /// /// # Arguments /// @@ -3402,7 +4228,13 @@ impl<'a, C, A> AnnotationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Searches for annotations that match the given criteria. Results are ordered by genomic coordinate (by reference sequence, then position). Annotations with equivalent genomic coordinates are returned in an unspecified order. This order is consistent, such that two queries for the same content (regardless of page size) yield annotations in the same order across their respective streams of paginated responses. Caller must have READ permission for the queried annotation sets. + /// Searches for annotations that match the given criteria. Results are + /// ordered by genomic coordinate (by reference sequence, then position). + /// Annotations with equivalent genomic coordinates are returned in an + /// unspecified order. This order is consistent, such that two queries for the + /// same content (regardless of page size) yield annotations in the same order + /// across their respective streams of paginated responses. Caller must have + /// READ permission for the queried annotation sets. /// /// # Arguments /// @@ -3419,7 +4251,8 @@ impl<'a, C, A> AnnotationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes an annotation. Caller must have WRITE permission for the associated annotation set. + /// Deletes an annotation. Caller must have WRITE permission for + /// the associated annotation set. /// /// # Arguments /// @@ -3436,7 +4269,28 @@ impl<'a, C, A> AnnotationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new annotation. Caller must have WRITE permission for the associated annotation set. The following fields are required: * annotationSetId * referenceName or referenceId ### Transcripts For annotations of type TRANSCRIPT, the following fields of transcript must be provided: * exons.start * exons.end All other fields may be optionally specified, unless documented as being server-generated (for example, the `id` field). The annotated range must be no longer than 100Mbp (mega base pairs). See the Annotation resource for additional restrictions on each field. + /// Creates a new annotation. Caller must have WRITE permission + /// for the associated annotation set. + /// + /// The following fields are required: + /// + /// * annotationSetId + /// * referenceName or + /// referenceId + /// + /// ### Transcripts + /// + /// For annotations of type TRANSCRIPT, the following fields of + /// transcript must be provided: + /// + /// * exons.start + /// * exons.end + /// + /// All other fields may be optionally specified, unless documented as being + /// server-generated (for example, the `id` field). The annotated + /// range must be no longer than 100Mbp (mega base pairs). See the + /// Annotation resource + /// for additional restrictions on each field. /// /// # Arguments /// @@ -3453,7 +4307,20 @@ impl<'a, C, A> AnnotationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates one or more new annotations atomically. All annotations must belong to the same annotation set. Caller must have WRITE permission for this annotation set. For optimal performance, batch positionally adjacent annotations together. If the request has a systemic issue, such as an attempt to write to an inaccessible annotation set, the entire RPC will fail accordingly. For lesser data issues, when possible an error will be isolated to the corresponding batch entry in the response; the remaining well formed annotations will be created normally. For details on the requirements for each individual annotation resource, see CreateAnnotation. + /// Creates one or more new annotations atomically. All annotations must + /// belong to the same annotation set. Caller must have WRITE + /// permission for this annotation set. For optimal performance, batch + /// positionally adjacent annotations together. + /// + /// If the request has a systemic issue, such as an attempt to write to + /// an inaccessible annotation set, the entire RPC will fail accordingly. For + /// lesser data issues, when possible an error will be isolated to the + /// corresponding batch entry in the response; the remaining well formed + /// annotations will be created normally. + /// + /// For details on the requirements for each individual annotation resource, + /// see + /// CreateAnnotation. /// /// # Arguments /// @@ -3511,7 +4378,9 @@ impl<'a, C, A> AnnotationsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates an annotation set. The update must respect all mutability restrictions and other invariants described on the annotation set resource. Caller must have WRITE permission for the associated dataset. + /// Updates an annotation set. The update must respect all mutability + /// restrictions and other invariants described on the annotation set resource. + /// Caller must have WRITE permission for the associated dataset. /// /// # Arguments /// @@ -3531,7 +4400,11 @@ impl<'a, C, A> AnnotationsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Searches for annotation sets that match the given criteria. Annotation sets are returned in an unspecified order. This order is consistent, such that two queries for the same content (regardless of page size) yield annotation sets in the same order across their respective streams of paginated responses. Caller must have READ permission for the queried datasets. + /// Searches for annotation sets that match the given criteria. Annotation sets + /// are returned in an unspecified order. This order is consistent, such that + /// two queries for the same content (regardless of page size) yield annotation + /// sets in the same order across their respective streams of paginated + /// responses. Caller must have READ permission for the queried datasets. /// /// # Arguments /// @@ -3548,7 +4421,16 @@ impl<'a, C, A> AnnotationsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new annotation set. Caller must have WRITE permission for the associated dataset. The following fields are required: * datasetId * referenceSetId All other fields may be optionally specified, unless documented as being server-generated (for example, the `id` field). + /// Creates a new annotation set. Caller must have WRITE permission for the + /// associated dataset. + /// + /// The following fields are required: + /// + /// * datasetId + /// * referenceSetId + /// + /// All other fields may be optionally specified, unless documented as being + /// server-generated (for example, the `id` field). /// /// # Arguments /// @@ -3565,7 +4447,8 @@ impl<'a, C, A> AnnotationsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes an annotation set. Caller must have WRITE permission for the associated annotation set. + /// Deletes an annotation set. Caller must have WRITE permission + /// for the associated annotation set. /// /// # Arguments /// @@ -3582,7 +4465,8 @@ impl<'a, C, A> AnnotationsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets an annotation set. Caller must have READ permission for the associated dataset. + /// Gets an annotation set. Caller must have READ permission for + /// the associated dataset. /// /// # Arguments /// @@ -3640,7 +4524,15 @@ impl<'a, C, A> VariantsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new variant set. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) The provided variant set must have a valid `datasetId` set - all other fields are optional. Note that the `id` field will be ignored, as this is assigned by the server. + /// Creates a new variant set. + /// + /// For the definitions of variant sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// The provided variant set must have a valid `datasetId` set - all other + /// fields are optional. Note that the `id` field will be ignored, as this is + /// assigned by the server. /// /// # Arguments /// @@ -3657,7 +4549,12 @@ impl<'a, C, A> VariantsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a variant set including all variants, call sets, and calls within. This is not reversible. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Deletes a variant set including all variants, call sets, and calls within. + /// This is not reversible. + /// + /// For the definitions of variant sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -3674,12 +4571,17 @@ impl<'a, C, A> VariantsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Exports variant set data to an external destination. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Exports variant set data to an external destination. + /// + /// For the definitions of variant sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// /// * `request` - No description provided. - /// * `variantSetId` - Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set. + /// * `variantSetId` - Required. The ID of the variant set that contains variant data which + /// should be exported. The caller must have READ access to this variant set. pub fn export(&self, request: ExportVariantSetRequest, variant_set_id: &str) -> VariantsetExportCall<'a, C, A> { VariantsetExportCall { hub: self.hub, @@ -3693,7 +4595,11 @@ impl<'a, C, A> VariantsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a variant set using patch semantics. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Updates a variant set using patch semantics. + /// + /// For the definitions of variant sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -3713,7 +4619,14 @@ impl<'a, C, A> VariantsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns a list of all variant sets matching search criteria. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). + /// Returns a list of all variant sets matching search criteria. + /// + /// For the definitions of variant sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// + /// Implements + /// [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). /// /// # Arguments /// @@ -3730,7 +4643,11 @@ impl<'a, C, A> VariantsetMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a variant set by ID. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) + /// Gets a variant set by ID. + /// + /// For the definitions of variant sets and other genomics resources, see + /// [Fundamentals of Google + /// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// # Arguments /// @@ -3832,7 +4749,7 @@ impl<'a, C, A> OperationCancelCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+name}:cancel"; + let mut url = "https://genomics.googleapis.com/v1/{+name}:cancel".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3992,17 +4909,17 @@ impl<'a, C, A> OperationCancelCall<'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) -> OperationCancelCall<'a, C, A> @@ -4030,7 +4947,9 @@ impl<'a, C, A> OperationCancelCall<'a, C, A> where C: BorrowMut, } -/// 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. +/// 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. @@ -4101,7 +5020,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+name}"; + let mut url = "https://genomics.googleapis.com/v1/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4237,17 +5156,17 @@ impl<'a, C, A> OperationGetCall<'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) -> OperationGetCall<'a, C, A> @@ -4361,7 +5280,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+name}"; + let mut url = "https://genomics.googleapis.com/v1/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4484,14 +5403,32 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: self._page_token = Some(new_value.to_string()); self } - /// The maximum number of results to return. If unspecified, defaults to 256. The maximum value is 2048. + /// The maximum number of results to return. If unspecified, defaults to + /// 256. The maximum value is 2048. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> OperationListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// A string for filtering Operations. The following filter fields are supported: * projectId: Required. Corresponds to OperationMetadata.projectId. * createTime: The time this job was created, in seconds from the [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `= 1432140000` * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` * `projectId = my-project AND labels.color = *` * `projectId = my-project AND labels.color = red` + /// A string for filtering Operations. + /// The following filter fields are supported: + /// + /// * projectId: Required. Corresponds to + /// OperationMetadata.projectId. + /// * createTime: The time this job was created, in seconds from the + /// [epoch](http://en.wikipedia.org/wiki/Unix_time). Can use `>=` and/or `<=` + /// operators. + /// * status: Can be `RUNNING`, `SUCCESS`, `FAILURE`, or `CANCELED`. Only + /// one status may be specified. + /// * labels.key where key is a label key. + /// + /// Examples: + /// + /// * `projectId = my-project AND createTime >= 1432140000` + /// * `projectId = my-project AND createTime >= 1432140000 AND createTime <= 1432150000 AND status = RUNNING` + /// * `projectId = my-project AND labels.color = *` + /// * `projectId = my-project AND labels.color = red` /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> OperationListCall<'a, C, A> { @@ -4518,17 +5455,17 @@ impl<'a, C, A> OperationListCall<'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) -> OperationListCall<'a, C, A> @@ -4556,7 +5493,11 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: } -/// Creates a new dataset. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Creates a new dataset. +/// +/// For the definitions of datasets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *create* method supported by a *dataset* resource. /// It is not used directly, but through a `DatasetMethods` instance. @@ -4631,7 +5572,7 @@ impl<'a, C, A> DatasetCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/datasets"; + let mut url = "https://genomics.googleapis.com/v1/datasets".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4757,17 +5698,17 @@ impl<'a, C, A> DatasetCreateCall<'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) -> DatasetCreateCall<'a, C, A> @@ -4795,7 +5736,16 @@ impl<'a, C, A> DatasetCreateCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes a dataset and all of its contents (all read group sets, reference sets, variant sets, call sets, annotation sets, etc.) This is reversible (up to one week after the deletion) via the datasets.undelete operation. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Deletes a dataset and all of its contents (all read group sets, +/// reference sets, variant sets, call sets, annotation sets, etc.) +/// This is reversible (up to one week after the deletion) via +/// the +/// datasets.undelete +/// operation. +/// +/// For the definitions of datasets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *delete* method supported by a *dataset* resource. /// It is not used directly, but through a `DatasetMethods` instance. @@ -4865,7 +5815,7 @@ impl<'a, C, A> DatasetDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/datasets/{datasetId}"; + let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4998,17 +5948,17 @@ impl<'a, C, A> DatasetDeleteCall<'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) -> DatasetDeleteCall<'a, C, A> @@ -5036,7 +5986,13 @@ impl<'a, C, A> DatasetDeleteCall<'a, C, A> where C: BorrowMut, A: } -/// Undeletes a dataset by restoring a dataset which was deleted via this API. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This operation is only possible for a week after the deletion occurred. +/// Undeletes a dataset by restoring a dataset which was deleted via this API. +/// +/// For the definitions of datasets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// This operation is only possible for a week after the deletion occurred. /// /// A builder for the *undelete* method supported by a *dataset* resource. /// It is not used directly, but through a `DatasetMethods` instance. @@ -5113,7 +6069,7 @@ impl<'a, C, A> DatasetUndeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/datasets/{datasetId}:undelete"; + let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}:undelete".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5270,17 +6226,17 @@ impl<'a, C, A> DatasetUndeleteCall<'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) -> DatasetUndeleteCall<'a, C, A> @@ -5308,7 +6264,15 @@ impl<'a, C, A> DatasetUndeleteCall<'a, C, A> where C: BorrowMut, } -/// Sets the access control policy on the specified dataset. Replaces any existing policy. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) See Setting a Policy for more information. +/// Sets the access control policy on the specified dataset. Replaces any +/// existing policy. +/// +/// For the definitions of datasets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// See Setting a +/// Policy for more information. /// /// A builder for the *setIamPolicy* method supported by a *dataset* resource. /// It is not used directly, but through a `DatasetMethods` instance. @@ -5386,7 +6350,7 @@ impl<'a, C, A> DatasetSetIamPolicyCall<'a, C, A> where C: BorrowMut DatasetSetIamPolicyCall<'a, C, A> where C: BorrowMut`. /// /// Sets the *resource* path property to the given value. /// @@ -5546,17 +6511,17 @@ impl<'a, C, A> DatasetSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DatasetSetIamPolicyCall<'a, C, A> @@ -5584,7 +6549,13 @@ impl<'a, C, A> DatasetSetIamPolicyCall<'a, C, A> where C: BorrowMutTesting +/// Permissions for more information. +/// +/// For the definitions of datasets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *testIamPermissions* method supported by a *dataset* resource. /// It is not used directly, but through a `DatasetMethods` instance. @@ -5662,7 +6633,7 @@ impl<'a, C, A> DatasetTestIamPermissionCall<'a, C, A> where C: BorrowMut DatasetTestIamPermissionCall<'a, C, A> where C: BorrowMut`. /// /// Sets the *resource* path property to the given value. /// @@ -5822,17 +6794,17 @@ impl<'a, C, A> DatasetTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DatasetTestIamPermissionCall<'a, C, A> @@ -5860,7 +6832,11 @@ impl<'a, C, A> DatasetTestIamPermissionCall<'a, C, A> where C: BorrowMut DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/datasets/{datasetId}"; + let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6063,17 +7039,17 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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> @@ -6101,7 +7077,11 @@ impl<'a, C, A> DatasetGetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Lists datasets within a project. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Lists datasets within a project. +/// +/// For the definitions of datasets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *list* method supported by a *dataset* resource. /// It is not used directly, but through a `DatasetMethods` instance. @@ -6184,7 +7164,7 @@ impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/datasets"; + let mut url = "https://genomics.googleapis.com/v1/datasets".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6273,14 +7253,17 @@ impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: o self._project_id = Some(new_value.to_string()); self } - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> DatasetListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The maximum number of results to return in a single page. If unspecified, defaults to 50. The maximum value is 1024. + /// The maximum number of results to return in a single page. If unspecified, + /// defaults to 50. The maximum value is 1024. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> DatasetListCall<'a, C, A> { @@ -6307,17 +7290,17 @@ impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: o /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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> @@ -6345,7 +7328,15 @@ impl<'a, C, A> DatasetListCall<'a, C, A> where C: BorrowMut, A: o } -/// Gets the access control policy for the dataset. This is empty if the policy or resource does not exist. See Getting a Policy for more information. For the definitions of datasets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Gets the access control policy for the dataset. This is empty if the +/// policy or resource does not exist. +/// +/// See Getting a +/// Policy for more information. +/// +/// For the definitions of datasets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *getIamPolicy* method supported by a *dataset* resource. /// It is not used directly, but through a `DatasetMethods` instance. @@ -6423,7 +7414,7 @@ impl<'a, C, A> DatasetGetIamPolicyCall<'a, C, A> where C: BorrowMut DatasetGetIamPolicyCall<'a, C, A> where C: BorrowMut`. /// /// Sets the *resource* path property to the given value. /// @@ -6583,17 +7575,17 @@ impl<'a, C, A> DatasetGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> DatasetGetIamPolicyCall<'a, C, A> @@ -6621,7 +7613,13 @@ impl<'a, C, A> DatasetGetIamPolicyCall<'a, C, A> where C: BorrowMut DatasetPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/datasets/{datasetId}"; + let mut url = "https://genomics.googleapis.com/v1/datasets/{datasetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6840,7 +7838,10 @@ impl<'a, C, A> DatasetPatchCall<'a, C, A> where C: BorrowMut, A: self._dataset_id = new_value.to_string(); self } - /// An optional mask specifying which fields to update. At this time, the only mutable field is name. The only acceptable value is "name". If unspecified, all mutable fields will be updated. + /// An optional mask specifying which fields to update. At this time, the only + /// mutable field is name. The only + /// acceptable value is "name". If unspecified, all mutable fields will be + /// updated. /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> DatasetPatchCall<'a, C, A> { @@ -6867,17 +7868,17 @@ impl<'a, C, A> DatasetPatchCall<'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) -> DatasetPatchCall<'a, C, A> @@ -6905,7 +7906,14 @@ impl<'a, C, A> DatasetPatchCall<'a, C, A> where C: BorrowMut, A: } -/// Searches for reference sets which match the given criteria. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71) +/// Searches for reference sets which match the given criteria. +/// +/// For the definitions of references and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// Implements +/// [GlobalAllianceApi.searchReferenceSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L71) /// /// A builder for the *search* method supported by a *referenceset* resource. /// It is not used directly, but through a `ReferencesetMethods` instance. @@ -6980,7 +7988,7 @@ impl<'a, C, A> ReferencesetSearchCall<'a, C, A> where C: BorrowMut ReferencesetSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReferencesetSearchCall<'a, C, A> @@ -7144,7 +8152,14 @@ impl<'a, C, A> ReferencesetSearchCall<'a, C, A> where C: BorrowMut ReferencesetGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/referencesets/{referenceSetId}"; + let mut url = "https://genomics.googleapis.com/v1/referencesets/{referenceSetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7347,17 +8362,17 @@ impl<'a, C, A> ReferencesetGetCall<'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) -> ReferencesetGetCall<'a, C, A> @@ -7385,7 +8400,14 @@ impl<'a, C, A> ReferencesetGetCall<'a, C, A> where C: BorrowMut, } -/// Gets a list of call sets matching the criteria. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). +/// Gets a list of call sets matching the criteria. +/// +/// For the definitions of call sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// Implements +/// [GlobalAllianceApi.searchCallSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L178). /// /// A builder for the *search* method supported by a *callset* resource. /// It is not used directly, but through a `CallsetMethods` instance. @@ -7460,7 +8482,7 @@ impl<'a, C, A> CallsetSearchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/callsets/search"; + let mut url = "https://genomics.googleapis.com/v1/callsets/search".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7586,17 +8608,17 @@ impl<'a, C, A> CallsetSearchCall<'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) -> CallsetSearchCall<'a, C, A> @@ -7624,7 +8646,13 @@ impl<'a, C, A> CallsetSearchCall<'a, C, A> where C: BorrowMut, A: } -/// Updates a call set. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics. +/// Updates a call set. +/// +/// For the definitions of call sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// This method supports patch semantics. /// /// A builder for the *patch* method supported by a *callset* resource. /// It is not used directly, but through a `CallsetMethods` instance. @@ -7706,7 +8734,7 @@ impl<'a, C, A> CallsetPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/callsets/{callSetId}"; + let mut url = "https://genomics.googleapis.com/v1/callsets/{callSetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7843,7 +8871,10 @@ impl<'a, C, A> CallsetPatchCall<'a, C, A> where C: BorrowMut, A: self._call_set_id = new_value.to_string(); self } - /// An optional mask specifying which fields to update. At this time, the only mutable field is name. The only acceptable value is "name". If unspecified, all mutable fields will be updated. + /// An optional mask specifying which fields to update. At this time, the only + /// mutable field is name. The only + /// acceptable value is "name". If unspecified, all mutable fields will be + /// updated. /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> CallsetPatchCall<'a, C, A> { @@ -7870,17 +8901,17 @@ impl<'a, C, A> CallsetPatchCall<'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) -> CallsetPatchCall<'a, C, A> @@ -7908,7 +8939,11 @@ impl<'a, C, A> CallsetPatchCall<'a, C, A> where C: BorrowMut, A: } -/// Creates a new call set. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Creates a new call set. +/// +/// For the definitions of call sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *create* method supported by a *callset* resource. /// It is not used directly, but through a `CallsetMethods` instance. @@ -7983,7 +9018,7 @@ impl<'a, C, A> CallsetCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/callsets"; + let mut url = "https://genomics.googleapis.com/v1/callsets".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8109,17 +9144,17 @@ impl<'a, C, A> CallsetCreateCall<'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) -> CallsetCreateCall<'a, C, A> @@ -8147,7 +9182,11 @@ impl<'a, C, A> CallsetCreateCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes a call set. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Deletes a call set. +/// +/// For the definitions of call sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *delete* method supported by a *callset* resource. /// It is not used directly, but through a `CallsetMethods` instance. @@ -8217,7 +9256,7 @@ impl<'a, C, A> CallsetDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/callsets/{callSetId}"; + let mut url = "https://genomics.googleapis.com/v1/callsets/{callSetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8350,17 +9389,17 @@ impl<'a, C, A> CallsetDeleteCall<'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) -> CallsetDeleteCall<'a, C, A> @@ -8388,7 +9427,11 @@ impl<'a, C, A> CallsetDeleteCall<'a, C, A> where C: BorrowMut, A: } -/// Gets a call set by ID. For the definitions of call sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Gets a call set by ID. +/// +/// For the definitions of call sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *get* method supported by a *callset* resource. /// It is not used directly, but through a `CallsetMethods` instance. @@ -8458,7 +9501,7 @@ impl<'a, C, A> CallsetGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/callsets/{callSetId}"; + let mut url = "https://genomics.googleapis.com/v1/callsets/{callSetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8591,17 +9634,17 @@ impl<'a, C, A> CallsetGetCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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> @@ -8629,7 +9672,30 @@ impl<'a, C, A> CallsetGetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Gets a list of reads for one or more read group sets. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Reads search operates over a genomic coordinate space of reference sequence & position defined over the reference sequences to which the requested read group sets are aligned. If a target positional range is specified, search returns all reads whose alignment to the reference genome overlap the range. A query which specifies only read group set IDs yields all reads in those read group sets, including unmapped reads. All reads returned (including reads on subsequent pages) are ordered by genomic coordinate (by reference sequence, then position). Reads with equivalent genomic coordinates are returned in an unspecified order. This order is consistent, such that two queries for the same content (regardless of page size) yield reads in the same order across their respective streams of paginated responses. Implements [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85). +/// Gets a list of reads for one or more read group sets. +/// +/// For the definitions of read group sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// Reads search operates over a genomic coordinate space of reference sequence +/// & position defined over the reference sequences to which the requested +/// read group sets are aligned. +/// +/// If a target positional range is specified, search returns all reads whose +/// alignment to the reference genome overlap the range. A query which +/// specifies only read group set IDs yields all reads in those read group +/// sets, including unmapped reads. +/// +/// All reads returned (including reads on subsequent pages) are ordered by +/// genomic coordinate (by reference sequence, then position). Reads with +/// equivalent genomic coordinates are returned in an unspecified order. This +/// order is consistent, such that two queries for the same content (regardless +/// of page size) yield reads in the same order across their respective streams +/// of paginated responses. +/// +/// Implements +/// [GlobalAllianceApi.searchReads](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/readmethods.avdl#L85). /// /// A builder for the *search* method supported by a *read* resource. /// It is not used directly, but through a `ReadMethods` instance. @@ -8704,7 +9770,7 @@ impl<'a, C, A> ReadSearchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/reads/search"; + let mut url = "https://genomics.googleapis.com/v1/reads/search".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8830,17 +9896,17 @@ impl<'a, C, A> ReadSearchCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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> @@ -8868,246 +9934,16 @@ impl<'a, C, A> ReadSearchCall<'a, C, A> where C: BorrowMut, A: oa } -/// Returns a stream of all the reads matching the search request, ordered by reference name, position, and ID. -/// -/// A builder for the *stream* method supported by a *read* resource. -/// It is not used directly, but through a `ReadMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_genomics1 as genomics1; -/// use genomics1::StreamReadsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use genomics1::Genomics; +/// Exports a read group set to a BAM file in Google Cloud Storage. /// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Genomics::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = StreamReadsRequest::default(); +/// For the definitions of read group sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.reads().stream(req) -/// .doit(); -/// # } -/// ``` -pub struct ReadStreamCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Genomics, - _request: StreamReadsRequest, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ReadStreamCall<'a, C, A> {} - -impl<'a, C, A> ReadStreamCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StreamReadsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "genomics.reads.stream", - 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/reads:stream"; - 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: StreamReadsRequest) -> ReadStreamCall<'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) -> ReadStreamCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> ReadStreamCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ReadStreamCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Exports a read group set to a BAM file in Google Cloud Storage. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Note that currently there may be some differences between exported BAM files and the original BAM file at the time of import. See ImportReadGroupSets for caveats. +/// Note that currently there may be some differences between exported BAM +/// files and the original BAM file at the time of import. See +/// ImportReadGroupSets +/// for caveats. /// /// A builder for the *export* method supported by a *readgroupset* resource. /// It is not used directly, but through a `ReadgroupsetMethods` instance. @@ -9184,7 +10020,7 @@ impl<'a, C, A> ReadgroupsetExportCall<'a, C, A> where C: BorrowMut ReadgroupsetExportCall<'a, C, A> where C: BorrowMut ReadgroupsetExportCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetExportCall<'a, C, A> @@ -9379,7 +10216,24 @@ impl<'a, C, A> ReadgroupsetExportCall<'a, C, A> where C: BorrowMut ReadgroupsetImportCall<'a, C, A> where C: BorrowMut ReadgroupsetImportCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetImportCall<'a, C, A> @@ -9618,7 +10472,13 @@ impl<'a, C, A> ReadgroupsetImportCall<'a, C, A> where C: BorrowMut ReadgroupsetPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/readgroupsets/{readGroupSetId}"; + let mut url = "https://genomics.googleapis.com/v1/readgroupsets/{readGroupSetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9827,7 +10687,8 @@ impl<'a, C, A> ReadgroupsetPatchCall<'a, C, A> where C: BorrowMut self._request = new_value; self } - /// The ID of the read group set to be updated. The caller must have WRITE permissions to the dataset associated with this read group set. + /// The ID of the read group set to be updated. The caller must have WRITE + /// permissions to the dataset associated with this read group set. /// /// Sets the *read group set id* path property to the given value. /// @@ -9837,7 +10698,13 @@ impl<'a, C, A> ReadgroupsetPatchCall<'a, C, A> where C: BorrowMut self._read_group_set_id = new_value.to_string(); self } - /// An optional mask specifying which fields to update. Supported fields: * name. * referenceSetId. Leaving `updateMask` unset is equivalent to specifying all mutable fields. + /// An optional mask specifying which fields to update. Supported fields: + /// + /// * name. + /// * referenceSetId. + /// + /// Leaving `updateMask` unset is equivalent to specifying all mutable + /// fields. /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> ReadgroupsetPatchCall<'a, C, A> { @@ -9864,17 +10731,17 @@ impl<'a, C, A> ReadgroupsetPatchCall<'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) -> ReadgroupsetPatchCall<'a, C, A> @@ -9902,7 +10769,11 @@ impl<'a, C, A> ReadgroupsetPatchCall<'a, C, A> where C: BorrowMut } -/// Gets a read group set by ID. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Gets a read group set by ID. +/// +/// For the definitions of read group sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *get* method supported by a *readgroupset* resource. /// It is not used directly, but through a `ReadgroupsetMethods` instance. @@ -9972,7 +10843,7 @@ impl<'a, C, A> ReadgroupsetGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/readgroupsets/{readGroupSetId}"; + let mut url = "https://genomics.googleapis.com/v1/readgroupsets/{readGroupSetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10105,17 +10976,17 @@ impl<'a, C, A> ReadgroupsetGetCall<'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) -> ReadgroupsetGetCall<'a, C, A> @@ -10143,7 +11014,19 @@ impl<'a, C, A> ReadgroupsetGetCall<'a, C, A> where C: BorrowMut, } -/// Lists fixed width coverage buckets for a read group set, each of which correspond to a range of a reference sequence. Each bucket summarizes coverage information across its corresponding genomic range. For the definitions of read group sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Coverage is defined as the number of reads which are aligned to a given base in the reference sequence. Coverage buckets are available at several precomputed bucket widths, enabling retrieval of various coverage 'zoom levels'. The caller must have READ permissions for the target read group set. +/// Lists fixed width coverage buckets for a read group set, each of which +/// correspond to a range of a reference sequence. Each bucket summarizes +/// coverage information across its corresponding genomic range. +/// +/// For the definitions of read group sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// Coverage is defined as the number of reads which are aligned to a given +/// base in the reference sequence. Coverage buckets are available at several +/// precomputed bucket widths, enabling retrieval of various coverage 'zoom +/// levels'. The caller must have READ permissions for the target read group +/// set. /// /// A builder for the *coveragebuckets.list* method supported by a *readgroupset* resource. /// It is not used directly, but through a `ReadgroupsetMethods` instance. @@ -10243,7 +11126,7 @@ impl<'a, C, A> ReadgroupsetCoveragebucketListCall<'a, C, A> where C: BorrowMut ReadgroupsetCoveragebucketListCall<'a, C, A> where C: BorrowMut ReadgroupsetCoveragebucketListCall<'a, C, A> { self._target_bucket_width = Some(new_value.to_string()); self } - /// The start position of the range on the reference, 0-based inclusive. If specified, `referenceName` must also be specified. Defaults to 0. + /// The start position of the range on the reference, 0-based inclusive. If + /// specified, `referenceName` must also be specified. Defaults to 0. /// /// Sets the *start* query property to the given value. pub fn start(mut self, new_value: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { self._start = Some(new_value.to_string()); self } - /// The name of the reference to query, within the reference set associated with this query. Optional. + /// The name of the reference to query, within the reference set associated + /// with this query. Optional. /// /// Sets the *reference name* query property to the given value. pub fn reference_name(mut self, new_value: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { self._reference_name = Some(new_value.to_string()); self } - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The maximum number of results to return in a single page. If unspecified, defaults to 1024. The maximum value is 2048. + /// The maximum number of results to return in a single page. If unspecified, + /// defaults to 1024. The maximum value is 2048. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// The end position of the range on the reference, 0-based exclusive. If specified, `referenceName` must also be specified. If unset or 0, defaults to the length of the reference. + /// The end position of the range on the reference, 0-based exclusive. If + /// specified, `referenceName` must also be specified. If unset or 0, defaults + /// to the length of the reference. /// /// Sets the *end* query property to the given value. pub fn end(mut self, new_value: &str) -> ReadgroupsetCoveragebucketListCall<'a, C, A> { @@ -10418,17 +11314,17 @@ impl<'a, C, A> ReadgroupsetCoveragebucketListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetCoveragebucketListCall<'a, C, A> @@ -10456,7 +11352,11 @@ impl<'a, C, A> ReadgroupsetCoveragebucketListCall<'a, C, A> where C: BorrowMut ReadgroupsetDeleteCall<'a, C, A> where C: BorrowMut ReadgroupsetDeleteCall<'a, C, A> where C: BorrowMut ReadgroupsetDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetDeleteCall<'a, C, A> @@ -10697,7 +11598,14 @@ impl<'a, C, A> ReadgroupsetDeleteCall<'a, C, A> where C: BorrowMut ReadgroupsetSearchCall<'a, C, A> where C: BorrowMut ReadgroupsetSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ReadgroupsetSearchCall<'a, C, A> @@ -10936,7 +11844,14 @@ impl<'a, C, A> ReadgroupsetSearchCall<'a, C, A> where C: BorrowMut ReferenceBaseListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/references/{referenceId}/bases"; + let mut url = "https://genomics.googleapis.com/v1/references/{referenceId}/bases".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11146,21 +12061,26 @@ impl<'a, C, A> ReferenceBaseListCall<'a, C, A> where C: BorrowMut self._start = Some(new_value.to_string()); self } - /// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of `nextPageToken` from the previous response. + /// The continuation token, which is used to page through large result sets. + /// To get the next page of results, set this parameter to the value of + /// `nextPageToken` from the previous response. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ReferenceBaseListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The maximum number of bases to return in a single page. If unspecified, defaults to 200Kbp (kilo base pairs). The maximum value is 10Mbp (mega base pairs). + /// The maximum number of bases to return in a single page. If unspecified, + /// defaults to 200Kbp (kilo base pairs). The maximum value is 10Mbp (mega base + /// pairs). /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ReferenceBaseListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// The end position (0-based, exclusive) of this query. Defaults to the length of this reference. + /// The end position (0-based, exclusive) of this query. Defaults to the length + /// of this reference. /// /// Sets the *end* query property to the given value. pub fn end(mut self, new_value: &str) -> ReferenceBaseListCall<'a, C, A> { @@ -11187,17 +12107,17 @@ impl<'a, C, A> ReferenceBaseListCall<'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) -> ReferenceBaseListCall<'a, C, A> @@ -11225,7 +12145,14 @@ impl<'a, C, A> ReferenceBaseListCall<'a, C, A> where C: BorrowMut } -/// Searches for references which match the given criteria. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). +/// Searches for references which match the given criteria. +/// +/// For the definitions of references and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// Implements +/// [GlobalAllianceApi.searchReferences](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L146). /// /// A builder for the *search* method supported by a *reference* resource. /// It is not used directly, but through a `ReferenceMethods` instance. @@ -11300,7 +12227,7 @@ impl<'a, C, A> ReferenceSearchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/references/search"; + let mut url = "https://genomics.googleapis.com/v1/references/search".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11426,17 +12353,17 @@ impl<'a, C, A> ReferenceSearchCall<'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) -> ReferenceSearchCall<'a, C, A> @@ -11464,7 +12391,14 @@ impl<'a, C, A> ReferenceSearchCall<'a, C, A> where C: BorrowMut, } -/// Gets a reference. For the definitions of references and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). +/// Gets a reference. +/// +/// For the definitions of references and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// Implements +/// [GlobalAllianceApi.getReference](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/referencemethods.avdl#L158). /// /// A builder for the *get* method supported by a *reference* resource. /// It is not used directly, but through a `ReferenceMethods` instance. @@ -11534,7 +12468,7 @@ impl<'a, C, A> ReferenceGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/references/{referenceId}"; + let mut url = "https://genomics.googleapis.com/v1/references/{referenceId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11667,17 +12601,17 @@ impl<'a, C, A> ReferenceGetCall<'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) -> ReferenceGetCall<'a, C, A> @@ -11705,7 +12639,14 @@ impl<'a, C, A> ReferenceGetCall<'a, C, A> where C: BorrowMut, A: } -/// Gets a list of variants matching the criteria. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). +/// Gets a list of variants matching the criteria. +/// +/// For the definitions of variants and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// Implements +/// [GlobalAllianceApi.searchVariants](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L126). /// /// A builder for the *search* method supported by a *variant* resource. /// It is not used directly, but through a `VariantMethods` instance. @@ -11780,7 +12721,7 @@ impl<'a, C, A> VariantSearchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variants/search"; + let mut url = "https://genomics.googleapis.com/v1/variants/search".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11906,17 +12847,17 @@ impl<'a, C, A> VariantSearchCall<'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) -> VariantSearchCall<'a, C, A> @@ -11944,7 +12885,11 @@ impl<'a, C, A> VariantSearchCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes a variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Deletes a variant. +/// +/// For the definitions of variants and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *delete* method supported by a *variant* resource. /// It is not used directly, but through a `VariantMethods` instance. @@ -12014,7 +12959,7 @@ impl<'a, C, A> VariantDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variants/{variantId}"; + let mut url = "https://genomics.googleapis.com/v1/variants/{variantId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12147,17 +13092,17 @@ impl<'a, C, A> VariantDeleteCall<'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) -> VariantDeleteCall<'a, C, A> @@ -12185,7 +13130,11 @@ impl<'a, C, A> VariantDeleteCall<'a, C, A> where C: BorrowMut, A: } -/// Gets a variant by ID. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Gets a variant by ID. +/// +/// For the definitions of variants and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *get* method supported by a *variant* resource. /// It is not used directly, but through a `VariantMethods` instance. @@ -12255,7 +13204,7 @@ impl<'a, C, A> VariantGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variants/{variantId}"; + let mut url = "https://genomics.googleapis.com/v1/variants/{variantId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12388,17 +13337,17 @@ impl<'a, C, A> VariantGetCall<'a, C, A> where C: BorrowMut, A: oa /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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> @@ -12426,7 +13375,97 @@ impl<'a, C, A> VariantGetCall<'a, C, A> where C: BorrowMut, A: oa } -/// Merges the given variants with existing variants. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Each variant will be merged with an existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant. Variant info fields are merged as specified in the infoMergeConfig field of the MergeVariantsRequest. Please exercise caution when using this method! It is easy to introduce mistakes in existing variants and difficult to back out of them. For example, suppose you were trying to merge a new variant with an existing one and both variants contain calls that belong to callsets with the same callset ID. // Existing variant - irrelevant fields trimmed for clarity { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 0, 1 ], } ] } // New variant with conflicting call information { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 1, 1 ], } ] } The resulting merged variant would overwrite the existing calls with those from the new variant: { "variantSetId": "10473108253681171589", "referenceName": "1", "start": "10582", "referenceBases": "G", "alternateBases": [ "A" ], "calls": [ { "callSetId": "10473108253681171589-0", "callSetName": "CALLSET0", "genotype": [ 1, 1 ], } ] } This may be the desired outcome, but it is up to the user to determine if if that is indeed the case. +/// Merges the given variants with existing variants. +/// +/// For the definitions of variants and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// Each variant will be +/// merged with an existing variant that matches its reference sequence, +/// start, end, reference bases, and alternative bases. If no such variant +/// exists, a new one will be created. +/// +/// When variants are merged, the call information from the new variant +/// is added to the existing variant. Variant info fields are merged as +/// specified in the +/// infoMergeConfig +/// field of the MergeVariantsRequest. +/// +/// Please exercise caution when using this method! It is easy to introduce +/// mistakes in existing variants and difficult to back out of them. For +/// example, +/// suppose you were trying to merge a new variant with an existing one and +/// both +/// variants contain calls that belong to callsets with the same callset ID. +/// +/// // Existing variant - irrelevant fields trimmed for clarity +/// { +/// "variantSetId": "10473108253681171589", +/// "referenceName": "1", +/// "start": "10582", +/// "referenceBases": "G", +/// "alternateBases": [ +/// "A" +/// ], +/// "calls": [ +/// { +/// "callSetId": "10473108253681171589-0", +/// "callSetName": "CALLSET0", +/// "genotype": [ +/// 0, +/// 1 +/// ], +/// } +/// ] +/// } +/// +/// // New variant with conflicting call information +/// { +/// "variantSetId": "10473108253681171589", +/// "referenceName": "1", +/// "start": "10582", +/// "referenceBases": "G", +/// "alternateBases": [ +/// "A" +/// ], +/// "calls": [ +/// { +/// "callSetId": "10473108253681171589-0", +/// "callSetName": "CALLSET0", +/// "genotype": [ +/// 1, +/// 1 +/// ], +/// } +/// ] +/// } +/// +/// The resulting merged variant would overwrite the existing calls with those +/// from the new variant: +/// +/// { +/// "variantSetId": "10473108253681171589", +/// "referenceName": "1", +/// "start": "10582", +/// "referenceBases": "G", +/// "alternateBases": [ +/// "A" +/// ], +/// "calls": [ +/// { +/// "callSetId": "10473108253681171589-0", +/// "callSetName": "CALLSET0", +/// "genotype": [ +/// 1, +/// 1 +/// ], +/// } +/// ] +/// } +/// +/// This may be the desired outcome, but it is up to the user to determine if +/// if that is indeed the case. /// /// A builder for the *merge* method supported by a *variant* resource. /// It is not used directly, but through a `VariantMethods` instance. @@ -12501,7 +13540,7 @@ impl<'a, C, A> VariantMergeCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variants:merge"; + let mut url = "https://genomics.googleapis.com/v1/variants:merge".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12627,17 +13666,17 @@ impl<'a, C, A> VariantMergeCall<'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) -> VariantMergeCall<'a, C, A> @@ -12665,246 +13704,11 @@ impl<'a, C, A> VariantMergeCall<'a, C, A> where C: BorrowMut, A: } -/// Creates variant data by asynchronously importing the provided information. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) The variants for import will be merged with any existing variant that matches its reference sequence, start, end, reference bases, and alternative bases. If no such variant exists, a new one will be created. When variants are merged, the call information from the new variant is added to the existing variant, and Variant info fields are merged as specified in infoMergeConfig. As a special case, for single-sample VCF files, QUAL and FILTER fields will be moved to the call level; these are sometimes interpreted in a call-specific context. Imported VCF headers are appended to the metadata already in a variant set. -/// -/// A builder for the *import* method supported by a *variant* resource. -/// It is not used directly, but through a `VariantMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_genomics1 as genomics1; -/// use genomics1::ImportVariantsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use genomics1::Genomics; +/// Creates a new variant. /// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Genomics::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = ImportVariantsRequest::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.variants().import(req) -/// .doit(); -/// # } -/// ``` -pub struct VariantImportCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Genomics, - _request: ImportVariantsRequest, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for VariantImportCall<'a, C, A> {} - -impl<'a, C, A> VariantImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "genomics.variants.import", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - for &field in ["alt"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/variants:import"; - 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: ImportVariantsRequest) -> VariantImportCall<'a, C, A> { - self._request = new_value; - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantImportCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). - /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). - /// * *alt* (query-string) - Data format for response. - /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> VariantImportCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> VariantImportCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Creates a new variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// For the definitions of variants and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *create* method supported by a *variant* resource. /// It is not used directly, but through a `VariantMethods` instance. @@ -12979,7 +13783,7 @@ impl<'a, C, A> VariantCreateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variants"; + let mut url = "https://genomics.googleapis.com/v1/variants".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13105,17 +13909,17 @@ impl<'a, C, A> VariantCreateCall<'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) -> VariantCreateCall<'a, C, A> @@ -13143,7 +13947,270 @@ impl<'a, C, A> VariantCreateCall<'a, C, A> where C: BorrowMut, A: } -/// Updates a variant. For the definitions of variants and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) This method supports patch semantics. Returns the modified variant without its calls. +/// Creates variant data by asynchronously importing the provided information. +/// +/// For the definitions of variant sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// The variants for import will be merged with any existing variant that +/// matches its reference sequence, start, end, reference bases, and +/// alternative bases. If no such variant exists, a new one will be created. +/// +/// When variants are merged, the call information from the new variant +/// is added to the existing variant, and Variant info fields are merged +/// as specified in +/// infoMergeConfig. +/// As a special case, for single-sample VCF files, QUAL and FILTER fields will +/// be moved to the call level; these are sometimes interpreted in a +/// call-specific context. +/// Imported VCF headers are appended to the metadata already in a variant set. +/// +/// A builder for the *import* method supported by a *variant* resource. +/// It is not used directly, but through a `VariantMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_genomics1 as genomics1; +/// use genomics1::ImportVariantsRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use genomics1::Genomics; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Genomics::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ImportVariantsRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.variants().import(req) +/// .doit(); +/// # } +/// ``` +pub struct VariantImportCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Genomics, + _request: ImportVariantsRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for VariantImportCall<'a, C, A> {} + +impl<'a, C, A> VariantImportCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Operation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "genomics.variants.import", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://genomics.googleapis.com/v1/variants:import".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ImportVariantsRequest) -> VariantImportCall<'a, C, A> { + self._request = new_value; + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> VariantImportCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - 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) -> VariantImportCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> VariantImportCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a variant. +/// +/// For the definitions of variants and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// This method supports patch semantics. Returns the modified variant without +/// its calls. /// /// A builder for the *patch* method supported by a *variant* resource. /// It is not used directly, but through a `VariantMethods` instance. @@ -13225,7 +14292,7 @@ impl<'a, C, A> VariantPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variants/{variantId}"; + let mut url = "https://genomics.googleapis.com/v1/variants/{variantId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13362,7 +14429,10 @@ impl<'a, C, A> VariantPatchCall<'a, C, A> where C: BorrowMut, A: self._variant_id = new_value.to_string(); self } - /// An optional mask specifying which fields to update. At this time, mutable fields are names and info. Acceptable values are "names" and "info". If unspecified, all mutable fields will be updated. + /// An optional mask specifying which fields to update. At this time, mutable + /// fields are names and + /// info. Acceptable values are "names" and + /// "info". If unspecified, all mutable fields will be updated. /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> VariantPatchCall<'a, C, A> { @@ -13389,17 +14459,17 @@ impl<'a, C, A> VariantPatchCall<'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) -> VariantPatchCall<'a, C, A> @@ -13427,246 +14497,8 @@ impl<'a, C, A> VariantPatchCall<'a, C, A> where C: BorrowMut, A: } -/// Returns a stream of all the variants matching the search request, ordered by reference name, position, and ID. -/// -/// A builder for the *stream* method supported by a *variant* resource. -/// It is not used directly, but through a `VariantMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_genomics1 as genomics1; -/// use genomics1::StreamVariantsRequest; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use genomics1::Genomics; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Genomics::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = StreamVariantsRequest::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.variants().stream(req) -/// .doit(); -/// # } -/// ``` -pub struct VariantStreamCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Genomics, - _request: StreamVariantsRequest, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for VariantStreamCall<'a, C, A> {} - -impl<'a, C, A> VariantStreamCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, StreamVariantsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "genomics.variants.stream", - 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/variants:stream"; - 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: StreamVariantsRequest) -> VariantStreamCall<'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) -> VariantStreamCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> VariantStreamCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> VariantStreamCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Updates an annotation. Caller must have WRITE permission for the associated dataset. +/// Updates an annotation. Caller must have +/// WRITE permission for the associated dataset. /// /// A builder for the *update* method supported by a *annotation* resource. /// It is not used directly, but through a `AnnotationMethods` instance. @@ -13748,7 +14580,7 @@ impl<'a, C, A> AnnotationUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/annotations/{annotationId}"; + let mut url = "https://genomics.googleapis.com/v1/annotations/{annotationId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13885,7 +14717,12 @@ impl<'a, C, A> AnnotationUpdateCall<'a, C, A> where C: BorrowMut, self._annotation_id = new_value.to_string(); self } - /// An optional mask specifying which fields to update. Mutable fields are name, variant, transcript, and info. If unspecified, all mutable fields will be updated. + /// An optional mask specifying which fields to update. Mutable fields are + /// name, + /// variant, + /// transcript, and + /// info. If unspecified, all mutable + /// fields will be updated. /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> AnnotationUpdateCall<'a, C, A> { @@ -13912,17 +14749,17 @@ impl<'a, C, A> AnnotationUpdateCall<'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) -> AnnotationUpdateCall<'a, C, A> @@ -13950,7 +14787,8 @@ impl<'a, C, A> AnnotationUpdateCall<'a, C, A> where C: BorrowMut, } -/// Gets an annotation. Caller must have READ permission for the associated annotation set. +/// Gets an annotation. Caller must have READ permission +/// for the associated annotation set. /// /// A builder for the *get* method supported by a *annotation* resource. /// It is not used directly, but through a `AnnotationMethods` instance. @@ -14020,7 +14858,7 @@ impl<'a, C, A> AnnotationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/annotations/{annotationId}"; + let mut url = "https://genomics.googleapis.com/v1/annotations/{annotationId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -14153,17 +14991,17 @@ impl<'a, C, A> AnnotationGetCall<'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) -> AnnotationGetCall<'a, C, A> @@ -14191,7 +15029,13 @@ impl<'a, C, A> AnnotationGetCall<'a, C, A> where C: BorrowMut, A: } -/// Searches for annotations that match the given criteria. Results are ordered by genomic coordinate (by reference sequence, then position). Annotations with equivalent genomic coordinates are returned in an unspecified order. This order is consistent, such that two queries for the same content (regardless of page size) yield annotations in the same order across their respective streams of paginated responses. Caller must have READ permission for the queried annotation sets. +/// Searches for annotations that match the given criteria. Results are +/// ordered by genomic coordinate (by reference sequence, then position). +/// Annotations with equivalent genomic coordinates are returned in an +/// unspecified order. This order is consistent, such that two queries for the +/// same content (regardless of page size) yield annotations in the same order +/// across their respective streams of paginated responses. Caller must have +/// READ permission for the queried annotation sets. /// /// A builder for the *search* method supported by a *annotation* resource. /// It is not used directly, but through a `AnnotationMethods` instance. @@ -14266,7 +15110,7 @@ impl<'a, C, A> AnnotationSearchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/annotations/search"; + let mut url = "https://genomics.googleapis.com/v1/annotations/search".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14392,17 +15236,17 @@ impl<'a, C, A> AnnotationSearchCall<'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) -> AnnotationSearchCall<'a, C, A> @@ -14430,7 +15274,8 @@ impl<'a, C, A> AnnotationSearchCall<'a, C, A> where C: BorrowMut, } -/// Deletes an annotation. Caller must have WRITE permission for the associated annotation set. +/// Deletes an annotation. Caller must have WRITE permission for +/// the associated annotation set. /// /// A builder for the *delete* method supported by a *annotation* resource. /// It is not used directly, but through a `AnnotationMethods` instance. @@ -14500,7 +15345,7 @@ impl<'a, C, A> AnnotationDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/annotations/{annotationId}"; + let mut url = "https://genomics.googleapis.com/v1/annotations/{annotationId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14633,17 +15478,17 @@ impl<'a, C, A> AnnotationDeleteCall<'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) -> AnnotationDeleteCall<'a, C, A> @@ -14671,7 +15516,28 @@ impl<'a, C, A> AnnotationDeleteCall<'a, C, A> where C: BorrowMut, } -/// Creates a new annotation. Caller must have WRITE permission for the associated annotation set. The following fields are required: * annotationSetId * referenceName or referenceId ### Transcripts For annotations of type TRANSCRIPT, the following fields of transcript must be provided: * exons.start * exons.end All other fields may be optionally specified, unless documented as being server-generated (for example, the `id` field). The annotated range must be no longer than 100Mbp (mega base pairs). See the Annotation resource for additional restrictions on each field. +/// Creates a new annotation. Caller must have WRITE permission +/// for the associated annotation set. +/// +/// The following fields are required: +/// +/// * annotationSetId +/// * referenceName or +/// referenceId +/// +/// ### Transcripts +/// +/// For annotations of type TRANSCRIPT, the following fields of +/// transcript must be provided: +/// +/// * exons.start +/// * exons.end +/// +/// All other fields may be optionally specified, unless documented as being +/// server-generated (for example, the `id` field). The annotated +/// range must be no longer than 100Mbp (mega base pairs). See the +/// Annotation resource +/// for additional restrictions on each field. /// /// A builder for the *create* method supported by a *annotation* resource. /// It is not used directly, but through a `AnnotationMethods` instance. @@ -14746,7 +15612,7 @@ impl<'a, C, A> AnnotationCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/annotations"; + let mut url = "https://genomics.googleapis.com/v1/annotations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -14872,17 +15738,17 @@ impl<'a, C, A> AnnotationCreateCall<'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) -> AnnotationCreateCall<'a, C, A> @@ -14910,7 +15776,20 @@ impl<'a, C, A> AnnotationCreateCall<'a, C, A> where C: BorrowMut, } -/// Creates one or more new annotations atomically. All annotations must belong to the same annotation set. Caller must have WRITE permission for this annotation set. For optimal performance, batch positionally adjacent annotations together. If the request has a systemic issue, such as an attempt to write to an inaccessible annotation set, the entire RPC will fail accordingly. For lesser data issues, when possible an error will be isolated to the corresponding batch entry in the response; the remaining well formed annotations will be created normally. For details on the requirements for each individual annotation resource, see CreateAnnotation. +/// Creates one or more new annotations atomically. All annotations must +/// belong to the same annotation set. Caller must have WRITE +/// permission for this annotation set. For optimal performance, batch +/// positionally adjacent annotations together. +/// +/// If the request has a systemic issue, such as an attempt to write to +/// an inaccessible annotation set, the entire RPC will fail accordingly. For +/// lesser data issues, when possible an error will be isolated to the +/// corresponding batch entry in the response; the remaining well formed +/// annotations will be created normally. +/// +/// For details on the requirements for each individual annotation resource, +/// see +/// CreateAnnotation. /// /// A builder for the *batchCreate* method supported by a *annotation* resource. /// It is not used directly, but through a `AnnotationMethods` instance. @@ -14985,7 +15864,7 @@ impl<'a, C, A> AnnotationBatchCreateCall<'a, C, A> where C: BorrowMut AnnotationBatchCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationBatchCreateCall<'a, C, A> @@ -15149,7 +16028,9 @@ impl<'a, C, A> AnnotationBatchCreateCall<'a, C, A> where C: BorrowMut AnnotationsetUpdateCall<'a, C, A> where C: BorrowMut AnnotationsetUpdateCall<'a, C, A> where C: BorrowMut AnnotationsetUpdateCall<'a, C, A> { @@ -15395,17 +16280,17 @@ impl<'a, C, A> AnnotationsetUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetUpdateCall<'a, C, A> @@ -15433,7 +16318,11 @@ impl<'a, C, A> AnnotationsetUpdateCall<'a, C, A> where C: BorrowMut AnnotationsetSearchCall<'a, C, A> where C: BorrowMut AnnotationsetSearchCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetSearchCall<'a, C, A> @@ -15672,7 +16561,16 @@ impl<'a, C, A> AnnotationsetSearchCall<'a, C, A> where C: BorrowMut AnnotationsetCreateCall<'a, C, A> where C: BorrowMut AnnotationsetCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetCreateCall<'a, C, A> @@ -15911,7 +16809,8 @@ impl<'a, C, A> AnnotationsetCreateCall<'a, C, A> where C: BorrowMut AnnotationsetDeleteCall<'a, C, A> where C: BorrowMut AnnotationsetDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AnnotationsetDeleteCall<'a, C, A> @@ -16152,7 +17051,8 @@ impl<'a, C, A> AnnotationsetDeleteCall<'a, C, A> where C: BorrowMut AnnotationsetGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/annotationsets/{annotationSetId}"; + let mut url = "https://genomics.googleapis.com/v1/annotationsets/{annotationSetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -16355,17 +17255,17 @@ impl<'a, C, A> AnnotationsetGetCall<'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) -> AnnotationsetGetCall<'a, C, A> @@ -16393,7 +17293,15 @@ impl<'a, C, A> AnnotationsetGetCall<'a, C, A> where C: BorrowMut, } -/// Creates a new variant set. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) The provided variant set must have a valid `datasetId` set - all other fields are optional. Note that the `id` field will be ignored, as this is assigned by the server. +/// Creates a new variant set. +/// +/// For the definitions of variant sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// The provided variant set must have a valid `datasetId` set - all other +/// fields are optional. Note that the `id` field will be ignored, as this is +/// assigned by the server. /// /// A builder for the *create* method supported by a *variantset* resource. /// It is not used directly, but through a `VariantsetMethods` instance. @@ -16468,7 +17376,7 @@ impl<'a, C, A> VariantsetCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variantsets"; + let mut url = "https://genomics.googleapis.com/v1/variantsets".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -16594,17 +17502,17 @@ impl<'a, C, A> VariantsetCreateCall<'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) -> VariantsetCreateCall<'a, C, A> @@ -16632,7 +17540,12 @@ impl<'a, C, A> VariantsetCreateCall<'a, C, A> where C: BorrowMut, } -/// Deletes a variant set including all variants, call sets, and calls within. This is not reversible. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Deletes a variant set including all variants, call sets, and calls within. +/// This is not reversible. +/// +/// For the definitions of variant sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *delete* method supported by a *variantset* resource. /// It is not used directly, but through a `VariantsetMethods` instance. @@ -16702,7 +17615,7 @@ impl<'a, C, A> VariantsetDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variantsets/{variantSetId}"; + let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -16835,17 +17748,17 @@ impl<'a, C, A> VariantsetDeleteCall<'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) -> VariantsetDeleteCall<'a, C, A> @@ -16873,7 +17786,11 @@ impl<'a, C, A> VariantsetDeleteCall<'a, C, A> where C: BorrowMut, } -/// Exports variant set data to an external destination. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Exports variant set data to an external destination. +/// +/// For the definitions of variant sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *export* method supported by a *variantset* resource. /// It is not used directly, but through a `VariantsetMethods` instance. @@ -16950,7 +17867,7 @@ impl<'a, C, A> VariantsetExportCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variantsets/{variantSetId}:export"; + let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}:export".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Bigquery.as_ref().to_string(), ()); } @@ -17077,7 +17994,8 @@ impl<'a, C, A> VariantsetExportCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// Required. The ID of the variant set that contains variant data which should be exported. The caller must have READ access to this variant set. + /// Required. The ID of the variant set that contains variant data which + /// should be exported. The caller must have READ access to this variant set. /// /// Sets the *variant set id* path property to the given value. /// @@ -17107,17 +18025,17 @@ impl<'a, C, A> VariantsetExportCall<'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) -> VariantsetExportCall<'a, C, A> @@ -17145,7 +18063,11 @@ impl<'a, C, A> VariantsetExportCall<'a, C, A> where C: BorrowMut, } -/// Updates a variant set using patch semantics. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Updates a variant set using patch semantics. +/// +/// For the definitions of variant sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *patch* method supported by a *variantset* resource. /// It is not used directly, but through a `VariantsetMethods` instance. @@ -17227,7 +18149,7 @@ impl<'a, C, A> VariantsetPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variantsets/{variantSetId}"; + let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -17364,7 +18286,14 @@ impl<'a, C, A> VariantsetPatchCall<'a, C, A> where C: BorrowMut, self._variant_set_id = new_value.to_string(); self } - /// An optional mask specifying which fields to update. Supported fields: * metadata. * name. * description. Leaving `updateMask` unset is equivalent to specifying all mutable fields. + /// An optional mask specifying which fields to update. Supported fields: + /// + /// * metadata. + /// * name. + /// * description. + /// + /// Leaving `updateMask` unset is equivalent to specifying all mutable + /// fields. /// /// Sets the *update mask* query property to the given value. pub fn update_mask(mut self, new_value: &str) -> VariantsetPatchCall<'a, C, A> { @@ -17391,17 +18320,17 @@ impl<'a, C, A> VariantsetPatchCall<'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) -> VariantsetPatchCall<'a, C, A> @@ -17429,7 +18358,14 @@ impl<'a, C, A> VariantsetPatchCall<'a, C, A> where C: BorrowMut, } -/// Returns a list of all variant sets matching search criteria. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) Implements [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). +/// Returns a list of all variant sets matching search criteria. +/// +/// For the definitions of variant sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// +/// Implements +/// [GlobalAllianceApi.searchVariantSets](https://github.com/ga4gh/schemas/blob/v0.5.1/src/main/resources/avro/variantmethods.avdl#L49). /// /// A builder for the *search* method supported by a *variantset* resource. /// It is not used directly, but through a `VariantsetMethods` instance. @@ -17504,7 +18440,7 @@ impl<'a, C, A> VariantsetSearchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variantsets/search"; + let mut url = "https://genomics.googleapis.com/v1/variantsets/search".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -17630,17 +18566,17 @@ impl<'a, C, A> VariantsetSearchCall<'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) -> VariantsetSearchCall<'a, C, A> @@ -17668,7 +18604,11 @@ impl<'a, C, A> VariantsetSearchCall<'a, C, A> where C: BorrowMut, } -/// Gets a variant set by ID. For the definitions of variant sets and other genomics resources, see [Fundamentals of Google Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) +/// Gets a variant set by ID. +/// +/// For the definitions of variant sets and other genomics resources, see +/// [Fundamentals of Google +/// Genomics](https://cloud.google.com/genomics/fundamentals-of-google-genomics) /// /// A builder for the *get* method supported by a *variantset* resource. /// It is not used directly, but through a `VariantsetMethods` instance. @@ -17738,7 +18678,7 @@ impl<'a, C, A> VariantsetGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/variantsets/{variantSetId}"; + let mut url = "https://genomics.googleapis.com/v1/variantsets/{variantSetId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -17871,17 +18811,17 @@ impl<'a, C, A> VariantsetGetCall<'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) -> VariantsetGetCall<'a, C, A> @@ -17909,3 +18849,4 @@ impl<'a, C, A> VariantsetGetCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/gmail1-cli/Cargo.toml b/gen/gmail1-cli/Cargo.toml index 73458c1932..f281262a57 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.4+20161206" +version = "1.0.4+20170510" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-gmail1] path = "../gmail1" -version = "1.0.4+20161206" +version = "1.0.4+20170510" diff --git a/gen/gmail1-cli/README.md b/gen/gmail1-cli/README.md index 6d563768d9..1aaa677856 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 *20161206*. The CLI is at version *1.0.4*. +This documentation was generated from the *gmail* API at revision *20170510*. The CLI is at version *1.0.4*. ```bash gmail1 [options] @@ -73,6 +73,11 @@ gmail1 [options] settings-send-as-get [-p ]... [-o ] settings-send-as-list [-p ]... [-o ] settings-send-as-patch (-r )... [-p ]... [-o ] + settings-send-as-smime-info-delete [-p ]... + settings-send-as-smime-info-get [-p ]... [-o ] + settings-send-as-smime-info-insert (-r )... [-p ]... [-o ] + settings-send-as-smime-info-list [-p ]... [-o ] + settings-send-as-smime-info-set-default [-p ]... settings-send-as-update (-r )... [-p ]... [-o ] settings-send-as-verify [-p ]... settings-update-auto-forwarding (-r )... [-p ]... [-o ] diff --git a/gen/gmail1-cli/mkdocs.yml b/gen/gmail1-cli/mkdocs.yml index a3916b6bde..5e31fd8e3f 100644 --- a/gen/gmail1-cli/mkdocs.yml +++ b/gen/gmail1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: gmail v1.0.4+20161206 +site_name: gmail v1.0.4+20170510 site_url: http://byron.github.io/google-apis-rs/google-gmail1-cli site_description: A complete library to interact with gmail (protocol v1) @@ -52,6 +52,11 @@ pages: - ['users_settings-send-as-get.md', 'Users', 'Settings Send As Get'] - ['users_settings-send-as-list.md', 'Users', 'Settings Send As List'] - ['users_settings-send-as-patch.md', 'Users', 'Settings Send As Patch'] +- ['users_settings-send-as-smime-info-delete.md', 'Users', 'Settings Send As Smime Info Delete'] +- ['users_settings-send-as-smime-info-get.md', 'Users', 'Settings Send As Smime Info Get'] +- ['users_settings-send-as-smime-info-insert.md', 'Users', 'Settings Send As Smime Info Insert'] +- ['users_settings-send-as-smime-info-list.md', 'Users', 'Settings Send As Smime Info List'] +- ['users_settings-send-as-smime-info-set-default.md', 'Users', 'Settings Send As Smime Info Set Default'] - ['users_settings-send-as-update.md', 'Users', 'Settings Send As Update'] - ['users_settings-send-as-verify.md', 'Users', 'Settings Send As Verify'] - ['users_settings-update-auto-forwarding.md', 'Users', 'Settings Update Auto Forwarding'] diff --git a/gen/gmail1-cli/src/main.rs b/gen/gmail1-cli/src/main.rs index 3b5732ff11..4b7aa8a6df 100644 --- a/gen/gmail1-cli/src/main.rs +++ b/gen/gmail1-cli/src/main.rs @@ -590,6 +590,9 @@ impl<'n> Engine<'n> { "label-id" => { call = call.label_id(value.unwrap_or("")); }, + "history-types" => { + call = call.add_history_types(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -603,7 +606,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", "label-id", "start-history-id", "max-results"].iter().map(|v|*v)); + v.extend(["page-token", "label-id", "start-history-id", "max-results", "history-types"].iter().map(|v|*v)); v } )); } } @@ -2988,6 +2991,289 @@ impl<'n> Engine<'n> { } } + fn _users_settings_send_as_smime_info_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().settings_send_as_smime_info_delete(opt.value_of("user-id").unwrap_or(""), opt.value_of("send-as-email").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 _users_settings_send_as_smime_info_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().settings_send_as_smime_info_get(opt.value_of("user-id").unwrap_or(""), opt.value_of("send-as-email").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 _users_settings_send_as_smime_info_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()[..] { + "pkcs12" => Some(("pkcs12", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "pem" => Some(("pem", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "expiration" => Some(("expiration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "encrypted-key-password" => Some(("encryptedKeyPassword", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "issuer-cn" => Some(("issuerCn", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-default" => Some(("isDefault", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["encrypted-key-password", "expiration", "id", "is-default", "issuer-cn", "pem", "pkcs12"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SmimeInfo = json::value::from_value(object).unwrap(); + let mut call = self.hub.users().settings_send_as_smime_info_insert(request, opt.value_of("user-id").unwrap_or(""), opt.value_of("send-as-email").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_settings_send_as_smime_info_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().settings_send_as_smime_info_list(opt.value_of("user-id").unwrap_or(""), opt.value_of("send-as-email").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_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_settings_send_as_smime_info_set_default(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().settings_send_as_smime_info_set_default(opt.value_of("user-id").unwrap_or(""), opt.value_of("send-as-email").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 _users_settings_send_as_update(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -4110,6 +4396,21 @@ impl<'n> Engine<'n> { ("settings-send-as-patch", Some(opt)) => { call_result = self._users_settings_send_as_patch(opt, dry_run, &mut err); }, + ("settings-send-as-smime-info-delete", Some(opt)) => { + call_result = self._users_settings_send_as_smime_info_delete(opt, dry_run, &mut err); + }, + ("settings-send-as-smime-info-get", Some(opt)) => { + call_result = self._users_settings_send_as_smime_info_get(opt, dry_run, &mut err); + }, + ("settings-send-as-smime-info-insert", Some(opt)) => { + call_result = self._users_settings_send_as_smime_info_insert(opt, dry_run, &mut err); + }, + ("settings-send-as-smime-info-list", Some(opt)) => { + call_result = self._users_settings_send_as_smime_info_list(opt, dry_run, &mut err); + }, + ("settings-send-as-smime-info-set-default", Some(opt)) => { + call_result = self._users_settings_send_as_smime_info_set_default(opt, dry_run, &mut err); + }, ("settings-send-as-update", Some(opt)) => { call_result = self._users_settings_send_as_update(opt, dry_run, &mut err); }, @@ -4241,7 +4542,7 @@ fn main() { let mut exit_status = 0i32; let upload_value_names = ["mode", "file"]; let arg_data = [ - ("users", "methods: 'drafts-create', 'drafts-delete', 'drafts-get', 'drafts-list', 'drafts-send', 'drafts-update', 'get-profile', 'history-list', 'labels-create', 'labels-delete', 'labels-get', 'labels-list', 'labels-patch', 'labels-update', 'messages-attachments-get', 'messages-batch-delete', 'messages-batch-modify', 'messages-delete', 'messages-get', 'messages-import', 'messages-insert', 'messages-list', 'messages-modify', 'messages-send', 'messages-trash', 'messages-untrash', 'settings-filters-create', 'settings-filters-delete', 'settings-filters-get', 'settings-filters-list', 'settings-forwarding-addresses-create', 'settings-forwarding-addresses-delete', 'settings-forwarding-addresses-get', 'settings-forwarding-addresses-list', 'settings-get-auto-forwarding', 'settings-get-imap', 'settings-get-pop', 'settings-get-vacation', 'settings-send-as-create', 'settings-send-as-delete', 'settings-send-as-get', 'settings-send-as-list', 'settings-send-as-patch', 'settings-send-as-update', 'settings-send-as-verify', 'settings-update-auto-forwarding', 'settings-update-imap', 'settings-update-pop', 'settings-update-vacation', 'stop', 'threads-delete', 'threads-get', 'threads-list', 'threads-modify', 'threads-trash', 'threads-untrash' and 'watch'", vec![ + ("users", "methods: 'drafts-create', 'drafts-delete', 'drafts-get', 'drafts-list', 'drafts-send', 'drafts-update', 'get-profile', 'history-list', 'labels-create', 'labels-delete', 'labels-get', 'labels-list', 'labels-patch', 'labels-update', 'messages-attachments-get', 'messages-batch-delete', 'messages-batch-modify', 'messages-delete', 'messages-get', 'messages-import', 'messages-insert', 'messages-list', 'messages-modify', 'messages-send', 'messages-trash', 'messages-untrash', 'settings-filters-create', 'settings-filters-delete', 'settings-filters-get', 'settings-filters-list', 'settings-forwarding-addresses-create', 'settings-forwarding-addresses-delete', 'settings-forwarding-addresses-get', 'settings-forwarding-addresses-list', 'settings-get-auto-forwarding', 'settings-get-imap', 'settings-get-pop', 'settings-get-vacation', 'settings-send-as-create', 'settings-send-as-delete', 'settings-send-as-get', 'settings-send-as-list', 'settings-send-as-patch', 'settings-send-as-smime-info-delete', 'settings-send-as-smime-info-get', 'settings-send-as-smime-info-insert', 'settings-send-as-smime-info-list', 'settings-send-as-smime-info-set-default', 'settings-send-as-update', 'settings-send-as-verify', 'settings-update-auto-forwarding', 'settings-update-imap', 'settings-update-pop', 'settings-update-vacation', 'stop', 'threads-delete', 'threads-get', 'threads-list', 'threads-modify', 'threads-trash', 'threads-untrash' and 'watch'", vec![ ("drafts-create", Some(r##"Creates a new draft with the DRAFT label."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_drafts-create", @@ -5077,7 +5378,9 @@ fn main() { Some(false)), ]), ("settings-forwarding-addresses-create", - Some(r##"Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted."##), + Some(r##"Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. + + This method is only available to service account clients that have been delegated domain-wide authority."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-forwarding-addresses-create", vec![ (Some(r##"user-id"##), @@ -5105,7 +5408,9 @@ fn main() { Some(false)), ]), ("settings-forwarding-addresses-delete", - Some(r##"Deletes the specified forwarding address and revokes any verification that may have been required."##), + Some(r##"Deletes the specified forwarding address and revokes any verification that may have been required. + + This method is only available to service account clients that have been delegated domain-wide authority."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-forwarding-addresses-delete", vec![ (Some(r##"user-id"##), @@ -5265,7 +5570,9 @@ fn main() { Some(false)), ]), ("settings-send-as-create", - Some(r##"Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias."##), + Some(r##"Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. + + This method is only available to service account clients that have been delegated domain-wide authority."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-send-as-create", vec![ (Some(r##"user-id"##), @@ -5293,7 +5600,9 @@ fn main() { Some(false)), ]), ("settings-send-as-delete", - Some(r##"Deletes the specified send-as alias. Revokes any verification that may have been required for using it."##), + Some(r##"Deletes the specified send-as alias. Revokes any verification that may have been required for using it. + + This method is only available to service account clients that have been delegated domain-wide authority."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-send-as-delete", vec![ (Some(r##"user-id"##), @@ -5365,7 +5674,9 @@ fn main() { Some(false)), ]), ("settings-send-as-patch", - Some(r##"Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. This method supports patch semantics."##), + Some(r##"Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. + + Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. This method supports patch semantics."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-send-as-patch", vec![ (Some(r##"user-id"##), @@ -5398,8 +5709,162 @@ fn main() { Some(false), Some(false)), ]), + ("settings-send-as-smime-info-delete", + Some(r##"Deletes the specified S/MIME config for the specified send-as alias."##), + "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-send-as-smime-info-delete", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"The user's email address. The special value me can be used to indicate the authenticated user."##), + Some(true), + Some(false)), + + (Some(r##"send-as-email"##), + None, + Some(r##"The email address that appears in the "From:" header for mail sent using this alias."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"The immutable ID for the SmimeInfo."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + ]), + ("settings-send-as-smime-info-get", + Some(r##"Gets the specified S/MIME config for the specified send-as alias."##), + "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-send-as-smime-info-get", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"The user's email address. The special value me can be used to indicate the authenticated user."##), + Some(true), + Some(false)), + + (Some(r##"send-as-email"##), + None, + Some(r##"The email address that appears in the "From:" header for mail sent using this alias."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"The immutable ID for the SmimeInfo."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("settings-send-as-smime-info-insert", + Some(r##"Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key."##), + "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-send-as-smime-info-insert", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"The user's email address. The special value me can be used to indicate the authenticated user."##), + Some(true), + Some(false)), + + (Some(r##"send-as-email"##), + None, + Some(r##"The email address that appears in the "From:" header for mail sent using this alias."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("settings-send-as-smime-info-list", + Some(r##"Lists S/MIME configs for the specified send-as alias."##), + "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-send-as-smime-info-list", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"The user's email address. The special value me can be used to indicate the authenticated user."##), + Some(true), + Some(false)), + + (Some(r##"send-as-email"##), + None, + Some(r##"The email address that appears in the "From:" header for mail sent using this alias."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("settings-send-as-smime-info-set-default", + Some(r##"Sets the default S/MIME config for the specified send-as alias."##), + "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-send-as-smime-info-set-default", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"The user's email address. The special value me can be used to indicate the authenticated user."##), + Some(true), + Some(false)), + + (Some(r##"send-as-email"##), + None, + Some(r##"The email address that appears in the "From:" header for mail sent using this alias."##), + Some(true), + Some(false)), + + (Some(r##"id"##), + None, + Some(r##"The immutable ID for the SmimeInfo."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + ]), ("settings-send-as-update", - Some(r##"Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias."##), + Some(r##"Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. + + Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-send-as-update", vec![ (Some(r##"user-id"##), @@ -5433,7 +5898,9 @@ fn main() { Some(false)), ]), ("settings-send-as-verify", - Some(r##"Sends a verification email to the specified send-as alias address. The verification status must be pending."##), + Some(r##"Sends a verification email to the specified send-as alias address. The verification status must be pending. + + This method is only available to service account clients that have been delegated domain-wide authority."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-send-as-verify", vec![ (Some(r##"user-id"##), @@ -5455,7 +5922,9 @@ fn main() { Some(true)), ]), ("settings-update-auto-forwarding", - Some(r##"Updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled."##), + Some(r##"Updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled. + + This method is only available to service account clients that have been delegated domain-wide authority."##), "Details at http://byron.github.io/google-apis-rs/google_gmail1_cli/users_settings-update-auto-forwarding", vec![ (Some(r##"user-id"##), @@ -5778,7 +6247,7 @@ fn main() { let mut app = App::new("gmail1") .author("Sebastian Thiel ") - .version("1.0.4+20161206") + .version("1.0.4+20170510") .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 ce7439ab4b..5e54a81cef 100644 --- a/gen/gmail1/Cargo.toml +++ b/gen/gmail1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-gmail1" -version = "1.0.4+20161206" +version = "1.0.4+20170510" 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.4+20161206" +documentation = "https://docs.rs/google-gmail1/1.0.4+20170510" license = "MIT" keywords = ["gmail", "google", "protocol", "web", "api"] diff --git a/gen/gmail1/README.md b/gen/gmail1/README.md index 7fb54a6973..51c447f133 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.4+20161206*, where *20161206* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *gmail* crate version *1.0.4+20170510*, where *20170510* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161206/google_gmail1/struct.Gmail.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.Gmail.html) ... * users - * [*drafts create*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserDraftCreateCall.html), [*drafts delete*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserDraftDeleteCall.html), [*drafts get*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserDraftGetCall.html), [*drafts list*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserDraftListCall.html), [*drafts send*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserDraftSendCall.html), [*drafts update*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserDraftUpdateCall.html), [*get profile*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserGetProfileCall.html), [*history list*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserHistoryListCall.html), [*labels create*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserLabelCreateCall.html), [*labels delete*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserLabelDeleteCall.html), [*labels get*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserLabelGetCall.html), [*labels list*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserLabelListCall.html), [*labels patch*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserLabelPatchCall.html), [*labels update*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserLabelUpdateCall.html), [*messages attachments get*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageAttachmentGetCall.html), [*messages batch delete*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageBatchDeleteCall.html), [*messages batch modify*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageBatchModifyCall.html), [*messages delete*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageDeleteCall.html), [*messages get*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageGetCall.html), [*messages import*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageImportCall.html), [*messages insert*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageInsertCall.html), [*messages list*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageListCall.html), [*messages modify*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageModifyCall.html), [*messages send*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageSendCall.html), [*messages trash*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageTrashCall.html), [*messages untrash*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageUntrashCall.html), [*settings filters create*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingFilterCreateCall.html), [*settings filters delete*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingFilterDeleteCall.html), [*settings filters get*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingFilterGetCall.html), [*settings filters list*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingFilterListCall.html), [*settings forwarding addresses create*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingForwardingAddresseCreateCall.html), [*settings forwarding addresses delete*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingForwardingAddresseDeleteCall.html), [*settings forwarding addresses get*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingForwardingAddresseGetCall.html), [*settings forwarding addresses list*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingForwardingAddresseListCall.html), [*settings get auto forwarding*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingGetAutoForwardingCall.html), [*settings get imap*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingGetImapCall.html), [*settings get pop*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingGetPopCall.html), [*settings get vacation*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingGetVacationCall.html), [*settings send as create*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingSendACreateCall.html), [*settings send as delete*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingSendADeleteCall.html), [*settings send as get*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingSendAGetCall.html), [*settings send as list*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingSendAListCall.html), [*settings send as patch*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingSendAPatchCall.html), [*settings send as update*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingSendAUpdateCall.html), [*settings send as verify*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingSendAVerifyCall.html), [*settings update auto forwarding*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingUpdateAutoForwardingCall.html), [*settings update imap*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingUpdateImapCall.html), [*settings update pop*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingUpdatePopCall.html), [*settings update vacation*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserSettingUpdateVacationCall.html), [*stop*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserStopCall.html), [*threads delete*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserThreadDeleteCall.html), [*threads get*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserThreadGetCall.html), [*threads list*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserThreadListCall.html), [*threads modify*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserThreadModifyCall.html), [*threads trash*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserThreadTrashCall.html), [*threads untrash*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserThreadUntrashCall.html) and [*watch*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserWatchCall.html) + * [*drafts create*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserDraftCreateCall.html), [*drafts delete*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserDraftDeleteCall.html), [*drafts get*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserDraftGetCall.html), [*drafts list*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserDraftListCall.html), [*drafts send*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserDraftSendCall.html), [*drafts update*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserDraftUpdateCall.html), [*get profile*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserGetProfileCall.html), [*history list*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserHistoryListCall.html), [*labels create*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserLabelCreateCall.html), [*labels delete*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserLabelDeleteCall.html), [*labels get*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserLabelGetCall.html), [*labels list*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserLabelListCall.html), [*labels patch*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserLabelPatchCall.html), [*labels update*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserLabelUpdateCall.html), [*messages attachments get*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageAttachmentGetCall.html), [*messages batch delete*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageBatchDeleteCall.html), [*messages batch modify*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageBatchModifyCall.html), [*messages delete*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageDeleteCall.html), [*messages get*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageGetCall.html), [*messages import*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageImportCall.html), [*messages insert*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageInsertCall.html), [*messages list*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageListCall.html), [*messages modify*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageModifyCall.html), [*messages send*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageSendCall.html), [*messages trash*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageTrashCall.html), [*messages untrash*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageUntrashCall.html), [*settings filters create*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingFilterCreateCall.html), [*settings filters delete*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingFilterDeleteCall.html), [*settings filters get*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingFilterGetCall.html), [*settings filters list*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingFilterListCall.html), [*settings forwarding addresses create*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingForwardingAddresseCreateCall.html), [*settings forwarding addresses delete*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingForwardingAddresseDeleteCall.html), [*settings forwarding addresses get*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingForwardingAddresseGetCall.html), [*settings forwarding addresses list*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingForwardingAddresseListCall.html), [*settings get auto forwarding*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingGetAutoForwardingCall.html), [*settings get imap*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingGetImapCall.html), [*settings get pop*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingGetPopCall.html), [*settings get vacation*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingGetVacationCall.html), [*settings send as create*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendACreateCall.html), [*settings send as delete*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendADeleteCall.html), [*settings send as get*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendAGetCall.html), [*settings send as list*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendAListCall.html), [*settings send as patch*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendAPatchCall.html), [*settings send as smime info delete*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendASmimeInfoDeleteCall.html), [*settings send as smime info get*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendASmimeInfoGetCall.html), [*settings send as smime info insert*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendASmimeInfoInsertCall.html), [*settings send as smime info list*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendASmimeInfoListCall.html), [*settings send as smime info set default*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendASmimeInfoSetDefaultCall.html), [*settings send as update*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendAUpdateCall.html), [*settings send as verify*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingSendAVerifyCall.html), [*settings update auto forwarding*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingUpdateAutoForwardingCall.html), [*settings update imap*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingUpdateImapCall.html), [*settings update pop*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingUpdatePopCall.html), [*settings update vacation*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserSettingUpdateVacationCall.html), [*stop*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserStopCall.html), [*threads delete*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserThreadDeleteCall.html), [*threads get*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserThreadGetCall.html), [*threads list*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserThreadListCall.html), [*threads modify*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserThreadModifyCall.html), [*threads trash*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserThreadTrashCall.html), [*threads untrash*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserThreadUntrashCall.html) and [*watch*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserWatchCall.html) Upload supported by ... -* [*messages import users*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageImportCall.html) -* [*drafts create users*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserDraftCreateCall.html) -* [*drafts send users*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserDraftSendCall.html) -* [*messages send users*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageSendCall.html) -* [*drafts update users*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserDraftUpdateCall.html) -* [*messages insert users*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/struct.UserMessageInsertCall.html) +* [*messages import users*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageImportCall.html) +* [*drafts create users*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserDraftCreateCall.html) +* [*drafts send users*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserDraftSendCall.html) +* [*messages send users*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserMessageSendCall.html) +* [*drafts update users*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/struct.UserDraftUpdateCall.html) +* [*messages insert users*](https://docs.rs/google-gmail1/1.0.4+20170510/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.4+20161206/google_gmail1/struct.Gmail.html)** +* **[Hub](https://docs.rs/google-gmail1/1.0.4+20170510/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.4+20161206/google_gmail1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-gmail1/1.0.4+20170510/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.4+20161206/google_gmail1/trait.Part.html)** + * **[Parts](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-gmail1/1.0.4+20161206/google_gmail1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-gmail1/1.0.4+20170510/google_gmail1/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-gmail1/1.0.4+20161206/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.4+20170510/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.4+20161206/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.4+20170510/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.4+20161206/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.4+20170510/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.4+20161206/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.4+20170510/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")`. @@ -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-gmail1/1.0.4+20161206/google_gmail1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-gmail1/1.0.4+20161206/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.4+20170510/google_gmail1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-gmail1/1.0.4+20170510/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.4+20161206/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.4+20170510/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.4+20161206/google_gmail1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-gmail1/1.0.4+20161206/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.4+20170510/google_gmail1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-gmail1/1.0.4+20170510/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.4+20161206/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.4+20170510/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.4+20161206/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.4+20170510/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.4+20161206/google_gmail1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-gmail1/1.0.4+20170510/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 11110367eb..39c7644965 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.4+20161206*, where *20161206* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *gmail* crate version *1.0.4+20170510*, where *20170510* is the exact revision of the *gmail:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *gmail* *v1* API can be found at the //! [official documentation site](https://developers.google.com/gmail/api/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Gmail.html) ... //! //! * users -//! * [*drafts create*](struct.UserDraftCreateCall.html), [*drafts delete*](struct.UserDraftDeleteCall.html), [*drafts get*](struct.UserDraftGetCall.html), [*drafts list*](struct.UserDraftListCall.html), [*drafts send*](struct.UserDraftSendCall.html), [*drafts update*](struct.UserDraftUpdateCall.html), [*get profile*](struct.UserGetProfileCall.html), [*history list*](struct.UserHistoryListCall.html), [*labels create*](struct.UserLabelCreateCall.html), [*labels delete*](struct.UserLabelDeleteCall.html), [*labels get*](struct.UserLabelGetCall.html), [*labels list*](struct.UserLabelListCall.html), [*labels patch*](struct.UserLabelPatchCall.html), [*labels update*](struct.UserLabelUpdateCall.html), [*messages attachments get*](struct.UserMessageAttachmentGetCall.html), [*messages batch delete*](struct.UserMessageBatchDeleteCall.html), [*messages batch modify*](struct.UserMessageBatchModifyCall.html), [*messages delete*](struct.UserMessageDeleteCall.html), [*messages get*](struct.UserMessageGetCall.html), [*messages import*](struct.UserMessageImportCall.html), [*messages insert*](struct.UserMessageInsertCall.html), [*messages list*](struct.UserMessageListCall.html), [*messages modify*](struct.UserMessageModifyCall.html), [*messages send*](struct.UserMessageSendCall.html), [*messages trash*](struct.UserMessageTrashCall.html), [*messages untrash*](struct.UserMessageUntrashCall.html), [*settings filters create*](struct.UserSettingFilterCreateCall.html), [*settings filters delete*](struct.UserSettingFilterDeleteCall.html), [*settings filters get*](struct.UserSettingFilterGetCall.html), [*settings filters list*](struct.UserSettingFilterListCall.html), [*settings forwarding addresses create*](struct.UserSettingForwardingAddresseCreateCall.html), [*settings forwarding addresses delete*](struct.UserSettingForwardingAddresseDeleteCall.html), [*settings forwarding addresses get*](struct.UserSettingForwardingAddresseGetCall.html), [*settings forwarding addresses list*](struct.UserSettingForwardingAddresseListCall.html), [*settings get auto forwarding*](struct.UserSettingGetAutoForwardingCall.html), [*settings get imap*](struct.UserSettingGetImapCall.html), [*settings get pop*](struct.UserSettingGetPopCall.html), [*settings get vacation*](struct.UserSettingGetVacationCall.html), [*settings send as create*](struct.UserSettingSendACreateCall.html), [*settings send as delete*](struct.UserSettingSendADeleteCall.html), [*settings send as get*](struct.UserSettingSendAGetCall.html), [*settings send as list*](struct.UserSettingSendAListCall.html), [*settings send as patch*](struct.UserSettingSendAPatchCall.html), [*settings send as update*](struct.UserSettingSendAUpdateCall.html), [*settings send as verify*](struct.UserSettingSendAVerifyCall.html), [*settings update auto forwarding*](struct.UserSettingUpdateAutoForwardingCall.html), [*settings update imap*](struct.UserSettingUpdateImapCall.html), [*settings update pop*](struct.UserSettingUpdatePopCall.html), [*settings update vacation*](struct.UserSettingUpdateVacationCall.html), [*stop*](struct.UserStopCall.html), [*threads delete*](struct.UserThreadDeleteCall.html), [*threads get*](struct.UserThreadGetCall.html), [*threads list*](struct.UserThreadListCall.html), [*threads modify*](struct.UserThreadModifyCall.html), [*threads trash*](struct.UserThreadTrashCall.html), [*threads untrash*](struct.UserThreadUntrashCall.html) and [*watch*](struct.UserWatchCall.html) +//! * [*drafts create*](struct.UserDraftCreateCall.html), [*drafts delete*](struct.UserDraftDeleteCall.html), [*drafts get*](struct.UserDraftGetCall.html), [*drafts list*](struct.UserDraftListCall.html), [*drafts send*](struct.UserDraftSendCall.html), [*drafts update*](struct.UserDraftUpdateCall.html), [*get profile*](struct.UserGetProfileCall.html), [*history list*](struct.UserHistoryListCall.html), [*labels create*](struct.UserLabelCreateCall.html), [*labels delete*](struct.UserLabelDeleteCall.html), [*labels get*](struct.UserLabelGetCall.html), [*labels list*](struct.UserLabelListCall.html), [*labels patch*](struct.UserLabelPatchCall.html), [*labels update*](struct.UserLabelUpdateCall.html), [*messages attachments get*](struct.UserMessageAttachmentGetCall.html), [*messages batch delete*](struct.UserMessageBatchDeleteCall.html), [*messages batch modify*](struct.UserMessageBatchModifyCall.html), [*messages delete*](struct.UserMessageDeleteCall.html), [*messages get*](struct.UserMessageGetCall.html), [*messages import*](struct.UserMessageImportCall.html), [*messages insert*](struct.UserMessageInsertCall.html), [*messages list*](struct.UserMessageListCall.html), [*messages modify*](struct.UserMessageModifyCall.html), [*messages send*](struct.UserMessageSendCall.html), [*messages trash*](struct.UserMessageTrashCall.html), [*messages untrash*](struct.UserMessageUntrashCall.html), [*settings filters create*](struct.UserSettingFilterCreateCall.html), [*settings filters delete*](struct.UserSettingFilterDeleteCall.html), [*settings filters get*](struct.UserSettingFilterGetCall.html), [*settings filters list*](struct.UserSettingFilterListCall.html), [*settings forwarding addresses create*](struct.UserSettingForwardingAddresseCreateCall.html), [*settings forwarding addresses delete*](struct.UserSettingForwardingAddresseDeleteCall.html), [*settings forwarding addresses get*](struct.UserSettingForwardingAddresseGetCall.html), [*settings forwarding addresses list*](struct.UserSettingForwardingAddresseListCall.html), [*settings get auto forwarding*](struct.UserSettingGetAutoForwardingCall.html), [*settings get imap*](struct.UserSettingGetImapCall.html), [*settings get pop*](struct.UserSettingGetPopCall.html), [*settings get vacation*](struct.UserSettingGetVacationCall.html), [*settings send as create*](struct.UserSettingSendACreateCall.html), [*settings send as delete*](struct.UserSettingSendADeleteCall.html), [*settings send as get*](struct.UserSettingSendAGetCall.html), [*settings send as list*](struct.UserSettingSendAListCall.html), [*settings send as patch*](struct.UserSettingSendAPatchCall.html), [*settings send as smime info delete*](struct.UserSettingSendASmimeInfoDeleteCall.html), [*settings send as smime info get*](struct.UserSettingSendASmimeInfoGetCall.html), [*settings send as smime info insert*](struct.UserSettingSendASmimeInfoInsertCall.html), [*settings send as smime info list*](struct.UserSettingSendASmimeInfoListCall.html), [*settings send as smime info set default*](struct.UserSettingSendASmimeInfoSetDefaultCall.html), [*settings send as update*](struct.UserSettingSendAUpdateCall.html), [*settings send as verify*](struct.UserSettingSendAVerifyCall.html), [*settings update auto forwarding*](struct.UserSettingUpdateAutoForwardingCall.html), [*settings update imap*](struct.UserSettingUpdateImapCall.html), [*settings update pop*](struct.UserSettingUpdatePopCall.html), [*settings update vacation*](struct.UserSettingUpdateVacationCall.html), [*stop*](struct.UserStopCall.html), [*threads delete*](struct.UserThreadDeleteCall.html), [*threads get*](struct.UserThreadGetCall.html), [*threads list*](struct.UserThreadListCall.html), [*threads modify*](struct.UserThreadModifyCall.html), [*threads trash*](struct.UserThreadTrashCall.html), [*threads untrash*](struct.UserThreadUntrashCall.html) and [*watch*](struct.UserWatchCall.html) //! //! //! Upload supported by ... @@ -197,7 +197,7 @@ // 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 +// 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)] @@ -245,7 +245,7 @@ pub enum Scope { /// Manage your basic mail settings SettingBasic, - /// View and manage your mail + /// Read, send, delete, and manage your email Gmai, /// Send email on your behalf @@ -369,8 +369,6 @@ pub struct Gmail { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Gmail {} @@ -383,8 +381,6 @@ impl<'a, C, A> Gmail client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/gmail/v1/users/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -401,32 +397,31 @@ impl<'a, C, A> Gmail self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/gmail/v1/users/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // 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*). +/// +/// * [settings send as smime info list users](struct.UserSettingSendASmimeInfoListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListSmimeInfoResponse { + /// List of SmimeInfo. + #[serde(rename="smimeInfo")] + pub smime_info: Option>, +} + +impl ResponseResult for ListSmimeInfoResponse {} + + /// Push notification watch response. /// /// # Activities @@ -520,20 +515,29 @@ impl RequestValue for Draft {} impl ResponseResult for Draft {} -/// There is no detailed description. +/// A single MIME message part. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct HistoryLabelRemoved { - /// Label IDs removed from the message. - #[serde(rename="labelIds")] - pub label_ids: Option>, - /// no description provided - pub message: Option, +pub struct MessagePart { + /// The message part body for this part, which may be empty for container MIME message parts. + pub body: Option, + /// The MIME type of the message part. + #[serde(rename="mimeType")] + pub mime_type: Option, + /// The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. + pub parts: Option>, + /// The immutable ID of the message part. + #[serde(rename="partId")] + pub part_id: Option, + /// List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. + pub headers: Option>, + /// The filename of the attachment. Only present if this message part represents an attachment. + pub filename: Option, } -impl Part for HistoryLabelRemoved {} +impl Part for MessagePart {} /// The body of a single MIME message part. @@ -1083,7 +1087,7 @@ pub struct VacationSettings { /// Response body in HTML format. Gmail will sanitize the HTML before storing it. #[serde(rename="responseBodyHtml")] pub response_body_html: Option, - /// Flag that determines whether responses are sent to recipients who are outside of the user's domain. This feature is only available for Google Apps users. + /// Flag that determines whether responses are sent to recipients who are outside of the user's domain. This feature is only available for G Suite users. #[serde(rename="restrictToDomain")] pub restrict_to_domain: Option, } @@ -1185,6 +1189,41 @@ pub struct WatchRequest { impl RequestValue for WatchRequest {} +/// An S/MIME email config. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [settings send as smime info insert users](struct.UserSettingSendASmimeInfoInsertCall.html) (request|response) +/// * [settings send as smime info get users](struct.UserSettingSendASmimeInfoGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SmimeInfo { + /// PEM formatted X509 concatenated certificate string (standard base64 encoding). Format used for returning key, which includes public key as well as certificate chain (not private key). + pub pem: Option, + /// When the certificate expires (in milliseconds since epoch). + pub expiration: Option, + /// Encrypted key password, when key is encrypted. + #[serde(rename="encryptedKeyPassword")] + pub encrypted_key_password: Option, + /// The S/MIME certificate issuer's common name. + #[serde(rename="issuerCn")] + pub issuer_cn: Option, + /// The immutable ID for the SmimeInfo. + pub id: Option, + /// PKCS#12 format containing a single private/public key pair and certificate chain. This format is only accepted from client for creating a new SmimeInfo and is never returned, because the private key is not intended to be exported. PKCS#12 may be encrypted, in which case encryptedKeyPassword should be set appropriately. + pub pkcs12: Option, + /// Whether this SmimeInfo is the default one for this user's send-as address. + #[serde(rename="isDefault")] + pub is_default: Option, +} + +impl RequestValue for SmimeInfo {} +impl ResponseResult for SmimeInfo {} + + /// An email message. /// /// # Activities @@ -1316,29 +1355,20 @@ impl RequestValue for ImapSettings {} impl ResponseResult for ImapSettings {} -/// A single MIME message part. +/// 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 MessagePart { - /// The message part body for this part, which may be empty for container MIME message parts. - pub body: Option, - /// The MIME type of the message part. - #[serde(rename="mimeType")] - pub mime_type: Option, - /// The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521. - pub parts: Option>, - /// The immutable ID of the message part. - #[serde(rename="partId")] - pub part_id: Option, - /// List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject. - pub headers: Option>, - /// The filename of the attachment. Only present if this message part represents an attachment. - pub filename: Option, +pub struct HistoryLabelRemoved { + /// Label IDs removed from the message. + #[serde(rename="labelIds")] + pub label_ids: Option>, + /// no description provided + pub message: Option, } -impl Part for MessagePart {} +impl Part for HistoryLabelRemoved {} @@ -1369,7 +1399,7 @@ impl Part for MessagePart {} /// ::default(), None); /// let mut hub = Gmail::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `drafts_create(...)`, `drafts_delete(...)`, `drafts_get(...)`, `drafts_list(...)`, `drafts_send(...)`, `drafts_update(...)`, `get_profile(...)`, `history_list(...)`, `labels_create(...)`, `labels_delete(...)`, `labels_get(...)`, `labels_list(...)`, `labels_patch(...)`, `labels_update(...)`, `messages_attachments_get(...)`, `messages_batch_delete(...)`, `messages_batch_modify(...)`, `messages_delete(...)`, `messages_get(...)`, `messages_import(...)`, `messages_insert(...)`, `messages_list(...)`, `messages_modify(...)`, `messages_send(...)`, `messages_trash(...)`, `messages_untrash(...)`, `settings_filters_create(...)`, `settings_filters_delete(...)`, `settings_filters_get(...)`, `settings_filters_list(...)`, `settings_forwarding_addresses_create(...)`, `settings_forwarding_addresses_delete(...)`, `settings_forwarding_addresses_get(...)`, `settings_forwarding_addresses_list(...)`, `settings_get_auto_forwarding(...)`, `settings_get_imap(...)`, `settings_get_pop(...)`, `settings_get_vacation(...)`, `settings_send_as_create(...)`, `settings_send_as_delete(...)`, `settings_send_as_get(...)`, `settings_send_as_list(...)`, `settings_send_as_patch(...)`, `settings_send_as_update(...)`, `settings_send_as_verify(...)`, `settings_update_auto_forwarding(...)`, `settings_update_imap(...)`, `settings_update_pop(...)`, `settings_update_vacation(...)`, `stop(...)`, `threads_delete(...)`, `threads_get(...)`, `threads_list(...)`, `threads_modify(...)`, `threads_trash(...)`, `threads_untrash(...)` and `watch(...)` +/// // like `drafts_create(...)`, `drafts_delete(...)`, `drafts_get(...)`, `drafts_list(...)`, `drafts_send(...)`, `drafts_update(...)`, `get_profile(...)`, `history_list(...)`, `labels_create(...)`, `labels_delete(...)`, `labels_get(...)`, `labels_list(...)`, `labels_patch(...)`, `labels_update(...)`, `messages_attachments_get(...)`, `messages_batch_delete(...)`, `messages_batch_modify(...)`, `messages_delete(...)`, `messages_get(...)`, `messages_import(...)`, `messages_insert(...)`, `messages_list(...)`, `messages_modify(...)`, `messages_send(...)`, `messages_trash(...)`, `messages_untrash(...)`, `settings_filters_create(...)`, `settings_filters_delete(...)`, `settings_filters_get(...)`, `settings_filters_list(...)`, `settings_forwarding_addresses_create(...)`, `settings_forwarding_addresses_delete(...)`, `settings_forwarding_addresses_get(...)`, `settings_forwarding_addresses_list(...)`, `settings_get_auto_forwarding(...)`, `settings_get_imap(...)`, `settings_get_pop(...)`, `settings_get_vacation(...)`, `settings_send_as_create(...)`, `settings_send_as_delete(...)`, `settings_send_as_get(...)`, `settings_send_as_list(...)`, `settings_send_as_patch(...)`, `settings_send_as_smime_info_delete(...)`, `settings_send_as_smime_info_get(...)`, `settings_send_as_smime_info_insert(...)`, `settings_send_as_smime_info_list(...)`, `settings_send_as_smime_info_set_default(...)`, `settings_send_as_update(...)`, `settings_send_as_verify(...)`, `settings_update_auto_forwarding(...)`, `settings_update_imap(...)`, `settings_update_pop(...)`, `settings_update_vacation(...)`, `stop(...)`, `threads_delete(...)`, `threads_get(...)`, `threads_list(...)`, `threads_modify(...)`, `threads_trash(...)`, `threads_untrash(...)` and `watch(...)` /// // to build up your call. /// let rb = hub.users(); /// # } @@ -1405,17 +1435,19 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new label. + /// Gets the specified S/MIME config for the specified send-as alias. /// /// # Arguments /// - /// * `request` - No description provided. /// * `userId` - The user's email address. The special value me can be used to indicate the authenticated user. - pub fn labels_create(&self, request: Label, user_id: &str) -> UserLabelCreateCall<'a, C, A> { - UserLabelCreateCall { + /// * `sendAsEmail` - The email address that appears in the "From:" header for mail sent using this alias. + /// * `id` - The immutable ID for the SmimeInfo. + pub fn settings_send_as_smime_info_get(&self, user_id: &str, send_as_email: &str, id: &str) -> UserSettingSendASmimeInfoGetCall<'a, C, A> { + UserSettingSendASmimeInfoGetCall { hub: self.hub, - _request: request, _user_id: user_id.to_string(), + _send_as_email: send_as_email.to_string(), + _id: id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1530,6 +1562,7 @@ impl<'a, C, A> UserMethods<'a, C, A> { _page_token: Default::default(), _max_results: Default::default(), _label_id: Default::default(), + _history_types: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1801,17 +1834,15 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the specified label. + /// Deletes a filter. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `userId` - The user's email address. The special value me can be used to indicate the authenticated user. - /// * `id` - The ID of the label to update. - pub fn labels_update(&self, request: Label, user_id: &str, id: &str) -> UserLabelUpdateCall<'a, C, A> { - UserLabelUpdateCall { + /// * `userId` - User's email address. The special value "me" can be used to indicate the authenticated user. + /// * `id` - The ID of the filter to be deleted. + pub fn settings_filters_delete(&self, user_id: &str, id: &str) -> UserSettingFilterDeleteCall<'a, C, A> { + UserSettingFilterDeleteCall { hub: self.hub, - _request: request, _user_id: user_id.to_string(), _id: id.to_string(), _delegate: Default::default(), @@ -1901,6 +1932,27 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates the specified label. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `userId` - The user's email address. The special value me can be used to indicate the authenticated user. + /// * `id` - The ID of the label to update. + pub fn labels_update(&self, request: Label, user_id: &str, id: &str) -> UserLabelUpdateCall<'a, C, A> { + UserLabelUpdateCall { + hub: self.hub, + _request: request, + _user_id: user_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: /// /// Immediately and permanently deletes the specified draft. Does not simply trash it. @@ -1924,6 +1976,8 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. /// + /// This method is only available to service account clients that have been delegated domain-wide authority. + /// /// # Arguments /// /// * `request` - No description provided. @@ -1943,6 +1997,8 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// Updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled. /// + /// This method is only available to service account clients that have been delegated domain-wide authority. + /// /// # Arguments /// /// * `request` - No description provided. @@ -1958,6 +2014,25 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Creates a new label. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `userId` - The user's email address. The special value me can be used to indicate the authenticated user. + pub fn labels_create(&self, request: Label, user_id: &str) -> UserLabelCreateCall<'a, C, A> { + UserLabelCreateCall { + hub: self.hub, + _request: request, + _user_id: user_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Removes the specified thread from the trash. @@ -1979,7 +2054,28 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. This method supports patch semantics. + /// Lists S/MIME configs for the specified send-as alias. + /// + /// # Arguments + /// + /// * `userId` - The user's email address. The special value me can be used to indicate the authenticated user. + /// * `sendAsEmail` - The email address that appears in the "From:" header for mail sent using this alias. + pub fn settings_send_as_smime_info_list(&self, user_id: &str, send_as_email: &str) -> UserSettingSendASmimeInfoListCall<'a, C, A> { + UserSettingSendASmimeInfoListCall { + hub: self.hub, + _user_id: user_id.to_string(), + _send_as_email: send_as_email.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. + /// + /// Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. This method supports patch semantics. /// /// # Arguments /// @@ -2040,15 +2136,19 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the forwarding addresses for the specified account. + /// Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key. /// /// # Arguments /// - /// * `userId` - User's email address. The special value "me" can be used to indicate the authenticated user. - pub fn settings_forwarding_addresses_list(&self, user_id: &str) -> UserSettingForwardingAddresseListCall<'a, C, A> { - UserSettingForwardingAddresseListCall { + /// * `request` - No description provided. + /// * `userId` - The user's email address. The special value me can be used to indicate the authenticated user. + /// * `sendAsEmail` - The email address that appears in the "From:" header for mail sent using this alias. + pub fn settings_send_as_smime_info_insert(&self, request: SmimeInfo, user_id: &str, send_as_email: &str) -> UserSettingSendASmimeInfoInsertCall<'a, C, A> { + UserSettingSendASmimeInfoInsertCall { hub: self.hub, + _request: request, _user_id: user_id.to_string(), + _send_as_email: send_as_email.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2139,17 +2239,19 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a filter. + /// Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. + /// + /// This method is only available to service account clients that have been delegated domain-wide authority. /// /// # Arguments /// + /// * `request` - No description provided. /// * `userId` - User's email address. The special value "me" can be used to indicate the authenticated user. - /// * `id` - The ID of the filter to be deleted. - pub fn settings_filters_delete(&self, user_id: &str, id: &str) -> UserSettingFilterDeleteCall<'a, C, A> { - UserSettingFilterDeleteCall { + pub fn settings_forwarding_addresses_create(&self, request: ForwardingAddress, user_id: &str) -> UserSettingForwardingAddresseCreateCall<'a, C, A> { + UserSettingForwardingAddresseCreateCall { hub: self.hub, + _request: request, _user_id: user_id.to_string(), - _id: id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2253,17 +2355,19 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. + /// Sets the default S/MIME config for the specified send-as alias. /// /// # Arguments /// - /// * `request` - No description provided. - /// * `userId` - User's email address. The special value "me" can be used to indicate the authenticated user. - pub fn settings_forwarding_addresses_create(&self, request: ForwardingAddress, user_id: &str) -> UserSettingForwardingAddresseCreateCall<'a, C, A> { - UserSettingForwardingAddresseCreateCall { + /// * `userId` - The user's email address. The special value me can be used to indicate the authenticated user. + /// * `sendAsEmail` - The email address that appears in the "From:" header for mail sent using this alias. + /// * `id` - The immutable ID for the SmimeInfo. + pub fn settings_send_as_smime_info_set_default(&self, user_id: &str, send_as_email: &str, id: &str) -> UserSettingSendASmimeInfoSetDefaultCall<'a, C, A> { + UserSettingSendASmimeInfoSetDefaultCall { hub: self.hub, - _request: request, _user_id: user_id.to_string(), + _send_as_email: send_as_email.to_string(), + _id: id.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2296,6 +2400,8 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. /// + /// Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. + /// /// # Arguments /// /// * `request` - No description provided. @@ -2332,6 +2438,27 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Deletes the specified S/MIME config for the specified send-as alias. + /// + /// # Arguments + /// + /// * `userId` - The user's email address. The special value me can be used to indicate the authenticated user. + /// * `sendAsEmail` - The email address that appears in the "From:" header for mail sent using this alias. + /// * `id` - The immutable ID for the SmimeInfo. + pub fn settings_send_as_smime_info_delete(&self, user_id: &str, send_as_email: &str, id: &str) -> UserSettingSendASmimeInfoDeleteCall<'a, C, A> { + UserSettingSendASmimeInfoDeleteCall { + hub: self.hub, + _user_id: user_id.to_string(), + _send_as_email: send_as_email.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: /// /// Moves the specified message to the trash. @@ -2393,6 +2520,8 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// Sends a verification email to the specified send-as alias address. The verification status must be pending. /// + /// This method is only available to service account clients that have been delegated domain-wide authority. + /// /// # Arguments /// /// * `userId` - User's email address. The special value "me" can be used to indicate the authenticated user. @@ -2408,6 +2537,23 @@ impl<'a, C, A> UserMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Lists the forwarding addresses for the specified account. + /// + /// # Arguments + /// + /// * `userId` - User's email address. The special value "me" can be used to indicate the authenticated user. + pub fn settings_forwarding_addresses_list(&self, user_id: &str) -> UserSettingForwardingAddresseListCall<'a, C, A> { + UserSettingForwardingAddresseListCall { + hub: self.hub, + _user_id: user_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message. @@ -2450,6 +2596,8 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// Deletes the specified send-as alias. Revokes any verification that may have been required for using it. /// + /// This method is only available to service account clients that have been delegated domain-wide authority. + /// /// # Arguments /// /// * `userId` - User's email address. The special value "me" can be used to indicate the authenticated user. @@ -2469,6 +2617,8 @@ impl<'a, C, A> UserMethods<'a, C, A> { /// /// Deletes the specified forwarding address and revokes any verification that may have been required. /// + /// This method is only available to service account clients that have been delegated domain-wide authority. + /// /// # Arguments /// /// * `userId` - User's email address. The special value "me" can be used to indicate the authenticated user. @@ -2570,7 +2720,7 @@ impl<'a, C, A> UserSettingUpdateVacationCall<'a, C, A> where C: BorrowMut UserSettingUpdateVacationCall<'a, C, A> where C: BorrowMut UserSettingUpdateVacationCall<'a, C, A> where C: BorrowMut UserSettingUpdateVacationCall<'a, C, A> where C: BorrowMut::default(), None); /// # let mut hub = Gmail::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = Label::default(); -/// /// // You can configure optional parameters by calling 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().labels_create(req, "userId") +/// let result = hub.users().settings_send_as_smime_info_get("userId", "sendAsEmail", "id") /// .doit(); /// # } /// ``` -pub struct UserLabelCreateCall<'a, C, A> +pub struct UserSettingSendASmimeInfoGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Gmail, - _request: Label, _user_id: String, + _send_as_email: String, + _id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for UserLabelCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for UserSettingSendASmimeInfoGetCall<'a, C, A> {} -impl<'a, C, A> UserLabelCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> UserSettingSendASmimeInfoGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Label)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, SmimeInfo)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -2820,11 +2965,13 @@ impl<'a, C, A> UserLabelCreateCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "gmail.users.labels.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: "gmail.users.settings.sendAs.smimeInfo.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "userId"].iter() { + params.push(("sendAsEmail", self._send_as_email.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "userId", "sendAsEmail", "id"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2836,12 +2983,12 @@ impl<'a, C, A> UserLabelCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/labels"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}".to_string(); if self._scopes.len() == 0 { - self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{userId}", "userId")].iter() { + for &(find_this, param_name) in [("{userId}", "userId"), ("{sendAsEmail}", "sendAsEmail"), ("{id}", "id")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -2852,8 +2999,8 @@ impl<'a, C, A> UserLabelCreateCall<'a, C, A> where C: BorrowMut, url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["userId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["id", "sendAsEmail", "userId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -2868,17 +3015,6 @@ impl<'a, C, A> UserLabelCreateCall<'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 { @@ -2895,15 +3031,11 @@ impl<'a, C, A> UserLabelCreateCall<'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() @@ -2954,32 +3086,43 @@ impl<'a, C, A> UserLabelCreateCall<'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: Label) -> UserLabelCreateCall<'a, C, A> { - self._request = new_value; - self - } /// The user's email address. The special value me can be used to indicate the authenticated user. /// /// Sets the *user id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> UserLabelCreateCall<'a, C, A> { + pub fn user_id(mut self, new_value: &str) -> UserSettingSendASmimeInfoGetCall<'a, C, A> { self._user_id = new_value.to_string(); self } + /// The email address that appears in the "From:" header for mail sent using this alias. + /// + /// Sets the *send as email* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn send_as_email(mut self, new_value: &str) -> UserSettingSendASmimeInfoGetCall<'a, C, A> { + self._send_as_email = new_value.to_string(); + self + } + /// The immutable ID for the SmimeInfo. + /// + /// 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) -> UserSettingSendASmimeInfoGetCall<'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) -> UserLabelCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserSettingSendASmimeInfoGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3000,7 +3143,7 @@ impl<'a, C, A> UserLabelCreateCall<'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) -> UserLabelCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> UserSettingSendASmimeInfoGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -3009,7 +3152,7 @@ impl<'a, C, A> UserLabelCreateCall<'a, C, A> where C: BorrowMut, /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Gmai`. + /// `Scope::Readonly`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -3017,7 +3160,7 @@ impl<'a, C, A> UserLabelCreateCall<'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) -> UserLabelCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> UserSettingSendASmimeInfoGetCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -3095,7 +3238,7 @@ impl<'a, C, A> UserSettingSendAListCall<'a, C, A> where C: BorrowMut UserSettingGetImapCall<'a, C, A> where C: BorrowMut UserSettingGetImapCall<'a, C, A> where C: BorrowMut UserMessageImportCall<'a, C, A> where C: BorrowMut let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/messages/import", "multipart") + ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/messages/import".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/messages/import", "resumable") + ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/messages/import".to_string(), "resumable") } else { unreachable!() }; @@ -3682,8 +3825,8 @@ impl<'a, C, A> UserMessageImportCall<'a, C, A> where C: BorrowMut mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 36700160 { - return Err(Error::UploadSizeLimitExceeded(size, 36700160)) + if size > 52428800 { + return Err(Error::UploadSizeLimitExceeded(size, 52428800)) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -3736,8 +3879,8 @@ impl<'a, C, A> UserMessageImportCall<'a, C, A> where C: BorrowMut if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 36700160 { - return Err(Error::UploadSizeLimitExceeded(size, 36700160)) + if size > 52428800 { + return Err(Error::UploadSizeLimitExceeded(size, 52428800)) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -3800,7 +3943,7 @@ impl<'a, C, A> UserMessageImportCall<'a, C, A> where C: BorrowMut /// Upload media all at once. /// If the upload fails for whichever reason, all progress is lost. /// - /// * *max size*: 35MB + /// * *max size*: 50MB /// * *multipart*: yes /// * *valid mime types*: 'message/rfc822' pub fn upload(self, stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, Message)> @@ -3816,7 +3959,7 @@ impl<'a, C, A> UserMessageImportCall<'a, C, A> where C: BorrowMut /// may specify the `chunk_size()` and may cancel the operation before each chunk is uploaded, using /// `cancel_chunk_upload(...)`. /// - /// * *max size*: 35MB + /// * *max size*: 50MB /// * *multipart*: yes /// * *valid mime types*: 'message/rfc822' pub fn upload_resumable(self, resumeable_stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, Message)> @@ -3864,7 +4007,7 @@ impl<'a, C, A> UserMessageImportCall<'a, C, A> where C: BorrowMut self._internal_date_source = Some(new_value.to_string()); self } - /// Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts. + /// Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. /// /// Sets the *deleted* query property to the given value. pub fn deleted(mut self, new_value: bool) -> UserMessageImportCall<'a, C, A> { @@ -3993,7 +4136,7 @@ impl<'a, C, A> UserSettingFilterListCall<'a, C, A> where C: BorrowMut UserSettingForwardingAddresseGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/settings/forwardingAddresses/{forwardingEmail}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4432,10 +4575,11 @@ impl<'a, C, A> UserSettingForwardingAddresseGetCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().history_list("userId") -/// .start_history_id("et") -/// .page_token("duo") -/// .max_results(69) -/// .label_id("sea") +/// .start_history_id("aliquyam") +/// .page_token("sea") +/// .max_results(46) +/// .label_id("eos") +/// .add_history_types("erat") /// .doit(); /// # } /// ``` @@ -4448,6 +4592,7 @@ pub struct UserHistoryListCall<'a, C, A> _page_token: Option, _max_results: Option, _label_id: Option, + _history_types: Vec, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4469,7 +4614,7 @@ impl<'a, C, A> UserHistoryListCall<'a, C, A> where C: BorrowMut, }; dlg.begin(MethodInfo { id: "gmail.users.history.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); params.push(("userId", self._user_id.to_string())); if let Some(value) = self._start_history_id { params.push(("startHistoryId", value.to_string())); @@ -4483,7 +4628,12 @@ impl<'a, C, A> UserHistoryListCall<'a, C, A> where C: BorrowMut, if let Some(value) = self._label_id { params.push(("labelId", value.to_string())); } - for &field in ["alt", "userId", "startHistoryId", "pageToken", "maxResults", "labelId"].iter() { + if self._history_types.len() > 0 { + for f in self._history_types.iter() { + params.push(("historyTypes", f.to_string())); + } + } + for &field in ["alt", "userId", "startHistoryId", "pageToken", "maxResults", "labelId", "historyTypes"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4495,7 +4645,7 @@ impl<'a, C, A> UserHistoryListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/history"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/history".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4636,6 +4786,14 @@ impl<'a, C, A> UserHistoryListCall<'a, C, A> where C: BorrowMut, self._label_id = Some(new_value.to_string()); self } + /// History types to be returned by the function + /// + /// Append the given value to the *history types* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_history_types(mut self, new_value: &str) -> UserHistoryListCall<'a, C, A> { + self._history_types.push(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4769,9 +4927,9 @@ impl<'a, C, A> UserDraftCreateCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/drafts", "multipart") + ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/drafts".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/drafts", "resumable") + ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/drafts".to_string(), "resumable") } else { unreachable!() }; @@ -5140,7 +5298,7 @@ impl<'a, C, A> UserSettingSendAGetCall<'a, C, A> where C: BorrowMut UserLabelDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "{userId}/labels/{id}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -5623,7 +5781,7 @@ impl<'a, C, A> UserLabelGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/labels/{id}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -5868,7 +6026,7 @@ impl<'a, C, A> UserLabelListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/labels"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6114,9 +6272,9 @@ impl<'a, C, A> UserDraftSendCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/drafts/send", "multipart") + ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/drafts/send".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/drafts/send", "resumable") + ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/drafts/send".to_string(), "resumable") } else { unreachable!() }; @@ -6485,7 +6643,7 @@ impl<'a, C, A> UserMessageUntrashCall<'a, C, A> where C: BorrowMut UserSettingGetPopCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/settings/pop"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/pop".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6972,7 +7130,7 @@ impl<'a, C, A> UserSettingUpdatePopCall<'a, C, A> where C: BorrowMut UserSettingGetVacationCall<'a, C, A> where C: BorrowMut UserMessageBatchDeleteCall<'a, C, A> where C: BorrowMut UserMessageDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "{userId}/messages/{id}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/messages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -7964,7 +8122,7 @@ impl<'a, C, A> UserDraftGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/drafts/{id}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/drafts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -8229,9 +8387,9 @@ impl<'a, C, A> UserDraftUpdateCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/drafts/{id}", "multipart") + ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/drafts/{id}".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/drafts/{id}", "resumable") + ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/drafts/{id}".to_string(), "resumable") } else { unreachable!() }; @@ -8538,9 +8696,9 @@ impl<'a, C, A> UserDraftUpdateCall<'a, C, A> where C: BorrowMut, } -/// Updates the specified label. +/// Deletes a filter. /// -/// A builder for the *labels.update* method supported by a *user* resource. +/// A builder for the *settings.filters.delete* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. /// /// # Example @@ -8551,7 +8709,6 @@ impl<'a, C, A> UserDraftUpdateCall<'a, C, A> where C: BorrowMut, /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_gmail1 as gmail1; -/// use gmail1::Label; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -8562,23 +8719,17 @@ impl<'a, C, A> UserDraftUpdateCall<'a, C, A> where C: BorrowMut, /// # hyper::Client::new(), /// # ::default(), None); /// # let mut hub = Gmail::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = Label::default(); -/// /// // You can configure optional parameters by calling 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().labels_update(req, "userId", "id") +/// let result = hub.users().settings_filters_delete("userId", "id") /// .doit(); /// # } /// ``` -pub struct UserLabelUpdateCall<'a, C, A> +pub struct UserSettingFilterDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Gmail, - _request: Label, _user_id: String, _id: String, _delegate: Option<&'a mut Delegate>, @@ -8586,13 +8737,13 @@ pub struct UserLabelUpdateCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for UserLabelUpdateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for UserSettingFilterDeleteCall<'a, C, A> {} -impl<'a, C, A> UserLabelUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Label)> { + pub fn doit(mut self) -> Result { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -8600,12 +8751,12 @@ impl<'a, C, A> UserLabelUpdateCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "gmail.users.labels.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "gmail.users.settings.filters.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("userId", self._user_id.to_string())); params.push(("id", self._id.to_string())); - for &field in ["alt", "userId", "id"].iter() { + for &field in ["userId", "id"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8615,11 +8766,10 @@ impl<'a, C, A> UserLabelUpdateCall<'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() + "{userId}/labels/{id}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/filters/{id}".to_string(); if self._scopes.len() == 0 { - self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); + self._scopes.insert(Scope::SettingBasic.as_ref().to_string(), ()); } for &(find_this, param_name) in [("{userId}", "userId"), ("{id}", "id")].iter() { @@ -8649,17 +8799,6 @@ impl<'a, C, A> UserLabelUpdateCall<'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 { @@ -8676,15 +8815,11 @@ impl<'a, C, A> UserLabelUpdateCall<'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::Put, &url) + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) .header(UserAgent(self.hub._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() @@ -8715,17 +8850,7 @@ impl<'a, C, A> UserLabelUpdateCall<'a, C, A> where C: BorrowMut, Ok(serr) => Err(Error::BadRequest(serr)) } } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; + let result_value = res; dlg.finished(true); return Ok(result_value) @@ -8735,32 +8860,23 @@ impl<'a, C, A> UserLabelUpdateCall<'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: Label) -> UserLabelUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// The user's email address. The special value me can be used to indicate the authenticated user. + /// User's email address. The special value "me" can be used to indicate the authenticated user. /// /// Sets the *user id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> UserLabelUpdateCall<'a, C, A> { + pub fn user_id(mut self, new_value: &str) -> UserSettingFilterDeleteCall<'a, C, A> { self._user_id = new_value.to_string(); self } - /// The ID of the label to update. + /// The ID of the filter to be deleted. /// /// 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) -> UserLabelUpdateCall<'a, C, A> { + pub fn id(mut self, new_value: &str) -> UserSettingFilterDeleteCall<'a, C, A> { self._id = new_value.to_string(); self } @@ -8770,7 +8886,7 @@ impl<'a, C, A> UserLabelUpdateCall<'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) -> UserLabelUpdateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserSettingFilterDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -8791,7 +8907,7 @@ impl<'a, C, A> UserLabelUpdateCall<'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) -> UserLabelUpdateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> UserSettingFilterDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -8800,7 +8916,7 @@ impl<'a, C, A> UserLabelUpdateCall<'a, C, A> where C: BorrowMut, /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Gmai`. + /// `Scope::SettingBasic`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -8808,7 +8924,7 @@ impl<'a, C, A> UserLabelUpdateCall<'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) -> UserLabelUpdateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> UserSettingFilterDeleteCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -8843,10 +8959,10 @@ impl<'a, C, A> UserLabelUpdateCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().threads_list("userId") -/// .q("consetetur") -/// .page_token("ut") -/// .max_results(85) -/// .add_label_ids("sed") +/// .q("sed") +/// .page_token("dolor") +/// .max_results(53) +/// .add_label_ids("dolor") /// .include_spam_trash(true) /// .doit(); /// # } @@ -8913,7 +9029,7 @@ impl<'a, C, A> UserThreadListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/threads"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -9186,7 +9302,7 @@ impl<'a, C, A> UserSettingFilterGetCall<'a, C, A> where C: BorrowMut UserMessageBatchModifyCall<'a, C, A> where C: BorrowMut UserLabelPatchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/labels/{id}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -9894,6 +10010,284 @@ impl<'a, C, A> UserLabelPatchCall<'a, C, A> where C: BorrowMut, A } +/// Updates the specified label. +/// +/// A builder for the *labels.update* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_gmail1 as gmail1; +/// use gmail1::Label; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use gmail1::Gmail; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Gmail::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Label::default(); +/// +/// // You can configure optional parameters by calling 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().labels_update(req, "userId", "id") +/// .doit(); +/// # } +/// ``` +pub struct UserLabelUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Gmail, + _request: Label, + _user_id: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserLabelUpdateCall<'a, C, A> {} + +impl<'a, C, A> UserLabelUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Label)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "gmail.users.labels.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["alt", "userId", "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 = "https://www.googleapis.com/gmail/v1/users/{userId}/labels/{id}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userId}", "userId"), ("{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", "userId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: Label) -> UserLabelUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// The user's email address. The special value me can be used to indicate the authenticated user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserLabelUpdateCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The ID of the label to update. + /// + /// 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) -> UserLabelUpdateCall<'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) -> UserLabelUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserLabelUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Gmai`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserLabelUpdateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Immediately and permanently deletes the specified draft. Does not simply trash it. /// /// A builder for the *drafts.delete* method supported by a *user* resource. @@ -9965,7 +10359,7 @@ impl<'a, C, A> UserDraftDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "{userId}/drafts/{id}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/drafts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -10131,6 +10525,8 @@ impl<'a, C, A> UserDraftDeleteCall<'a, C, A> where C: BorrowMut, /// Creates a custom "from" send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. +/// +/// This method is only available to service account clients that have been delegated domain-wide authority. /// /// A builder for the *settings.sendAs.create* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. @@ -10207,7 +10603,7 @@ impl<'a, C, A> UserSettingSendACreateCall<'a, C, A> where C: BorrowMut UserSettingSendACreateCall<'a, C, A> where C: BorrowMut UserSettingUpdateAutoForwardingCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/settings/autoForwarding"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/autoForwarding".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::SettingSharing.as_ref().to_string(), ()); } @@ -10662,6 +11060,272 @@ impl<'a, C, A> UserSettingUpdateAutoForwardingCall<'a, C, A> where C: BorrowMut< } +/// Creates a new label. +/// +/// A builder for the *labels.create* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_gmail1 as gmail1; +/// use gmail1::Label; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use gmail1::Gmail; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Gmail::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Label::default(); +/// +/// // You can configure optional parameters by calling 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().labels_create(req, "userId") +/// .doit(); +/// # } +/// ``` +pub struct UserLabelCreateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Gmail, + _request: Label, + _user_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserLabelCreateCall<'a, C, A> {} + +impl<'a, C, A> UserLabelCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Label)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "gmail.users.labels.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/labels".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["userId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Label) -> UserLabelCreateCall<'a, C, A> { + self._request = new_value; + self + } + /// The user's email address. The special value me can be used to indicate the authenticated user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserLabelCreateCall<'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) -> UserLabelCreateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserLabelCreateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Gmai`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserLabelCreateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Removes the specified thread from the trash. /// /// A builder for the *threads.untrash* method supported by a *user* resource. @@ -10734,7 +11398,7 @@ impl<'a, C, A> UserThreadUntrashCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/threads/{id}/untrash"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads/{id}/untrash".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -10909,7 +11573,256 @@ impl<'a, C, A> UserThreadUntrashCall<'a, C, A> where C: BorrowMut } -/// Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. This method supports patch semantics. +/// Lists S/MIME configs for the specified send-as alias. +/// +/// A builder for the *settings.sendAs.smimeInfo.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 yup_oauth2 as oauth2; +/// # extern crate google_gmail1 as gmail1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use gmail1::Gmail; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Gmail::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.users().settings_send_as_smime_info_list("userId", "sendAsEmail") +/// .doit(); +/// # } +/// ``` +pub struct UserSettingSendASmimeInfoListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Gmail, + _user_id: String, + _send_as_email: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserSettingSendASmimeInfoListCall<'a, C, A> {} + +impl<'a, C, A> UserSettingSendASmimeInfoListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListSmimeInfoResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "gmail.users.settings.sendAs.smimeInfo.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + params.push(("sendAsEmail", self._send_as_email.to_string())); + for &field in ["alt", "userId", "sendAsEmail"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userId}", "userId"), ("{sendAsEmail}", "sendAsEmail")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["sendAsEmail", "userId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The user's email address. The special value me can be used to indicate the authenticated user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserSettingSendASmimeInfoListCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The email address that appears in the "From:" header for mail sent using this alias. + /// + /// Sets the *send as email* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn send_as_email(mut self, new_value: &str) -> UserSettingSendASmimeInfoListCall<'a, C, A> { + self._send_as_email = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserSettingSendASmimeInfoListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserSettingSendASmimeInfoListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserSettingSendASmimeInfoListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. +/// +/// Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. This method supports patch semantics. /// /// A builder for the *settings.sendAs.patch* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. @@ -10988,7 +11901,7 @@ impl<'a, C, A> UserSettingSendAPatchCall<'a, C, A> where C: BorrowMut UserThreadModifyCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/threads/{id}/modify"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads/{id}/modify".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -11536,7 +12449,7 @@ impl<'a, C, A> UserThreadDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "{userId}/threads/{id}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -11701,9 +12614,9 @@ impl<'a, C, A> UserThreadDeleteCall<'a, C, A> where C: BorrowMut, } -/// Lists the forwarding addresses for the specified account. +/// Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key. /// -/// A builder for the *settings.forwardingAddresses.list* method supported by a *user* resource. +/// A builder for the *settings.sendAs.smimeInfo.insert* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. /// /// # Example @@ -11714,6 +12627,7 @@ impl<'a, C, A> UserThreadDeleteCall<'a, C, A> where C: BorrowMut, /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_gmail1 as gmail1; +/// use gmail1::SmimeInfo; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -11724,30 +12638,37 @@ impl<'a, C, A> UserThreadDeleteCall<'a, C, A> where C: BorrowMut, /// # hyper::Client::new(), /// # ::default(), None); /// # let mut hub = Gmail::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SmimeInfo::default(); +/// /// // You can configure optional parameters by calling 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().settings_forwarding_addresses_list("userId") +/// let result = hub.users().settings_send_as_smime_info_insert(req, "userId", "sendAsEmail") /// .doit(); /// # } /// ``` -pub struct UserSettingForwardingAddresseListCall<'a, C, A> +pub struct UserSettingSendASmimeInfoInsertCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Gmail, + _request: SmimeInfo, _user_id: String, + _send_as_email: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for UserSettingForwardingAddresseListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for UserSettingSendASmimeInfoInsertCall<'a, C, A> {} -impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> UserSettingSendASmimeInfoInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListForwardingAddressesResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, SmimeInfo)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -11755,11 +12676,12 @@ impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMu Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "gmail.users.settings.forwardingAddresses.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "gmail.users.settings.sendAs.smimeInfo.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "userId"].iter() { + params.push(("sendAsEmail", self._send_as_email.to_string())); + for &field in ["alt", "userId", "sendAsEmail"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11771,12 +12693,12 @@ impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/settings/forwardingAddresses"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo".to_string(); if self._scopes.len() == 0 { - self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + self._scopes.insert(Scope::SettingBasic.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{userId}", "userId")].iter() { + for &(find_this, param_name) in [("{userId}", "userId"), ("{sendAsEmail}", "sendAsEmail")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -11787,8 +12709,8 @@ impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMu url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["userId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(2); + for param_name in ["sendAsEmail", "userId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -11803,6 +12725,17 @@ impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMu url.push_str(&url::form_urlencoded::serialize(params)); } + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -11819,11 +12752,15 @@ impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMu } }; let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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() @@ -11874,23 +12811,42 @@ impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMu } - /// User's email address. The special value "me" can be used to indicate the authenticated user. + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: SmimeInfo) -> UserSettingSendASmimeInfoInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// The user's email address. The special value me can be used to indicate the authenticated user. /// /// Sets the *user id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> UserSettingForwardingAddresseListCall<'a, C, A> { + pub fn user_id(mut self, new_value: &str) -> UserSettingSendASmimeInfoInsertCall<'a, C, A> { self._user_id = new_value.to_string(); self } + /// The email address that appears in the "From:" header for mail sent using this alias. + /// + /// Sets the *send as email* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn send_as_email(mut self, new_value: &str) -> UserSettingSendASmimeInfoInsertCall<'a, C, A> { + self._send_as_email = new_value.to_string(); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// /// It should be used to handle progress information, and to implement a certain level of resilience. /// /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserSettingForwardingAddresseListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserSettingSendASmimeInfoInsertCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -11911,7 +12867,7 @@ impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMu /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserSettingForwardingAddresseListCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> UserSettingSendASmimeInfoInsertCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -11920,7 +12876,7 @@ impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMu /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Readonly`. + /// `Scope::SettingBasic`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -11928,7 +12884,7 @@ impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMu /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserSettingForwardingAddresseListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> UserSettingSendASmimeInfoInsertCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -12010,7 +12966,7 @@ impl<'a, C, A> UserMessageAttachmentGetCall<'a, C, A> where C: BorrowMut UserMessageModifyCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/messages/{id}/modify"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/messages/{id}/modify".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -12500,8 +13456,8 @@ impl<'a, C, A> UserMessageModifyCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().messages_get("userId", "id") -/// .add_metadata_headers("consetetur") -/// .format("takimata") +/// .add_metadata_headers("ea") +/// .format("sadipscing") /// .doit(); /// # } /// ``` @@ -12557,7 +13513,7 @@ impl<'a, C, A> UserMessageGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/messages/{id}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/messages/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12824,7 +13780,7 @@ impl<'a, C, A> UserWatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/watch"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/watch".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -13013,9 +13969,11 @@ impl<'a, C, A> UserWatchCall<'a, C, A> where C: BorrowMut, A: oau } -/// Deletes a filter. +/// Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. +/// +/// This method is only available to service account clients that have been delegated domain-wide authority. /// -/// A builder for the *settings.filters.delete* method supported by a *user* resource. +/// A builder for the *settings.forwardingAddresses.create* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. /// /// # Example @@ -13026,6 +13984,7 @@ impl<'a, C, A> UserWatchCall<'a, C, A> where C: BorrowMut, A: oau /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_gmail1 as gmail1; +/// use gmail1::ForwardingAddress; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -13036,31 +13995,36 @@ impl<'a, C, A> UserWatchCall<'a, C, A> where C: BorrowMut, A: oau /// # hyper::Client::new(), /// # ::default(), None); /// # let mut hub = Gmail::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ForwardingAddress::default(); +/// /// // You can configure optional parameters by calling 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().settings_filters_delete("userId", "id") +/// let result = hub.users().settings_forwarding_addresses_create(req, "userId") /// .doit(); /// # } /// ``` -pub struct UserSettingFilterDeleteCall<'a, C, A> +pub struct UserSettingForwardingAddresseCreateCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Gmail, + _request: ForwardingAddress, _user_id: String, - _id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for UserSettingFilterDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for UserSettingForwardingAddresseCreateCall<'a, C, A> {} -impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'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, ForwardingAddress)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -13068,12 +14032,11 @@ impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "gmail.users.settings.filters.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: "gmail.users.settings.forwardingAddresses.create", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("userId", self._user_id.to_string())); - params.push(("id", self._id.to_string())); - for &field in ["userId", "id"].iter() { + for &field in ["alt", "userId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -13083,13 +14046,14 @@ impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -13100,8 +14064,8 @@ impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["id", "userId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["userId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -13116,6 +14080,17 @@ impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut UserSettingFilterDeleteCall<'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) @@ -13177,33 +14166,32 @@ impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut UserSettingForwardingAddresseCreateCall<'a, C, A> { + self._request = new_value; + self + } /// User's email address. The special value "me" can be used to indicate the authenticated user. /// /// Sets the *user id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> UserSettingFilterDeleteCall<'a, C, A> { + pub fn user_id(mut self, new_value: &str) -> UserSettingForwardingAddresseCreateCall<'a, C, A> { self._user_id = new_value.to_string(); self } - /// The ID of the filter to be deleted. - /// - /// 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) -> UserSettingFilterDeleteCall<'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) -> UserSettingFilterDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserSettingForwardingAddresseCreateCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -13224,7 +14212,7 @@ impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> UserSettingFilterDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> UserSettingForwardingAddresseCreateCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -13233,7 +14221,7 @@ impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> UserSettingFilterDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> UserSettingForwardingAddresseCreateCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -13276,10 +14264,10 @@ impl<'a, C, A> UserSettingFilterDeleteCall<'a, C, A> where C: BorrowMut UserDraftListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/drafts"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/drafts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13609,7 +14597,7 @@ impl<'a, C, A> UserSettingUpdateImapCall<'a, C, A> where C: BorrowMut UserMessageSendCall<'a, C, A> where C: BorrowMut, let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/messages/send", "multipart") + ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/messages/send".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/messages/send", "resumable") + ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/messages/send".to_string(), "resumable") } else { unreachable!() }; @@ -14250,7 +15238,7 @@ impl<'a, C, A> UserThreadTrashCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/threads/{id}/trash"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads/{id}/trash".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -14494,7 +15482,7 @@ impl<'a, C, A> UserStopCall<'a, C, A> where C: BorrowMut, A: oaut } - let mut url = self.hub._base_url.clone() + "{userId}/stop"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/stop".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -14649,9 +15637,9 @@ impl<'a, C, A> UserStopCall<'a, C, A> where C: BorrowMut, A: oaut } -/// Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. +/// Sets the default S/MIME config for the specified send-as alias. /// -/// A builder for the *settings.forwardingAddresses.create* method supported by a *user* resource. +/// A builder for the *settings.sendAs.smimeInfo.setDefault* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. /// /// # Example @@ -14662,7 +15650,6 @@ impl<'a, C, A> UserStopCall<'a, C, A> where C: BorrowMut, A: oaut /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_gmail1 as gmail1; -/// use gmail1::ForwardingAddress; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -14673,36 +15660,32 @@ impl<'a, C, A> UserStopCall<'a, C, A> where C: BorrowMut, A: oaut /// # hyper::Client::new(), /// # ::default(), None); /// # let mut hub = Gmail::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = ForwardingAddress::default(); -/// /// // You can configure optional parameters by calling 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().settings_forwarding_addresses_create(req, "userId") +/// let result = hub.users().settings_send_as_smime_info_set_default("userId", "sendAsEmail", "id") /// .doit(); /// # } /// ``` -pub struct UserSettingForwardingAddresseCreateCall<'a, C, A> +pub struct UserSettingSendASmimeInfoSetDefaultCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Gmail, - _request: ForwardingAddress, _user_id: String, + _send_as_email: String, + _id: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for UserSettingForwardingAddresseCreateCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for UserSettingSendASmimeInfoSetDefaultCall<'a, C, A> {} -impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> UserSettingSendASmimeInfoSetDefaultCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ForwardingAddress)> { + pub fn doit(mut self) -> Result { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -14710,11 +15693,13 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "gmail.users.settings.forwardingAddresses.create", + dlg.begin(MethodInfo { id: "gmail.users.settings.sendAs.smimeInfo.setDefault", http_method: hyper::method::Method::Post }); let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("userId", self._user_id.to_string())); - for &field in ["alt", "userId"].iter() { + params.push(("sendAsEmail", self._send_as_email.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["userId", "sendAsEmail", "id"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -14724,14 +15709,13 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow params.push((&name, value.clone())); } - params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/settings/forwardingAddresses"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault".to_string(); if self._scopes.len() == 0 { - self._scopes.insert(Scope::SettingSharing.as_ref().to_string(), ()); + self._scopes.insert(Scope::SettingBasic.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{userId}", "userId")].iter() { + for &(find_this, param_name) in [("{userId}", "userId"), ("{sendAsEmail}", "sendAsEmail"), ("{id}", "id")].iter() { let mut replace_with: Option<&str> = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -14742,8 +15726,8 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow url = url.replace(find_this, replace_with.expect("to find substitution value in params")); } { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["userId"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["id", "sendAsEmail", "userId"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -14758,17 +15742,6 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow url.push_str(&url::form_urlencoded::serialize(params)); } - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); loop { @@ -14785,15 +15758,11 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow } }; let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); let mut req_result = { let mut client = &mut *self.hub.client.borrow_mut(); let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) .header(UserAgent(self.hub._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() @@ -14824,17 +15793,7 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow Ok(serr) => Err(Error::BadRequest(serr)) } } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; + let result_value = res; dlg.finished(true); return Ok(result_value) @@ -14844,32 +15803,43 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow } - /// - /// Sets the *request* property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn request(mut self, new_value: ForwardingAddress) -> UserSettingForwardingAddresseCreateCall<'a, C, A> { - self._request = new_value; - self - } - /// User's email address. The special value "me" can be used to indicate the authenticated user. + /// The user's email address. The special value me can be used to indicate the authenticated user. /// /// Sets the *user id* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn user_id(mut self, new_value: &str) -> UserSettingForwardingAddresseCreateCall<'a, C, A> { + pub fn user_id(mut self, new_value: &str) -> UserSettingSendASmimeInfoSetDefaultCall<'a, C, A> { self._user_id = new_value.to_string(); self } + /// The email address that appears in the "From:" header for mail sent using this alias. + /// + /// Sets the *send as email* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn send_as_email(mut self, new_value: &str) -> UserSettingSendASmimeInfoSetDefaultCall<'a, C, A> { + self._send_as_email = new_value.to_string(); + self + } + /// The immutable ID for the SmimeInfo. + /// + /// 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) -> UserSettingSendASmimeInfoSetDefaultCall<'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) -> UserSettingForwardingAddresseCreateCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> UserSettingSendASmimeInfoSetDefaultCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -14890,7 +15860,7 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> UserSettingForwardingAddresseCreateCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> UserSettingSendASmimeInfoSetDefaultCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -14899,7 +15869,7 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow /// Identifies the authorization scope for the method you are building. /// /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::SettingSharing`. + /// `Scope::SettingBasic`. /// /// The `scope` will be added to a set of scopes. This is important as one can maintain access /// tokens for more than one scope. @@ -14907,7 +15877,7 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> UserSettingForwardingAddresseCreateCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> UserSettingSendASmimeInfoSetDefaultCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -14942,11 +15912,11 @@ impl<'a, C, A> UserSettingForwardingAddresseCreateCall<'a, C, A> where C: Borrow /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().messages_list("userId") -/// .q("eirmod") -/// .page_token("consetetur") -/// .max_results(16) -/// .add_label_ids("sed") -/// .include_spam_trash(true) +/// .q("labore") +/// .page_token("ipsum") +/// .max_results(70) +/// .add_label_ids("dolores") +/// .include_spam_trash(false) /// .doit(); /// # } /// ``` @@ -15012,7 +15982,7 @@ impl<'a, C, A> UserMessageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/messages"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/messages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -15125,7 +16095,7 @@ impl<'a, C, A> UserMessageListCall<'a, C, A> where C: BorrowMut, self._user_id = new_value.to_string(); self } - /// Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. + /// Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. /// /// Sets the *q* query property to the given value. pub fn q(mut self, new_value: &str) -> UserMessageListCall<'a, C, A> { @@ -15214,6 +16184,8 @@ impl<'a, C, A> UserMessageListCall<'a, C, A> where C: BorrowMut, /// Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. +/// +/// Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. /// /// A builder for the *settings.sendAs.update* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. @@ -15292,7 +16264,7 @@ impl<'a, C, A> UserSettingSendAUpdateCall<'a, C, A> where C: BorrowMut UserSettingFilterCreateCall<'a, C, A> where C: BorrowMut UserSettingFilterCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Gmail::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.users().settings_send_as_smime_info_delete("userId", "sendAsEmail", "id") +/// .doit(); +/// # } +/// ``` +pub struct UserSettingSendASmimeInfoDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Gmail, + _user_id: String, + _send_as_email: String, + _id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserSettingSendASmimeInfoDeleteCall<'a, C, A> {} + +impl<'a, C, A> UserSettingSendASmimeInfoDeleteCall<'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: "gmail.users.settings.sendAs.smimeInfo.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + params.push(("sendAsEmail", self._send_as_email.to_string())); + params.push(("id", self._id.to_string())); + for &field in ["userId", "sendAsEmail", "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 = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::SettingBasic.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userId}", "userId"), ("{sendAsEmail}", "sendAsEmail"), ("{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", "sendAsEmail", "userId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::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 user's email address. The special value me can be used to indicate the authenticated user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserSettingSendASmimeInfoDeleteCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// The email address that appears in the "From:" header for mail sent using this alias. + /// + /// Sets the *send as email* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn send_as_email(mut self, new_value: &str) -> UserSettingSendASmimeInfoDeleteCall<'a, C, A> { + self._send_as_email = new_value.to_string(); + self + } + /// The immutable ID for the SmimeInfo. + /// + /// 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) -> UserSettingSendASmimeInfoDeleteCall<'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) -> UserSettingSendASmimeInfoDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserSettingSendASmimeInfoDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::SettingBasic`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserSettingSendASmimeInfoDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Moves the specified message to the trash. /// /// A builder for the *messages.trash* method supported by a *user* resource. @@ -15829,7 +17049,7 @@ impl<'a, C, A> UserMessageTrashCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/messages/{id}/trash"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/messages/{id}/trash".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Gmai.as_ref().to_string(), ()); } @@ -16074,7 +17294,7 @@ impl<'a, C, A> UserGetProfileCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/profile"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/profile".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -16266,8 +17486,8 @@ impl<'a, C, A> UserGetProfileCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.users().threads_get("userId", "id") -/// .add_metadata_headers("dolores") -/// .format("sit") +/// .add_metadata_headers("invidunt") +/// .format("ut") /// .doit(); /// # } /// ``` @@ -16323,7 +17543,7 @@ impl<'a, C, A> UserThreadGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{userId}/threads/{id}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/threads/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -16514,6 +17734,8 @@ impl<'a, C, A> UserThreadGetCall<'a, C, A> where C: BorrowMut, A: /// Sends a verification email to the specified send-as alias address. The verification status must be pending. +/// +/// This method is only available to service account clients that have been delegated domain-wide authority. /// /// A builder for the *settings.sendAs.verify* method supported by a *user* resource. /// It is not used directly, but through a `UserMethods` instance. @@ -16584,7 +17806,7 @@ impl<'a, C, A> UserSettingSendAVerifyCall<'a, C, A> where C: BorrowMut UserSettingSendAVerifyCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Gmail::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.users().settings_forwarding_addresses_list("userId") +/// .doit(); +/// # } +/// ``` +pub struct UserSettingForwardingAddresseListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Gmail, + _user_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for UserSettingForwardingAddresseListCall<'a, C, A> {} + +impl<'a, C, A> UserSettingForwardingAddresseListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListForwardingAddressesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "gmail.users.settings.forwardingAddresses.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + for &field in ["alt", "userId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/forwardingAddresses".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["userId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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's email address. The special value "me" can be used to indicate the authenticated user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserSettingForwardingAddresseListCall<'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) -> UserSettingForwardingAddresseListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> UserSettingForwardingAddresseListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> UserSettingForwardingAddresseListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message. /// /// A builder for the *messages.insert* method supported by a *user* resource. @@ -16783,7 +18240,7 @@ impl<'a, C, A> UserSettingSendAVerifyCall<'a, C, A> where C: BorrowMut UserMessageInsertCall<'a, C, A> where C: BorrowMut let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/gmail/v1/users/{userId}/messages", "multipart") + ("https://www.googleapis.com/upload/gmail/v1/users/{userId}/messages".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/gmail/v1/users/{userId}/messages", "resumable") + ("https://www.googleapis.com/resumable/upload/gmail/v1/users/{userId}/messages".to_string(), "resumable") } else { unreachable!() }; @@ -16926,8 +18383,8 @@ impl<'a, C, A> UserMessageInsertCall<'a, C, A> where C: BorrowMut mp_reader.reserve_exact(2); let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 36700160 { - return Err(Error::UploadSizeLimitExceeded(size, 36700160)) + if size > 52428800 { + return Err(Error::UploadSizeLimitExceeded(size, 52428800)) } mp_reader.add_part(&mut request_value_reader, request_size, json_mime_type.clone()) .add_part(&mut reader, size, reader_mime_type.clone()); @@ -16980,8 +18437,8 @@ impl<'a, C, A> UserMessageInsertCall<'a, C, A> where C: BorrowMut if protocol == "resumable" { let size = reader.seek(io::SeekFrom::End(0)).unwrap(); reader.seek(io::SeekFrom::Start(0)).unwrap(); - if size > 36700160 { - return Err(Error::UploadSizeLimitExceeded(size, 36700160)) + if size > 52428800 { + return Err(Error::UploadSizeLimitExceeded(size, 52428800)) } let mut client = &mut *self.hub.client.borrow_mut(); let upload_result = { @@ -17044,7 +18501,7 @@ impl<'a, C, A> UserMessageInsertCall<'a, C, A> where C: BorrowMut /// Upload media all at once. /// If the upload fails for whichever reason, all progress is lost. /// - /// * *max size*: 35MB + /// * *max size*: 50MB /// * *multipart*: yes /// * *valid mime types*: 'message/rfc822' pub fn upload(self, stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, Message)> @@ -17060,7 +18517,7 @@ impl<'a, C, A> UserMessageInsertCall<'a, C, A> where C: BorrowMut /// may specify the `chunk_size()` and may cancel the operation before each chunk is uploaded, using /// `cancel_chunk_upload(...)`. /// - /// * *max size*: 35MB + /// * *max size*: 50MB /// * *multipart*: yes /// * *valid mime types*: 'message/rfc822' pub fn upload_resumable(self, resumeable_stream: RS, mime_type: mime::Mime) -> Result<(hyper::client::Response, Message)> @@ -17094,7 +18551,7 @@ impl<'a, C, A> UserMessageInsertCall<'a, C, A> where C: BorrowMut self._internal_date_source = Some(new_value.to_string()); self } - /// Mark the email as permanently deleted (not TRASH) and only visible in Google Apps Vault to a Vault administrator. Only used for Google Apps for Work accounts. + /// Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. /// /// Sets the *deleted* query property to the given value. pub fn deleted(mut self, new_value: bool) -> UserMessageInsertCall<'a, C, A> { @@ -17223,7 +18680,7 @@ impl<'a, C, A> UserSettingGetAutoForwardingCall<'a, C, A> where C: BorrowMut UserSettingGetAutoForwardingCall<'a, C, A> where C: BorrowMut UserSettingSendADeleteCall<'a, C, A> where C: BorrowMut UserSettingSendADeleteCall<'a, C, A> where C: BorrowMut UserSettingForwardingAddresseDeleteCall<'a, C, A> where C: Borrow } - let mut url = self.hub._base_url.clone() + "{userId}/settings/forwardingAddresses/{forwardingEmail}"; + let mut url = "https://www.googleapis.com/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::SettingSharing.as_ref().to_string(), ()); } @@ -17860,3 +19321,4 @@ impl<'a, C, A> UserSettingForwardingAddresseDeleteCall<'a, C, A> where C: Borrow } + diff --git a/gen/groupsmigration1-cli/Cargo.toml b/gen/groupsmigration1-cli/Cargo.toml index 1c93641a9c..8659c696dd 100644 --- a/gen/groupsmigration1-cli/Cargo.toml +++ b/gen/groupsmigration1-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/groupsmigration1/src/lib.rs b/gen/groupsmigration1/src/lib.rs index 22bb7924a3..3779bed6ea 100644 --- a/gen/groupsmigration1/src/lib.rs +++ b/gen/groupsmigration1/src/lib.rs @@ -175,7 +175,7 @@ // 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 +// 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)] @@ -301,8 +301,6 @@ pub struct GroupsMigration { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for GroupsMigration {} @@ -315,8 +313,6 @@ impl<'a, C, A> GroupsMigration client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/groups/v1/groups/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -333,26 +329,6 @@ impl<'a, C, A> GroupsMigration self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/groups/v1/groups/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -523,9 +499,9 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/groups/v1/groups/{groupId}/archive", "multipart") + ("https://www.googleapis.com/upload/groups/v1/groups/{groupId}/archive".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/groups/v1/groups/{groupId}/archive", "resumable") + ("https://www.googleapis.com/resumable/upload/groups/v1/groups/{groupId}/archive".to_string(), "resumable") } else { unreachable!() }; @@ -793,3 +769,4 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/groupssettings1-cli/Cargo.toml b/gen/groupssettings1-cli/Cargo.toml index 7b4769c3e5..b07efb5da2 100644 --- a/gen/groupssettings1-cli/Cargo.toml +++ b/gen/groupssettings1-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/groupssettings1/src/lib.rs b/gen/groupssettings1/src/lib.rs index b79837f714..2c0b4dfc61 100644 --- a/gen/groupssettings1/src/lib.rs +++ b/gen/groupssettings1/src/lib.rs @@ -178,7 +178,7 @@ // 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 +// 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)] @@ -223,7 +223,7 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { - /// View and manage the settings of a Google Apps Group + /// View and manage the settings of a G Suite group AppGroupSetting, } @@ -309,8 +309,6 @@ pub struct Groupssettings { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Groupssettings {} @@ -323,8 +321,6 @@ impl<'a, C, A> Groupssettings client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/groups/v1/groups/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -341,26 +337,6 @@ impl<'a, C, A> Groupssettings self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/groups/v1/groups/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -659,7 +635,7 @@ impl<'a, C, A> GroupUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{groupUniqueId}"; + let mut url = "https://www.googleapis.com/groups/v1/groups/{groupUniqueId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppGroupSetting.as_ref().to_string(), ()); } @@ -925,7 +901,7 @@ 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() + "{groupUniqueId}"; + let mut url = "https://www.googleapis.com/groups/v1/groups/{groupUniqueId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppGroupSetting.as_ref().to_string(), ()); } @@ -1184,7 +1160,7 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{groupUniqueId}"; + let mut url = "https://www.googleapis.com/groups/v1/groups/{groupUniqueId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppGroupSetting.as_ref().to_string(), ()); } @@ -1349,3 +1325,4 @@ impl<'a, C, A> GroupGetCall<'a, C, A> where C: BorrowMut, A: oaut } + diff --git a/gen/iam1-cli/Cargo.toml b/gen/iam1-cli/Cargo.toml index 9e7c4ffc7b..df101a1da1 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.4+20160915" +version = "1.0.4+20170515" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-iam1] path = "../iam1" -version = "1.0.4+20160915" +version = "1.0.4+20170515" diff --git a/gen/iam1-cli/README.md b/gen/iam1-cli/README.md index 5d99cc845c..eb1aa9d73e 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 *20160915*. The CLI is at version *1.0.4*. +This documentation was generated from the *iam* API at revision *20170515*. The CLI is at version *1.0.4*. ```bash iam1 [options] @@ -41,6 +41,7 @@ iam1 [options] service-accounts-list [-p ]... [-o ] service-accounts-set-iam-policy (-r )... [-p ]... [-o ] service-accounts-sign-blob (-r )... [-p ]... [-o ] + service-accounts-sign-jwt (-r )... [-p ]... [-o ] service-accounts-test-iam-permissions (-r )... [-p ]... [-o ] service-accounts-update (-r )... [-p ]... [-o ] roles diff --git a/gen/iam1-cli/mkdocs.yml b/gen/iam1-cli/mkdocs.yml index 6d08b5b543..17c991dedd 100644 --- a/gen/iam1-cli/mkdocs.yml +++ b/gen/iam1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: iam v1.0.4+20160915 +site_name: iam v1.0.4+20170515 site_url: http://byron.github.io/google-apis-rs/google-iam1-cli site_description: A complete library to interact with iam (protocol v1) @@ -20,6 +20,7 @@ pages: - ['projects_service-accounts-list.md', 'Projects', 'Service Accounts List'] - ['projects_service-accounts-set-iam-policy.md', 'Projects', 'Service Accounts Set Iam Policy'] - ['projects_service-accounts-sign-blob.md', 'Projects', 'Service Accounts Sign Blob'] +- ['projects_service-accounts-sign-jwt.md', 'Projects', 'Service Accounts Sign Jwt'] - ['projects_service-accounts-test-iam-permissions.md', 'Projects', 'Service Accounts Test Iam Permissions'] - ['projects_service-accounts-update.md', 'Projects', 'Service Accounts Update'] - ['roles_query-grantable-roles.md', 'Roles', 'Query Grantable Roles'] diff --git a/gen/iam1-cli/src/main.rs b/gen/iam1-cli/src/main.rs index 24b90307dc..da7410c171 100644 --- a/gen/iam1-cli/src/main.rs +++ b/gen/iam1-cli/src/main.rs @@ -318,9 +318,10 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "private-key-type" => Some(("privateKeyType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "include-public-key-data" => Some(("includePublicKeyData", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "key-algorithm" => Some(("keyAlgorithm", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["key-algorithm", "private-key-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["include-public-key-data", "key-algorithm", "private-key-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -626,8 +627,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())))); @@ -774,6 +775,91 @@ impl<'n> Engine<'n> { } } + fn _projects_service_accounts_sign_jwt(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "payload" => Some(("payload", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["payload"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::SignJwtRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.projects().service_accounts_sign_jwt(request, opt.value_of("name").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _projects_service_accounts_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -973,9 +1059,11 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "page-token" => Some(("pageToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "full-resource-name" => Some(("fullResourceName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "page-size" => Some(("pageSize", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["full-resource-name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["full-resource-name", "page-size", "page-token"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1075,6 +1163,9 @@ impl<'n> Engine<'n> { ("service-accounts-sign-blob", Some(opt)) => { call_result = self._projects_service_accounts_sign_blob(opt, dry_run, &mut err); }, + ("service-accounts-sign-jwt", Some(opt)) => { + call_result = self._projects_service_accounts_sign_jwt(opt, dry_run, &mut err); + }, ("service-accounts-test-iam-permissions", Some(opt)) => { call_result = self._projects_service_accounts_test_iam_permissions(opt, dry_run, &mut err); }, @@ -1184,14 +1275,16 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("projects", "methods: 'service-accounts-create', 'service-accounts-delete', 'service-accounts-get', 'service-accounts-get-iam-policy', 'service-accounts-keys-create', 'service-accounts-keys-delete', 'service-accounts-keys-get', 'service-accounts-keys-list', 'service-accounts-list', 'service-accounts-set-iam-policy', 'service-accounts-sign-blob', 'service-accounts-test-iam-permissions' and 'service-accounts-update'", vec![ + ("projects", "methods: 'service-accounts-create', 'service-accounts-delete', 'service-accounts-get', 'service-accounts-get-iam-policy', 'service-accounts-keys-create', 'service-accounts-keys-delete', 'service-accounts-keys-get', 'service-accounts-keys-list', 'service-accounts-list', 'service-accounts-set-iam-policy', 'service-accounts-sign-blob', 'service-accounts-sign-jwt', 'service-accounts-test-iam-permissions' and 'service-accounts-update'", vec![ ("service-accounts-create", - Some(r##"Creates a ServiceAccount and returns it."##), + Some(r##"Creates a ServiceAccount + and returns it."##), "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_service-accounts-create", vec![ (Some(r##"name"##), None, - Some(r##"Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`."##), + Some(r##"Required. The resource name of the project associated with the service + accounts, such as `projects/my-project-123`."##), Some(true), Some(false)), @@ -1219,7 +1312,11 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: `projects/{project}/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 `unique_id` of the service account."##), + 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 + `unique_id` of the service account."##), Some(true), Some(false)), @@ -1241,7 +1338,11 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: `projects/{project}/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 `unique_id` of the service account."##), + 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 + `unique_id` of the service account."##), Some(true), Some(false)), @@ -1258,12 +1359,14 @@ fn main() { Some(false)), ]), ("service-accounts-get-iam-policy", - Some(r##"Returns the IAM access control policy for a ServiceAccount."##), + Some(r##"Returns the IAM access control policy for a + ServiceAccount."##), "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_service-accounts-get-iam-policy", vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which the policy is being requested. `resource` is usually specified as a path. For example, a Project resource is specified as `projects/{project}`."##), + 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)), @@ -1280,12 +1383,17 @@ fn main() { Some(false)), ]), ("service-accounts-keys-create", - Some(r##"Creates a ServiceAccountKey and returns it."##), + Some(r##"Creates a ServiceAccountKey + and returns it."##), "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_service-accounts-keys-create", vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: `projects/{project}/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 `unique_id` of the service account."##), + 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 + `unique_id` of the service account."##), Some(true), Some(false)), @@ -1313,7 +1421,11 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account key in the following format: `projects/{project}/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 `unique_id` of the service account."##), + 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 + `unique_id` of the service account."##), Some(true), Some(false)), @@ -1330,12 +1442,18 @@ fn main() { Some(false)), ]), ("service-accounts-keys-get", - Some(r##"Gets the ServiceAccountKey by key id."##), + Some(r##"Gets the ServiceAccountKey + by key id."##), "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_service-accounts-keys-get", vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account key in the following format: `projects/{project}/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 `unique_id` of the service account."##), + 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 + `unique_id` of the service account."##), Some(true), Some(false)), @@ -1357,7 +1475,12 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: `projects/{project}/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 `unique_id` of the service account."##), + 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 + `unique_id` of the service account."##), Some(true), Some(false)), @@ -1379,7 +1502,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`."##), + Some(r##"Required. The resource name of the project associated with the service + accounts, such as `projects/my-project-123`."##), Some(true), Some(false)), @@ -1396,12 +1520,14 @@ fn main() { Some(false)), ]), ("service-accounts-set-iam-policy", - Some(r##"Sets the IAM access control policy for a ServiceAccount."##), + Some(r##"Sets the IAM access control policy for a + ServiceAccount."##), "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_service-accounts-set-iam-policy", vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which the policy is being specified. `resource` is usually specified as a path. For example, a Project resource is specified as `projects/{project}`."##), + 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)), @@ -1429,7 +1555,47 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: `projects/{project}/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 `unique_id` of the service account."##), + 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 + `unique_id` of the service account."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("service-accounts-sign-jwt", + Some(r##"Signs a JWT using a service account's system-managed private key. + + If no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an + an expiry time of one hour by default. If you request an expiry time of + more than one hour, the request will fail."##), + "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_service-accounts-sign-jwt", + vec![ + (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 + `unique_id` of the service account."##), Some(true), Some(false)), @@ -1452,12 +1618,14 @@ fn main() { Some(false)), ]), ("service-accounts-test-iam-permissions", - Some(r##"Tests the specified permissions against the IAM access control policy for a ServiceAccount."##), + Some(r##"Tests the specified permissions against the IAM access control policy + for a ServiceAccount."##), "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_service-accounts-test-iam-permissions", vec![ (Some(r##"resource"##), None, - Some(r##"REQUIRED: The resource for which the policy detail is being requested. `resource` is usually specified as a path. For example, a Project resource is specified as `projects/{project}`."##), + 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)), @@ -1480,12 +1648,24 @@ fn main() { Some(false)), ]), ("service-accounts-update", - Some(r##"Updates a ServiceAccount. Currently, only the following fields are updatable: `display_name` . The `etag` is mandatory."##), + Some(r##"Updates a ServiceAccount. + + Currently, only the following fields are updatable: + `display_name` . + The `etag` is mandatory."##), "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/projects_service-accounts-update", vec![ (Some(r##"name"##), None, - Some(r##"The resource name of the service account in the following format: `projects/{project}/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. In responses the resource name will always be in the format `projects/{project}/serviceAccounts/{email}`."##), + Some(r##"The resource name of the service account in the following format: + `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + + Requests using `-` as a wildcard for the project will infer the project + from the `account` and the `account` value can be the `email` address or + the `unique_id` of the service account. + + In responses the resource name will always be in the format + `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`."##), Some(true), Some(false)), @@ -1511,7 +1691,9 @@ fn main() { ("roles", "methods: 'query-grantable-roles'", vec![ ("query-grantable-roles", - Some(r##"Queries roles that can be granted on a particular resource. A role is grantable if it can be used as the role in a binding for a policy for that resource."##), + Some(r##"Queries roles that can be granted on a particular resource. + A role is grantable if it can be used as the role in a binding for a policy + for that resource."##), "Details at http://byron.github.io/google-apis-rs/google_iam1_cli/roles_query-grantable-roles", vec![ (Some(r##"kv"##), @@ -1538,7 +1720,7 @@ fn main() { let mut app = App::new("iam1") .author("Sebastian Thiel ") - .version("1.0.4+20160915") + .version("1.0.4+20170515") .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 bdc3610a0f..ed9eb41d3c 100644 --- a/gen/iam1/Cargo.toml +++ b/gen/iam1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-iam1" -version = "1.0.4+20160915" +version = "1.0.4+20170515" 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.4+20160915" +documentation = "https://docs.rs/google-iam1/1.0.4+20170515" license = "MIT" keywords = ["iam", "google", "protocol", "web", "api"] diff --git a/gen/iam1/README.md b/gen/iam1/README.md index 42f8179fd7..3e78f466e2 100644 --- a/gen/iam1/README.md +++ b/gen/iam1/README.md @@ -5,18 +5,18 @@ 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.4+20160915*, where *20160915* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *iam* crate version *1.0.4+20170515*, where *20170515* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20160915/google_iam1/struct.Iam.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.Iam.html) ... * projects - * [*service accounts create*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountDeleteCall.html), [*service accounts get*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountListCall.html), [*service accounts set iam policy*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountSignBlobCall.html), [*service accounts test iam permissions*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountTestIamPermissionCall.html) and [*service accounts update*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.ProjectServiceAccountUpdateCall.html) -* [roles](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.Role.html) - * [*query grantable roles*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/struct.RoleQueryGrantableRoleCall.html) + * [*service accounts create*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountDeleteCall.html), [*service accounts get*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountListCall.html), [*service accounts set iam policy*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountTestIamPermissionCall.html) and [*service accounts update*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.ProjectServiceAccountUpdateCall.html) +* [roles](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.Role.html) + * [*query grantable roles*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/struct.RoleQueryGrantableRoleCall.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-iam1/1.0.4+20160915/google_iam1/struct.Iam.html)** +* **[Hub](https://docs.rs/google-iam1/1.0.4+20170515/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.4+20160915/google_iam1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-iam1/1.0.4+20170515/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.4+20160915/google_iam1/trait.Part.html)** + * **[Parts](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-iam1/1.0.4+20160915/google_iam1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-iam1/1.0.4+20170515/google_iam1/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-iam1/1.0.4+20160915/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.4+20170515/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.4+20160915/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.4+20170515/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.4+20160915/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.4+20170515/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.4+20160915/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.4+20170515/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")`. @@ -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-iam1/1.0.4+20160915/google_iam1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-iam1/1.0.4+20160915/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.4+20170515/google_iam1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-iam1/1.0.4+20170515/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.4+20160915/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.4+20170515/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.4+20160915/google_iam1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-iam1/1.0.4+20160915/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.4+20170515/google_iam1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-iam1/1.0.4+20170515/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.4+20160915/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.4+20170515/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.4+20160915/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.4+20170515/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.4+20160915/google_iam1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-iam1/1.0.4+20170515/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 f7ed7323a1..29a62ace7b 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.4+20160915*, where *20160915* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *iam* crate version *1.0.4+20170515*, where *20170515* is the exact revision of the *iam:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *iam* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/iam/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Iam.html) ... //! //! * projects -//! * [*service accounts create*](struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](struct.ProjectServiceAccountDeleteCall.html), [*service accounts get*](struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](struct.ProjectServiceAccountListCall.html), [*service accounts set iam policy*](struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](struct.ProjectServiceAccountSignBlobCall.html), [*service accounts test iam permissions*](struct.ProjectServiceAccountTestIamPermissionCall.html) and [*service accounts update*](struct.ProjectServiceAccountUpdateCall.html) +//! * [*service accounts create*](struct.ProjectServiceAccountCreateCall.html), [*service accounts delete*](struct.ProjectServiceAccountDeleteCall.html), [*service accounts get*](struct.ProjectServiceAccountGetCall.html), [*service accounts get iam policy*](struct.ProjectServiceAccountGetIamPolicyCall.html), [*service accounts keys create*](struct.ProjectServiceAccountKeyCreateCall.html), [*service accounts keys delete*](struct.ProjectServiceAccountKeyDeleteCall.html), [*service accounts keys get*](struct.ProjectServiceAccountKeyGetCall.html), [*service accounts keys list*](struct.ProjectServiceAccountKeyListCall.html), [*service accounts list*](struct.ProjectServiceAccountListCall.html), [*service accounts set iam policy*](struct.ProjectServiceAccountSetIamPolicyCall.html), [*service accounts sign blob*](struct.ProjectServiceAccountSignBlobCall.html), [*service accounts sign jwt*](struct.ProjectServiceAccountSignJwtCall.html), [*service accounts test iam permissions*](struct.ProjectServiceAccountTestIamPermissionCall.html) and [*service accounts update*](struct.ProjectServiceAccountUpdateCall.html) //! * [roles](struct.Role.html) //! * [*query grantable roles*](struct.RoleQueryGrantableRoleCall.html) //! @@ -180,7 +180,7 @@ // 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 +// 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)] @@ -311,8 +311,6 @@ pub struct Iam { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Iam {} @@ -325,8 +323,6 @@ impl<'a, C, A> Iam client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://iam.googleapis.com/".to_string(), - _root_url: "https://iam.googleapis.com/".to_string(), } } @@ -346,26 +342,6 @@ impl<'a, C, A> Iam self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://iam.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://iam.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -383,7 +359,10 @@ impl<'a, C, A> Iam /// #[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). + /// 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>, } @@ -401,7 +380,10 @@ impl RequestValue for TestIamPermissionsRequest {} /// #[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. + /// 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, } @@ -426,7 +408,41 @@ pub struct ListServiceAccountKeysResponse { impl ResponseResult for ListServiceAccountKeysResponse {} -/// A service account in the Identity and Access Management API. To create a service account, specify the `project_id` and the `account_id` for the account. The `account_id` is unique within the project, and is used to generate the service account email address and a stable `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}/serviceAccounts/{email}. 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}/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 `unique_id` of the service account. +/// The service account sign JWT 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*). +/// +/// * [service accounts sign jwt projects](struct.ProjectServiceAccountSignJwtCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SignJwtRequest { + /// The JWT payload to sign, a JSON JWT Claim set. + pub payload: Option, +} + +impl RequestValue for SignJwtRequest {} + + +/// A service account in the Identity and Access Management API. +/// +/// To create a service account, specify the `project_id` and the `account_id` +/// for the account. The `account_id` is unique within the project, and is used +/// to generate the service account email address and a stable +/// `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. +/// +/// 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 +/// `unique_id` of the service account. /// /// # Activities /// @@ -439,15 +455,26 @@ impl ResponseResult for ListServiceAccountKeysResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ServiceAccount { - /// @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. + /// @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")] pub oauth2_client_id: Option, /// Used to perform a consistent read-modify-write. pub etag: Option, - /// Optional. A user-specified description of the service account. Must be fewer than 100 UTF-8 bytes. + /// Optional. A user-specified description of the service account. Must be + /// fewer than 100 UTF-8 bytes. #[serde(rename="displayName")] pub display_name: Option, - /// The resource name of the service account in the following format: `projects/{project}/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. In responses the resource name will always be in the format `projects/{project}/serviceAccounts/{email}`. + /// The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// + /// Requests using `-` as a wildcard for the project will infer the project + /// from the `account` and the `account` value can be the `email` address or + /// the `unique_id` of the service account. + /// + /// In responses the resource name will always be in the format + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. pub name: Option, /// @OutputOnly The unique and stable id of the service account. #[serde(rename="uniqueId")] @@ -474,6 +501,10 @@ impl ResponseResult for ServiceAccount {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct QueryGrantableRolesResponse { + /// To retrieve the next page of results, set + /// `QueryGrantableRolesRequest.page_token` to this value. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, /// The list of matching roles. pub roles: Option>, } @@ -492,12 +523,19 @@ impl ResponseResult for QueryGrantableRolesResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Role { - /// Optional. A human-readable title for the role. Typically this is limited to 100 UTF-8 bytes. - pub title: Option, - /// Optional. A human-readable description for the role. + /// 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. When Role is used in output and other input such as UpdateRole, the role name is the complete path, e.g., roles/logging.viewer for curated roles and organizations/{organization-id}/roles/logging.viewer for custom roles. + /// The name of the role. + /// + /// When Role is used in CreateRole, the role name must not be set. + /// + /// When Role is used in output and other input such as UpdateRole, the role + /// name is the complete path, e.g., roles/logging.viewer for curated roles + /// and organizations/{ORGANIZATION_ID}/roles/logging.viewer for custom roles. pub name: Option, + /// Optional. A human-readable title for the role. Typically this + /// is limited to 100 UTF-8 bytes. + pub title: Option, } impl Resource for Role {} @@ -533,7 +571,9 @@ impl RequestValue for SignBlobRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListServiceAccountsResponse { - /// To retrieve the next page of results, set ListServiceAccountsRequest.page_token to this value. + /// To retrieve the next page of results, set + /// ListServiceAccountsRequest.page_token + /// to this value. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The list of matching service accounts. @@ -543,7 +583,37 @@ pub struct ListServiceAccountsResponse { impl ResponseResult for ListServiceAccountsResponse {} -/// 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). +/// 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 /// @@ -555,12 +625,23 @@ impl ResponseResult for ListServiceAccountsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Policy { - /// Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error. + /// Associates a list of `members` to a `role`. + /// Multiple `bindings` must not be specified for the same `role`. + /// `bindings` with no members will result in an error. pub bindings: Option>, + /// `etag` is used for optimistic concurrency control as a way to help + /// prevent simultaneous updates of a policy from overwriting each other. + /// It is strongly suggested that systems make use of the `etag` in the + /// read-modify-write cycle to perform policy updates in order to avoid race + /// conditions: An `etag` is returned in the response to `getIamPolicy`, and + /// systems are expected to put that etag in the request to `setIamPolicy` to + /// ensure that their change will be applied to the same version of the policy. + /// + /// If no `etag` is provided in the call to `setIamPolicy`, then the existing + /// policy is overwritten blindly. + pub etag: Option, /// Version of the `Policy`. The default version is 0. pub version: Option, - /// `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy. If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. - pub etag: Option, } impl ResponseResult for Policy {} @@ -577,15 +658,34 @@ impl ResponseResult for Policy {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct QueryGrantableRolesRequest { - /// Required. The full resource name to query from the list of grantable roles. The name follows the Google Cloud Platform resource format. For example, a Cloud Platform project with id `my-project` will be named `//cloudresourcemanager.googleapis.com/projects/my-project`. + /// Optional pagination token returned in an earlier + /// QueryGrantableRolesResponse. + #[serde(rename="pageToken")] + pub page_token: Option, + /// Required. The full resource name to query from the list of grantable roles. + /// + /// The name follows the Google Cloud Platform resource format. + /// For example, a Cloud Platform project with id `my-project` will be named + /// `//cloudresourcemanager.googleapis.com/projects/my-project`. #[serde(rename="fullResourceName")] pub full_resource_name: Option, + /// Optional limit on the number of roles to include in the response. + #[serde(rename="pageSize")] + pub page_size: Option, } impl RequestValue for QueryGrantableRolesRequest {} -/// 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 `{}`. +/// 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 /// @@ -612,29 +712,92 @@ impl ResponseResult for Empty {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TestIamPermissionsResponse { - /// A subset of `TestPermissionsRequest.permissions` that the caller is allowed. + /// A subset of `TestPermissionsRequest.permissions` that the caller is + /// allowed. pub permissions: Option>, } impl ResponseResult for TestIamPermissionsResponse {} +/// The service account sign JWT 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*). +/// +/// * [service accounts sign jwt projects](struct.ProjectServiceAccountSignJwtCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SignJwtResponse { + /// The id of the key used to sign the JWT. + #[serde(rename="keyId")] + pub key_id: Option, + /// The signed JWT. + #[serde(rename="signedJwt")] + pub signed_jwt: Option, +} + +impl ResponseResult for SignJwtResponse {} + + /// 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 + /// 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`. + /// 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 {} -/// Represents a service account key. A service account has two sets of key-pairs: user-managed, and system-managed. User-managed key-pairs can be created and deleted by users. Users are responsible for rotating these keys periodically to ensure security of their service accounts. Users retain the private key of these key-pairs, and Google retains ONLY the public key. System-managed key-pairs are managed automatically by Google, and rotated daily without user intervention. The private key never leaves Google's servers to maximize security. Public keys for all service accounts are also published at the OAuth2 Service Account API. +/// Represents a service account key. +/// +/// A service account has two sets of key-pairs: user-managed, and +/// system-managed. +/// +/// User-managed key-pairs can be created and deleted by users. Users are +/// responsible for rotating these keys periodically to ensure security of +/// their service accounts. Users retain the private key of these key-pairs, +/// and Google retains ONLY the public key. +/// +/// System-managed key-pairs are managed automatically by Google, and rotated +/// daily without user intervention. The private key never leaves Google's +/// servers to maximize security. +/// +/// Public keys for all service accounts are also published at the OAuth2 +/// Service Account API. /// /// # Activities /// @@ -646,16 +809,22 @@ impl Part for Binding {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ServiceAccountKey { + /// The private key data. Only provided in `CreateServiceAccountKey` + /// responses. + #[serde(rename="privateKeyData")] + pub private_key_data: Option, + /// The resource name of the service account key in the following format + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + pub name: Option, /// Specifies the algorithm (and possibly key size) for the key. #[serde(rename="keyAlgorithm")] pub key_algorithm: Option, - /// The key can be used after this timestamp. - #[serde(rename="validAfterTime")] - pub valid_after_time: Option, - /// The private key data. Only provided in `CreateServiceAccountKey` responses. - #[serde(rename="privateKeyData")] - pub private_key_data: Option, - /// The output format for the private key. Only provided in `CreateServiceAccountKey` responses, not in `GetServiceAccountKey` or `ListServiceAccountKey` responses. Google never exposes system-managed private keys, and never retains user-managed private keys. + /// The output format for the private key. + /// Only provided in `CreateServiceAccountKey` responses, not + /// in `GetServiceAccountKey` or `ListServiceAccountKey` responses. + /// + /// Google never exposes system-managed private keys, and never retains + /// user-managed private keys. #[serde(rename="privateKeyType")] pub private_key_type: Option, /// The key can be used before this timestamp. @@ -664,8 +833,9 @@ pub struct ServiceAccountKey { /// The public key data. Only provided in `GetServiceAccountKey` responses. #[serde(rename="publicKeyData")] pub public_key_data: Option, - /// The resource name of the service account key in the following format `projects/{project}/serviceAccounts/{account}/keys/{key}`. - pub name: Option, + /// The key can be used after this timestamp. + #[serde(rename="validAfterTime")] + pub valid_after_time: Option, } impl ResponseResult for ServiceAccountKey {} @@ -703,10 +873,16 @@ impl ResponseResult for SignBlobResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateServiceAccountKeyRequest { - /// The output format of the private key. `GOOGLE_CREDENTIALS_FILE` is the default output format. + /// The output format of the private key. `GOOGLE_CREDENTIALS_FILE` is the + /// default output format. #[serde(rename="privateKeyType")] pub private_key_type: Option, - /// Which type of key and algorithm to use for the key. The default is currently a 4K RSA key. However this may change in the future. + /// no description provided + #[serde(rename="includePublicKeyData")] + pub include_public_key_data: Option, + /// Which type of key and algorithm to use for the key. + /// The default is currently a 2K RSA key. However this may change in the + /// future. #[serde(rename="keyAlgorithm")] pub key_algorithm: Option, } @@ -725,10 +901,15 @@ impl RequestValue for CreateServiceAccountKeyRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateServiceAccountRequest { - /// The ServiceAccount resource to create. Currently, only the following values are user assignable: `display_name` . + /// The ServiceAccount resource to create. + /// Currently, only the following values are user assignable: + /// `display_name` . #[serde(rename="serviceAccount")] pub service_account: Option, - /// Required. The account id that is used to generate the service account email address and a stable unique id. It is unique within a project, must be 6-30 characters long, and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035. + /// Required. The account id that is used to generate the service account + /// email address and a stable unique id. It is unique within a project, + /// must be 6-30 characters long, and match the regular expression + /// `[a-z]([-a-z0-9]*[a-z0-9])` to comply with RFC1035. #[serde(rename="accountId")] pub account_id: Option, } @@ -781,7 +962,9 @@ impl<'a, C, A> RoleMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Queries roles that can be granted on a particular resource. A role is grantable if it can be used as the role in a binding for a policy for that resource. + /// Queries roles that can be granted on a particular resource. + /// A role is grantable if it can be used as the role in a binding for a policy + /// for that resource. /// /// # Arguments /// @@ -822,7 +1005,7 @@ impl<'a, C, A> RoleMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Iam::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `service_accounts_create(...)`, `service_accounts_delete(...)`, `service_accounts_get(...)`, `service_accounts_get_iam_policy(...)`, `service_accounts_keys_create(...)`, `service_accounts_keys_delete(...)`, `service_accounts_keys_get(...)`, `service_accounts_keys_list(...)`, `service_accounts_list(...)`, `service_accounts_set_iam_policy(...)`, `service_accounts_sign_blob(...)`, `service_accounts_test_iam_permissions(...)` and `service_accounts_update(...)` +/// // like `service_accounts_create(...)`, `service_accounts_delete(...)`, `service_accounts_get(...)`, `service_accounts_get_iam_policy(...)`, `service_accounts_keys_create(...)`, `service_accounts_keys_delete(...)`, `service_accounts_keys_get(...)`, `service_accounts_keys_list(...)`, `service_accounts_list(...)`, `service_accounts_set_iam_policy(...)`, `service_accounts_sign_blob(...)`, `service_accounts_sign_jwt(...)`, `service_accounts_test_iam_permissions(...)` and `service_accounts_update(...)` /// // to build up your call. /// let rb = hub.projects(); /// # } @@ -843,7 +1026,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the service account in the following format: `projects/{project}/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 `unique_id` of the service account. + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project, will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. pub fn service_accounts_keys_list(&self, name: &str) -> ProjectServiceAccountKeyListCall<'a, C, A> { ProjectServiceAccountKeyListCall { hub: self.hub, @@ -857,12 +1044,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Sets the IAM access control policy for a ServiceAccount. + /// Sets the IAM access control policy for a + /// ServiceAccount. /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy is being specified. `resource` is usually specified as a path. For example, a Project resource is specified as `projects/{project}`. + /// * `resource` - REQUIRED: The resource for which the policy is being specified. + /// See the operation documentation for the appropriate value for this field. pub fn service_accounts_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectServiceAccountSetIamPolicyCall<'a, C, A> { ProjectServiceAccountSetIamPolicyCall { hub: self.hub, @@ -880,7 +1069,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the service account key in the following format: `projects/{project}/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 `unique_id` of the service account. + /// * `name` - The resource name of the service account key in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. pub fn service_accounts_keys_delete(&self, name: &str) -> ProjectServiceAccountKeyDeleteCall<'a, C, A> { ProjectServiceAccountKeyDeleteCall { hub: self.hub, @@ -893,12 +1086,17 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a ServiceAccountKey and returns it. + /// Creates a ServiceAccountKey + /// and returns it. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account in the following format: `projects/{project}/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 `unique_id` of the service account. + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. pub fn service_accounts_keys_create(&self, request: CreateServiceAccountKeyRequest, name: &str) -> ProjectServiceAccountKeyCreateCall<'a, C, A> { ProjectServiceAccountKeyCreateCall { hub: self.hub, @@ -917,7 +1115,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account in the following format: `projects/{project}/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 `unique_id` of the service account. + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. pub fn service_accounts_sign_blob(&self, request: SignBlobRequest, name: &str) -> ProjectServiceAccountSignBlobCall<'a, C, A> { ProjectServiceAccountSignBlobCall { hub: self.hub, @@ -931,12 +1133,22 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a ServiceAccount. Currently, only the following fields are updatable: `display_name` . The `etag` is mandatory. + /// Updates a ServiceAccount. + /// + /// Currently, only the following fields are updatable: + /// `display_name` . + /// The `etag` is mandatory. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The resource name of the service account in the following format: `projects/{project}/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. In responses the resource name will always be in the format `projects/{project}/serviceAccounts/{email}`. + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Requests using `-` as a wildcard for the project will infer the project + /// from the `account` and the `account` value can be the `email` address or + /// the `unique_id` of the service account. + /// In responses the resource name will always be in the format + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. pub fn service_accounts_update(&self, request: ServiceAccount, name: &str) -> ProjectServiceAccountUpdateCall<'a, C, A> { ProjectServiceAccountUpdateCall { hub: self.hub, @@ -954,7 +1166,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`. + /// * `name` - Required. The resource name of the project associated with the service + /// accounts, such as `projects/my-project-123`. pub fn service_accounts_list(&self, name: &str) -> ProjectServiceAccountListCall<'a, C, A> { ProjectServiceAccountListCall { hub: self.hub, @@ -973,7 +1186,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `name` - The resource name of the service account in the following format: `projects/{project}/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 `unique_id` of the service account. + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. pub fn service_accounts_delete(&self, name: &str) -> ProjectServiceAccountDeleteCall<'a, C, A> { ProjectServiceAccountDeleteCall { hub: self.hub, @@ -986,11 +1203,16 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the ServiceAccountKey by key id. + /// Gets the ServiceAccountKey + /// by key id. /// /// # Arguments /// - /// * `name` - The resource name of the service account key in the following format: `projects/{project}/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 `unique_id` of the service account. + /// * `name` - The resource name of the service account key in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}/keys/{key}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. pub fn service_accounts_keys_get(&self, name: &str) -> ProjectServiceAccountKeyGetCall<'a, C, A> { ProjectServiceAccountKeyGetCall { hub: self.hub, @@ -1004,11 +1226,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the IAM access control policy for a ServiceAccount. + /// Returns the IAM access control policy for a + /// ServiceAccount. /// /// # Arguments /// - /// * `resource` - REQUIRED: The resource for which the policy is being requested. `resource` is usually specified as a path. For example, a Project resource is specified as `projects/{project}`. + /// * `resource` - REQUIRED: The resource for which the policy is being requested. + /// See the operation documentation for the appropriate value for this field. pub fn service_accounts_get_iam_policy(&self, resource: &str) -> ProjectServiceAccountGetIamPolicyCall<'a, C, A> { ProjectServiceAccountGetIamPolicyCall { hub: self.hub, @@ -1021,12 +1245,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Tests the specified permissions against the IAM access control policy for a ServiceAccount. + /// Tests the specified permissions against the IAM access control policy + /// for a ServiceAccount. /// /// # Arguments /// /// * `request` - No description provided. - /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. `resource` is usually specified as a path. For example, a Project resource is specified as `projects/{project}`. + /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. + /// See the operation documentation for the appropriate value for this field. pub fn service_accounts_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectServiceAccountTestIamPermissionCall<'a, C, A> { ProjectServiceAccountTestIamPermissionCall { hub: self.hub, @@ -1040,12 +1266,14 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a ServiceAccount and returns it. + /// Creates a ServiceAccount + /// and returns it. /// /// # Arguments /// /// * `request` - No description provided. - /// * `name` - Required. The resource name of the project associated with the service accounts, such as `projects/my-project-123`. + /// * `name` - Required. The resource name of the project associated with the service + /// accounts, such as `projects/my-project-123`. pub fn service_accounts_create(&self, request: CreateServiceAccountRequest, name: &str) -> ProjectServiceAccountCreateCall<'a, C, A> { ProjectServiceAccountCreateCall { hub: self.hub, @@ -1057,13 +1285,44 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Signs a JWT using a service account's system-managed private key. + /// + /// If no expiry time (`exp`) is provided in the `SignJwtRequest`, IAM sets an + /// an expiry time of one hour by default. If you request an expiry time of + /// more than one hour, the request will fail. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. + pub fn service_accounts_sign_jwt(&self, request: SignJwtRequest, name: &str) -> ProjectServiceAccountSignJwtCall<'a, C, A> { + ProjectServiceAccountSignJwtCall { + 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 a ServiceAccount. /// /// # Arguments /// - /// * `name` - The resource name of the service account in the following format: `projects/{project}/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 `unique_id` of the service account. + /// * `name` - The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. pub fn service_accounts_get(&self, name: &str) -> ProjectServiceAccountGetCall<'a, C, A> { ProjectServiceAccountGetCall { hub: self.hub, @@ -1083,7 +1342,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Queries roles that can be granted on a particular resource. A role is grantable if it can be used as the role in a binding for a policy for that resource. +/// Queries roles that can be granted on a particular resource. +/// A role is grantable if it can be used as the role in a binding for a policy +/// for that resource. /// /// A builder for the *queryGrantableRoles* method supported by a *role* resource. /// It is not used directly, but through a `RoleMethods` instance. @@ -1158,7 +1419,7 @@ impl<'a, C, A> RoleQueryGrantableRoleCall<'a, C, A> where C: BorrowMut RoleQueryGrantableRoleCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> RoleQueryGrantableRoleCall<'a, C, A> @@ -1400,7 +1661,7 @@ impl<'a, C, A> ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyListCall<'a, C, A> @@ -1582,7 +1850,8 @@ impl<'a, C, A> ProjectServiceAccountKeyListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSetIamPolicyCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + let mut url = "https://iam.googleapis.com/v1/{+resource}:setIamPolicy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1790,7 +2059,8 @@ impl<'a, C, A> ProjectServiceAccountSetIamPolicyCall<'a, C, A> where C: BorrowMu self._request = new_value; self } - /// REQUIRED: The resource for which the policy is being specified. `resource` is usually specified as a path. For example, a Project resource is specified as `projects/{project}`. + /// 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. /// @@ -1825,12 +2095,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. - /// * *fields* (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) -> ProjectServiceAccountSetIamPolicyCall<'a, C, A> @@ -1929,7 +2199,7 @@ impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyDeleteCall<'a, C, A> @@ -2103,7 +2377,8 @@ impl<'a, C, A> ProjectServiceAccountKeyDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyCreateCall<'a, C, A> @@ -2457,7 +2736,7 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountSignBlobCall<'a, C, A> @@ -2655,7 +2938,11 @@ impl<'a, C, A> ProjectServiceAccountSignBlobCall<'a, C, A> where C: BorrowMut ProjectServiceAccountUpdateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountUpdateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountUpdateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountUpdateCall<'a, C, A> @@ -3012,7 +3307,7 @@ impl<'a, C, A> ProjectServiceAccountListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountListCall<'a, C, A> where C: BorrowMut ProjectServiceAccountListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Optional limit on the number of service accounts to include in the response. Further accounts can subsequently be obtained by including the ListServiceAccountsResponse.next_page_token in a subsequent request. + /// Optional limit on the number of service accounts to include in the + /// response. Further accounts can subsequently be obtained by including the + /// ListServiceAccountsResponse.next_page_token + /// in a subsequent request. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ProjectServiceAccountListCall<'a, C, A> { @@ -3167,12 +3467,12 @@ impl<'a, C, A> ProjectServiceAccountListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountListCall<'a, C, A> @@ -3271,7 +3571,7 @@ impl<'a, C, A> ProjectServiceAccountDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountDeleteCall<'a, C, A> @@ -3445,7 +3749,8 @@ impl<'a, C, A> ProjectServiceAccountDeleteCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountKeyGetCall<'a, C, A> { @@ -3669,12 +3980,12 @@ impl<'a, C, A> ProjectServiceAccountKeyGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountKeyGetCall<'a, C, A> @@ -3702,7 +4013,8 @@ impl<'a, C, A> ProjectServiceAccountKeyGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetIamPolicyCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + let mut url = "https://iam.googleapis.com/v1/{+resource}:getIamPolicy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3879,7 +4191,8 @@ impl<'a, C, A> ProjectServiceAccountGetIamPolicyCall<'a, C, A> where C: BorrowMu } - /// REQUIRED: The resource for which the policy is being requested. `resource` is usually specified as a path. For example, a Project resource is specified as `projects/{project}`. + /// 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. /// @@ -3914,12 +4227,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. - /// * *fields* (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) -> ProjectServiceAccountGetIamPolicyCall<'a, C, A> @@ -3947,7 +4260,8 @@ impl<'a, C, A> ProjectServiceAccountGetIamPolicyCall<'a, C, A> where C: BorrowMu } -/// Tests the specified permissions against the IAM access control policy for a ServiceAccount. +/// Tests the specified permissions against the IAM access control policy +/// for a ServiceAccount. /// /// A builder for the *serviceAccounts.testIamPermissions* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -4025,7 +4339,7 @@ impl<'a, C, A> ProjectServiceAccountTestIamPermissionCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + let mut url = "https://iam.googleapis.com/v1/{+resource}:testIamPermissions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4155,7 +4469,8 @@ impl<'a, C, A> ProjectServiceAccountTestIamPermissionCall<'a, C, A> where C: Bor self._request = new_value; self } - /// REQUIRED: The resource for which the policy detail is being requested. `resource` is usually specified as a path. For example, a Project resource is specified as `projects/{project}`. + /// 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. /// @@ -4190,12 +4505,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. - /// * *fields* (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) -> ProjectServiceAccountTestIamPermissionCall<'a, C, A> @@ -4223,7 +4538,8 @@ impl<'a, C, A> ProjectServiceAccountTestIamPermissionCall<'a, C, A> where C: Bor } -/// Creates a ServiceAccount and returns it. +/// Creates a ServiceAccount +/// and returns it. /// /// A builder for the *serviceAccounts.create* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -4301,7 +4617,7 @@ impl<'a, C, A> ProjectServiceAccountCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountCreateCall<'a, C, A> where C: BorrowMut ProjectServiceAccountCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountCreateCall<'a, C, A> @@ -4499,6 +4816,290 @@ impl<'a, C, A> ProjectServiceAccountCreateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Iam::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = SignJwtRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().service_accounts_sign_jwt(req, "name") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceAccountSignJwtCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Iam, + _request: SignJwtRequest, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceAccountSignJwtCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceAccountSignJwtCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SignJwtResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "iam.projects.serviceAccounts.signJwt", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://iam.googleapis.com/v1/{+name}:signJwt".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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: SignJwtRequest) -> ProjectServiceAccountSignJwtCall<'a, C, A> { + self._request = new_value; + self + } + /// The resource name of the service account in the following format: + /// `projects/{PROJECT_ID}/serviceAccounts/{SERVICE_ACCOUNT_EMAIL}`. + /// Using `-` as a wildcard for the project will infer the project from + /// the account. The `account` value can be the `email` address or the + /// `unique_id` of the service account. + /// + /// Sets the *name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn name(mut self, new_value: &str) -> ProjectServiceAccountSignJwtCall<'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) -> ProjectServiceAccountSignJwtCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountSignJwtCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectServiceAccountSignJwtCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Gets a ServiceAccount. /// /// A builder for the *serviceAccounts.get* method supported by a *project* resource. @@ -4570,7 +5171,7 @@ impl<'a, C, A> ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectServiceAccountGetCall<'a, C, A> @@ -4744,3 +5349,4 @@ impl<'a, C, A> ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Identity Toolkit (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/identitytoolkit3-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-identitytoolkit3] path = "../identitytoolkit3" -version = "1.0.4+20161206" +version = "1.0.4+20170425" diff --git a/gen/identitytoolkit3-cli/README.md b/gen/identitytoolkit3-cli/README.md index 33a755277c..7b7966fa31 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 *20161206*. The CLI is at version *1.0.4*. +This documentation was generated from the *Identity Toolkit* API at revision *20170425*. The CLI is at version *1.0.4*. ```bash identitytoolkit3 [options] diff --git a/gen/identitytoolkit3-cli/mkdocs.yml b/gen/identitytoolkit3-cli/mkdocs.yml index 7551cb1d91..c614390c8f 100644 --- a/gen/identitytoolkit3-cli/mkdocs.yml +++ b/gen/identitytoolkit3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Identity Toolkit v1.0.4+20161206 +site_name: Identity Toolkit v1.0.4+20170425 site_url: http://byron.github.io/google-apis-rs/google-identitytoolkit3-cli site_description: A complete library to interact with Identity Toolkit (protocol v3) diff --git a/gen/identitytoolkit3-cli/src/main.rs b/gen/identitytoolkit3-cli/src/main.rs index 532476da77..c8d1f21df7 100644 --- a/gen/identitytoolkit3-cli/src/main.rs +++ b/gen/identitytoolkit3-cli/src/main.rs @@ -430,16 +430,23 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "can-handle-code-in-app" => Some(("canHandleCodeInApp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "request-type" => Some(("requestType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "i-os-bundle-id" => Some(("iOSBundleId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "android-minimum-version" => Some(("androidMinimumVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "new-email" => Some(("newEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "android-package-name" => Some(("androidPackageName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id-token" => Some(("idToken", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "challenge" => Some(("challenge", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "new-email" => Some(("newEmail", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "user-ip" => Some(("userIp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "i-os-app-store-id" => Some(("iOSAppStoreId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-type" => Some(("requestType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "android-install-app" => Some(("androidInstallApp", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "user-ip" => Some(("userIp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "continue-url" => Some(("continueUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "captcha-resp" => Some(("captchaResp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["captcha-resp", "challenge", "email", "id-token", "kind", "new-email", "request-type", "user-ip"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["android-install-app", "android-minimum-version", "android-package-name", "can-handle-code-in-app", "captcha-resp", "challenge", "continue-url", "email", "i-os-app-store-id", "i-os-bundle-id", "id-token", "kind", "new-email", "request-type", "user-ip"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1079,6 +1086,7 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { "display-name" => Some(("displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "local-id" => Some(("localId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "photo-url" => Some(("photoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "instance-id" => Some(("instanceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "email-verified" => Some(("emailVerified", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), @@ -1089,7 +1097,7 @@ impl<'n> Engine<'n> { "password" => Some(("password", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["captcha-challenge", "captcha-response", "disabled", "display-name", "email", "email-verified", "id-token", "instance-id", "password", "photo-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["captcha-challenge", "captcha-response", "disabled", "display-name", "email", "email-verified", "id-token", "instance-id", "local-id", "password", "photo-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1273,10 +1281,11 @@ impl<'n> Engine<'n> { "session-id" => Some(("sessionId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "request-uri" => Some(("requestUri", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "return-secure-token" => Some(("returnSecureToken", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "auto-create" => Some(("autoCreate", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "return-refresh-token" => Some(("returnRefreshToken", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "return-idp-credential" => Some(("returnIdpCredential", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["delegated-project-number", "id-token", "instance-id", "pending-id-token", "post-body", "request-uri", "return-idp-credential", "return-refresh-token", "return-secure-token", "session-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["auto-create", "delegated-project-number", "id-token", "instance-id", "pending-id-token", "post-body", "request-uri", "return-idp-credential", "return-refresh-token", "return-secure-token", "session-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -2026,7 +2035,7 @@ fn main() { let mut app = App::new("identitytoolkit3") .author("Sebastian Thiel ") - .version("1.0.4+20161206") + .version("1.0.4+20170425") .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 e46bc95494..78e7ec1f9d 100644 --- a/gen/identitytoolkit3/Cargo.toml +++ b/gen/identitytoolkit3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-identitytoolkit3" -version = "1.0.4+20161206" +version = "1.0.4+20170425" 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.4+20161206" +documentation = "https://docs.rs/google-identitytoolkit3/1.0.4+20170425" license = "MIT" keywords = ["identitytoolkit", "google", "protocol", "web", "api"] diff --git a/gen/identitytoolkit3/README.md b/gen/identitytoolkit3/README.md index fefd8ebf78..e6b1d1b4a7 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.4+20161206*, where *20161206* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Identity Toolkit* crate version *1.0.4+20170425*, where *20170425* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161206/google_identitytoolkit3/struct.IdentityToolkit.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.IdentityToolkit.html) ... -* [relyingparty](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.Relyingparty.html) - * [*create auth uri*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyCreateAuthUriCall.html), [*delete account*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyDeleteAccountCall.html), [*download account*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyDownloadAccountCall.html), [*get account info*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyGetAccountInfoCall.html), [*get oob confirmation code*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyGetOobConfirmationCodeCall.html), [*get project config*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyGetProjectConfigCall.html), [*get public keys*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyGetPublicKeyCall.html), [*get recaptcha param*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyGetRecaptchaParamCall.html), [*reset password*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyResetPasswordCall.html), [*set account info*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartySetAccountInfoCall.html), [*set project config*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartySetProjectConfigCall.html), [*sign out user*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartySignOutUserCall.html), [*signup new user*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartySignupNewUserCall.html), [*upload account*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyUploadAccountCall.html), [*verify assertion*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyVerifyAssertionCall.html), [*verify custom token*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyVerifyCustomTokenCall.html) and [*verify password*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/struct.RelyingpartyVerifyPasswordCall.html) +* [relyingparty](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.Relyingparty.html) + * [*create auth uri*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyCreateAuthUriCall.html), [*delete account*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyDeleteAccountCall.html), [*download account*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyDownloadAccountCall.html), [*get account info*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyGetAccountInfoCall.html), [*get oob confirmation code*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyGetOobConfirmationCodeCall.html), [*get project config*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyGetProjectConfigCall.html), [*get public keys*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyGetPublicKeyCall.html), [*get recaptcha param*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyGetRecaptchaParamCall.html), [*reset password*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyResetPasswordCall.html), [*set account info*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartySetAccountInfoCall.html), [*set project config*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartySetProjectConfigCall.html), [*sign out user*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartySignOutUserCall.html), [*signup new user*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartySignupNewUserCall.html), [*upload account*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyUploadAccountCall.html), [*verify assertion*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyVerifyAssertionCall.html), [*verify custom token*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyVerifyCustomTokenCall.html) and [*verify password*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/struct.RelyingpartyVerifyPasswordCall.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.4+20161206/google_identitytoolkit3/struct.IdentityToolkit.html)** +* **[Hub](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/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.4+20161206/google_identitytoolkit3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/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.4+20161206/google_identitytoolkit3/trait.Part.html)** + * **[Parts](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/google_identitytoolkit3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -121,17 +121,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/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.4+20170425/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.4+20161206/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.4+20170425/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.4+20161206/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.4+20170425/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.4+20161206/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.4+20170425/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")`. @@ -141,29 +141,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/google_identitytoolkit3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/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.4+20170425/google_identitytoolkit3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/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.4+20161206/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.4+20170425/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.4+20161206/google_identitytoolkit3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-identitytoolkit3/1.0.4+20161206/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.4+20170425/google_identitytoolkit3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/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.4+20161206/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.4+20170425/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.4+20161206/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.4+20170425/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.4+20161206/google_identitytoolkit3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-identitytoolkit3/1.0.4+20170425/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 0e8b947b5b..eb758a2a74 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.4+20161206*, where *20161206* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Identity Toolkit* crate version *1.0.4+20170425*, where *20170425* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Identity Toolkit* *v3* API can be found at the //! [official documentation site](https://developers.google.com/identity-toolkit/v3/). @@ -176,7 +176,7 @@ // 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 +// 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)] @@ -311,8 +311,6 @@ pub struct IdentityToolkit { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for IdentityToolkit {} @@ -325,8 +323,6 @@ impl<'a, C, A> IdentityToolkit client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/identitytoolkit/v3/relyingparty/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -343,26 +339,6 @@ impl<'a, C, A> IdentityToolkit self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/identitytoolkit/v3/relyingparty/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -505,7 +481,7 @@ pub struct IdentitytoolkitRelyingpartyGetAccountInfoRequest { impl RequestValue for IdentitytoolkitRelyingpartyGetAccountInfoRequest {} -/// Respone of downloading accounts in batch. +/// Response of downloading accounts in batch. /// /// # Activities /// @@ -806,6 +782,9 @@ pub struct IdentitytoolkitRelyingpartySignupNewUserRequest { /// The name of the user. #[serde(rename="displayName")] pub display_name: Option, + /// Privileged caller can create user with specified user id. + #[serde(rename="localId")] + pub local_id: Option, /// The photo url of the user. #[serde(rename="photoUrl")] pub photo_url: Option, @@ -974,15 +953,18 @@ pub struct SetAccountInfoResponse { /// The photo url of the user. #[serde(rename="photoUrl")] pub photo_url: Option, - /// The Gitkit id token to login the newly sign up user. - #[serde(rename="idToken")] - pub id_token: Option, + /// If email has been verified. + #[serde(rename="emailVerified")] + pub email_verified: Option, /// The user's hashed password. #[serde(rename="passwordHash")] pub password_hash: Option, /// The new email the user attempts to change to. #[serde(rename="newEmail")] pub new_email: Option, + /// The Gitkit id token to login the newly sign up 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, @@ -1031,6 +1013,9 @@ pub struct IdentitytoolkitRelyingpartyVerifyAssertionRequest { /// 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, @@ -1053,16 +1038,37 @@ impl RequestValue for IdentitytoolkitRelyingpartyVerifyAssertionRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Relyingparty { + /// whether or not the app can handle the oob code without first going to web + #[serde(rename="canHandleCodeInApp")] + pub can_handle_code_in_app: Option, /// The fixed string "identitytoolkit#relyingparty". pub kind: Option, - /// The request type. - #[serde(rename="requestType")] - pub request_type: Option, + /// the iOS bundle id of iOS app to handle the action code + #[serde(rename="iOSBundleId")] + pub i_os_bundle_id: Option, + /// minimum version of the app. if the version on the device is lower than this version then the user is taken to the play store to upgrade the app + #[serde(rename="androidMinimumVersion")] + pub android_minimum_version: Option, + /// whether or not to install the android app on the device where the link is opened + #[serde(rename="androidInstallApp")] + pub android_install_app: Option, + /// android package name of the android app to handle the action code + #[serde(rename="androidPackageName")] + pub android_package_name: Option, /// The user's Gitkit login token for email change. #[serde(rename="idToken")] pub id_token: Option, /// The recaptcha challenge presented to the user. pub challenge: Option, + /// iOS app store id to download the app if it's not already installed + #[serde(rename="iOSAppStoreId")] + pub i_os_app_store_id: Option, + /// The url to continue to the Gitkit app + #[serde(rename="continueUrl")] + pub continue_url: Option, + /// The request type. + #[serde(rename="requestType")] + pub request_type: Option, /// The new email if the code is for email change. #[serde(rename="newEmail")] pub new_email: Option, @@ -1241,15 +1247,18 @@ pub struct UserInfoProviderUserInfo { /// User's identifier at IDP. #[serde(rename="federatedId")] pub federated_id: 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, /// 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, + /// 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, @@ -1333,6 +1342,9 @@ pub struct VerifyAssertionResponse { /// The URI of the public accessible profiel picture. #[serde(rename="photoUrl")] pub photo_url: Option, + /// True if it's a new user sign-in, false if it's a returning user. + #[serde(rename="isNewUser")] + pub is_new_user: Option, /// It's the identifier param in the createAuthUri request if the identifier is an email. It can be used to check whether the user input email is different from the asserted email. #[serde(rename="inputEmail")] pub input_email: Option, @@ -1587,6 +1599,9 @@ pub struct UserInfo { pub email_verified: Option, /// Version of the user's password. pub version: 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>, @@ -2081,7 +2096,7 @@ impl<'a, C, A> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "getOobConfirmationCode"; + let mut url = "https://www.googleapis.com/identitytoolkit/v3/relyingparty/getOobConfirmationCode".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2314,7 +2329,7 @@ impl<'a, C, A> RelyingpartySignupNewUserCall<'a, C, A> where C: BorrowMut RelyingpartyCreateAuthUriCall<'a, C, A> where C: BorrowMut RelyingpartySignOutUserCall<'a, C, A> where C: BorrowMut RelyingpartyVerifyAssertionCall<'a, C, A> where C: BorrowMut RelyingpartyUploadAccountCall<'a, C, A> where C: BorrowMut RelyingpartyGetAccountInfoCall<'a, C, A> where C: BorrowMut RelyingpartyVerifyCustomTokenCall<'a, C, A> where C: BorrowMut RelyingpartyResetPasswordCall<'a, C, A> where C: BorrowMut RelyingpartyDownloadAccountCall<'a, C, A> where C: BorrowMut RelyingpartySetAccountInfoCall<'a, C, A> where C: BorrowMut RelyingpartyDeleteAccountCall<'a, C, A> where C: BorrowMut RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut RelyingpartyVerifyPasswordCall<'a, C, A> where C: BorrowMut RelyingpartySetProjectConfigCall<'a, C, A> where C: BorrowMut RelyingpartyGetProjectConfigCall<'a, C, A> where C: BorrowMut RelyingpartyGetProjectConfigCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with kgsearch (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/kgsearch1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-kgsearch1] path = "../kgsearch1" -version = "1.0.4+20151215" +version = "1.0.4+20170109" diff --git a/gen/kgsearch1-cli/README.md b/gen/kgsearch1-cli/README.md index 6dd504b2a2..ce9a067495 100644 --- a/gen/kgsearch1-cli/README.md +++ b/gen/kgsearch1-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 *kgsearch* API at revision *20151215*. The CLI is at version *1.0.4*. +This documentation was generated from the *kgsearch* API at revision *20170109*. The CLI is at version *1.0.4*. ```bash kgsearch1 [options] diff --git a/gen/kgsearch1-cli/mkdocs.yml b/gen/kgsearch1-cli/mkdocs.yml index d767c43ad4..3cb93e2fe7 100644 --- a/gen/kgsearch1-cli/mkdocs.yml +++ b/gen/kgsearch1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: kgsearch v1.0.4+20151215 +site_name: kgsearch v1.0.4+20170109 site_url: http://byron.github.io/google-apis-rs/google-kgsearch1-cli site_description: A complete library to interact with kgsearch (protocol v1) diff --git a/gen/kgsearch1-cli/src/main.rs b/gen/kgsearch1-cli/src/main.rs index e6861b4564..ab43ec4dd7 100644 --- a/gen/kgsearch1-cli/src/main.rs +++ b/gen/kgsearch1-cli/src/main.rs @@ -221,7 +221,9 @@ fn main() { let arg_data = [ ("entities", "methods: 'search'", vec![ ("search", - Some(r##"Searches Knowledge Graph for entities that match the constraints. A list of matched entities will be returned in response, which will be in JSON-LD format and compatible with http://schema.org"##), + Some(r##"Searches Knowledge Graph for entities that match the constraints. + A list of matched entities will be returned in response, which will be in + JSON-LD format and compatible with http://schema.org"##), "Details at http://byron.github.io/google-apis-rs/google_kgsearch1_cli/entities_search", vec![ (Some(r##"v"##), @@ -242,8 +244,8 @@ fn main() { let mut app = App::new("kgsearch1") .author("Sebastian Thiel ") - .version("1.0.4+20151215") - .about("Knowledge Graph Search API allows developers to search the Google Knowledge Graph for entities.") + .version("1.0.4+20170109") + .about("Searches the Google Knowledge Graph for entities.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_kgsearch1_cli") .arg(Arg::with_name("folder") .long("config-dir") diff --git a/gen/kgsearch1/Cargo.toml b/gen/kgsearch1/Cargo.toml index dbbb602bbd..b4ae8338d2 100644 --- a/gen/kgsearch1/Cargo.toml +++ b/gen/kgsearch1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-kgsearch1" -version = "1.0.4+20151215" +version = "1.0.4+20170109" authors = ["Sebastian Thiel "] description = "A complete library to interact with kgsearch (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/kgsearch1" homepage = "https://developers.google.com/knowledge-graph/" -documentation = "https://docs.rs/google-kgsearch1/1.0.4+20151215" +documentation = "https://docs.rs/google-kgsearch1/1.0.4+20170109" license = "MIT" keywords = ["kgsearch", "google", "protocol", "web", "api"] diff --git a/gen/kgsearch1/README.md b/gen/kgsearch1/README.md index 052de2a863..aa66cf4b12 100644 --- a/gen/kgsearch1/README.md +++ b/gen/kgsearch1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-kgsearch1` library allows access to all features of the *Google kgsearch* service. -This documentation was generated from *kgsearch* crate version *1.0.4+20151215*, where *20151215* is the exact revision of the *kgsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *kgsearch* crate version *1.0.4+20170109*, where *20170109* is the exact revision of the *kgsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *kgsearch* *v1* API can be found at the [official documentation site](https://developers.google.com/knowledge-graph/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-kgsearch1/1.0.4+20151215/google_kgsearch1/struct.Kgsearch.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/struct.Kgsearch.html) ... * entities - * [*search*](https://docs.rs/google-kgsearch1/1.0.4+20151215/google_kgsearch1/struct.EntitySearchCall.html) + * [*search*](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/struct.EntitySearchCall.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-kgsearch1/1.0.4+20151215/google_kgsearch1/struct.Kgsearch.html)** +* **[Hub](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/struct.Kgsearch.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.Part.html)** + * **[Parts](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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-kgsearch1/1.0.4+20151215/google_kgsearch1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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-kgsearch1/1.0.4+20151215/google_kgsearch1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-kgsearch1/1.0.4+20151215/google_kgsearch1/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-kgsearch1/1.0.4+20170109/google_kgsearch1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-kgsearch1/1.0.4+20151215/google_kgsearch1/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-kgsearch1/1.0.4+20170109/google_kgsearch1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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-kgsearch1/1.0.4+20151215/google_kgsearch1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-kgsearch1/1.0.4+20170109/google_kgsearch1/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/kgsearch1/src/lib.rs b/gen/kgsearch1/src/lib.rs index ca601ced8e..31f90e2d30 100644 --- a/gen/kgsearch1/src/lib.rs +++ b/gen/kgsearch1/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 *kgsearch* crate version *1.0.4+20151215*, where *20151215* is the exact revision of the *kgsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *kgsearch* crate version *1.0.4+20170109*, where *20170109* is the exact revision of the *kgsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *kgsearch* *v1* API can be found at the //! [official documentation site](https://developers.google.com/knowledge-graph/). @@ -177,7 +177,7 @@ // 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 +// 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)] @@ -287,8 +287,6 @@ pub struct Kgsearch { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Kgsearch {} @@ -301,8 +299,6 @@ impl<'a, C, A> Kgsearch client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://kgsearch.googleapis.com/".to_string(), - _root_url: "https://kgsearch.googleapis.com/".to_string(), } } @@ -319,33 +315,14 @@ impl<'a, C, A> Kgsearch self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://kgsearch.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://kgsearch.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// Response message includes the context and a list of matching results which contain the detail of associated entities. +/// Response message includes the context and a list of matching results +/// which contain the detail of associated entities. /// /// # Activities /// @@ -356,14 +333,14 @@ impl<'a, C, A> Kgsearch /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SearchResponse { - /// The schema type of top-level JSON-LD object, e.g. ItemList. - #[serde(rename="type")] - pub type_: Option, + /// The local context applicable for the response. See more details at + /// http://www.w3.org/TR/json-ld/#context-definitions. + pub @context: Option, /// The item list of search results. #[serde(rename="itemListElement")] pub item_list_element: Option>, - /// The local context applicable for the response. See more details at http://www.w3.org/TR/json-ld/#context-definitions. - pub context: Option, + /// The schema type of top-level JSON-LD object, e.g. ItemList. + pub @type: Option, } impl ResponseResult for SearchResponse {} @@ -414,7 +391,9 @@ impl<'a, C, A> EntityMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Searches Knowledge Graph for entities that match the constraints. A list of matched entities will be returned in response, which will be in JSON-LD format and compatible with http://schema.org + /// Searches Knowledge Graph for entities that match the constraints. + /// A list of matched entities will be returned in response, which will be in + /// JSON-LD format and compatible with http://schema.org pub fn search(&self) -> EntitySearchCall<'a, C, A> { EntitySearchCall { hub: self.hub, @@ -439,7 +418,9 @@ impl<'a, C, A> EntityMethods<'a, C, A> { // CallBuilders ### // ################# -/// Searches Knowledge Graph for entities that match the constraints. A list of matched entities will be returned in response, which will be in JSON-LD format and compatible with http://schema.org +/// Searches Knowledge Graph for entities that match the constraints. +/// A list of matched entities will be returned in response, which will be in +/// JSON-LD format and compatible with http://schema.org /// /// A builder for the *search* method supported by a *entity* resource. /// It is not used directly, but through a `EntityMethods` instance. @@ -547,7 +528,7 @@ impl<'a, C, A> EntitySearchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/entities:search"; + let mut url = "https://kgsearch.googleapis.com/v1/entities:search".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -624,7 +605,9 @@ impl<'a, C, A> EntitySearchCall<'a, C, A> where C: BorrowMut, A: } - /// Restricts returned entities with these types, e.g. Person (as defined in http://schema.org/Person). + /// Restricts returned entities with these types, e.g. Person + /// (as defined in http://schema.org/Person). If multiple types are specified, + /// returned entities will contain one or more of these 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. @@ -653,7 +636,8 @@ impl<'a, C, A> EntitySearchCall<'a, C, A> where C: BorrowMut, A: self._limit = Some(new_value); self } - /// The list of language codes (defined in ISO 693) to run the query with, e.g. 'en'. + /// The list of language codes (defined in ISO 693) to run the query with, + /// e.g. 'en'. /// /// Append the given value to the *languages* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -669,6 +653,8 @@ impl<'a, C, A> EntitySearchCall<'a, C, A> where C: BorrowMut, A: self } /// The list of entity id to be used for search instead of query string. + /// To specify multiple ids in the HTTP request, repeat the parameter in the + /// URL as in ...?ids=A&ids=B /// /// 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. @@ -701,12 +687,12 @@ impl<'a, C, A> EntitySearchCall<'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) -> EntitySearchCall<'a, C, A> @@ -718,3 +704,4 @@ impl<'a, C, A> EntitySearchCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/licensing1-cli/Cargo.toml b/gen/licensing1-cli/Cargo.toml index 51ed084225..f513274530 100644 --- a/gen/licensing1-cli/Cargo.toml +++ b/gen/licensing1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-licensing1-cli" -version = "1.0.4+20150901" +version = "1.0.4+20170213" authors = ["Sebastian Thiel "] description = "A complete library to interact with licensing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-licensing1] path = "../licensing1" -version = "1.0.4+20150901" +version = "1.0.4+20170213" diff --git a/gen/licensing1-cli/README.md b/gen/licensing1-cli/README.md index cf3a32a836..264c213264 100644 --- a/gen/licensing1-cli/README.md +++ b/gen/licensing1-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 *licensing* API at revision *20150901*. The CLI is at version *1.0.4*. +This documentation was generated from the *licensing* API at revision *20170213*. The CLI is at version *1.0.4*. ```bash licensing1 [options] diff --git a/gen/licensing1-cli/mkdocs.yml b/gen/licensing1-cli/mkdocs.yml index 6e07f92737..ac30a9f02d 100644 --- a/gen/licensing1-cli/mkdocs.yml +++ b/gen/licensing1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: licensing v1.0.4+20150901 +site_name: licensing v1.0.4+20170213 site_url: http://byron.github.io/google-apis-rs/google-licensing1-cli site_description: A complete library to interact with licensing (protocol v1) diff --git a/gen/licensing1-cli/src/main.rs b/gen/licensing1-cli/src/main.rs index 296ebbf2b3..c00bd3a304 100644 --- a/gen/licensing1-cli/src/main.rs +++ b/gen/licensing1-cli/src/main.rs @@ -371,11 +371,13 @@ impl<'n> Engine<'n> { "sku-id" => Some(("skuId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product-name" => Some(("productName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sku-name" => Some(("skuName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etags" => Some(("etags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", 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!["etags", "kind", "product-id", "self-link", "sku-id", "user-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "kind", "product-id", "product-name", "self-link", "sku-id", "sku-name", "user-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -461,11 +463,13 @@ impl<'n> Engine<'n> { "sku-id" => Some(("skuId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "user-id" => Some(("userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "product-name" => Some(("productName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "sku-name" => Some(("skuName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etags" => Some(("etags", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", 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!["etags", "kind", "product-id", "self-link", "sku-id", "user-id"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["etags", "kind", "product-id", "product-name", "self-link", "sku-id", "sku-name", "user-id"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -886,8 +890,8 @@ fn main() { let mut app = App::new("licensing1") .author("Sebastian Thiel ") - .version("1.0.4+20150901") - .about("Licensing API to view and manage license for your domain.") + .version("1.0.4+20170213") + .about("Views and manages licenses for your domain.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_licensing1_cli") .arg(Arg::with_name("url") .long("scope") diff --git a/gen/licensing1/Cargo.toml b/gen/licensing1/Cargo.toml index efc8f75030..52438c08a3 100644 --- a/gen/licensing1/Cargo.toml +++ b/gen/licensing1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-licensing1" -version = "1.0.4+20150901" +version = "1.0.4+20170213" authors = ["Sebastian Thiel "] description = "A complete library to interact with licensing (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/licensing1" homepage = "https://developers.google.com/google-apps/licensing/" -documentation = "https://docs.rs/google-licensing1/1.0.4+20150901" +documentation = "https://docs.rs/google-licensing1/1.0.4+20170213" license = "MIT" keywords = ["licensing", "google", "protocol", "web", "api"] diff --git a/gen/licensing1/README.md b/gen/licensing1/README.md index 928d2fa9cd..314ee4c498 100644 --- a/gen/licensing1/README.md +++ b/gen/licensing1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-licensing1` library allows access to all features of the *Google licensing* service. -This documentation was generated from *licensing* crate version *1.0.4+20150901*, where *20150901* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *licensing* crate version *1.0.4+20170213*, where *20170213* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *licensing* *v1* API can be found at the [official documentation site](https://developers.google.com/google-apps/licensing/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/struct.Licensing.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/struct.Licensing.html) ... -* [license assignments](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/struct.LicenseAssignment.html) - * [*delete*](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/struct.LicenseAssignmentDeleteCall.html), [*get*](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/struct.LicenseAssignmentGetCall.html), [*insert*](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/struct.LicenseAssignmentInsertCall.html), [*list for product*](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/struct.LicenseAssignmentListForProductCall.html), [*list for product and sku*](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/struct.LicenseAssignmentListForProductAndSkuCall.html), [*patch*](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/struct.LicenseAssignmentPatchCall.html) and [*update*](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/struct.LicenseAssignmentUpdateCall.html) +* [license assignments](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/struct.LicenseAssignment.html) + * [*delete*](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/struct.LicenseAssignmentDeleteCall.html), [*get*](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/struct.LicenseAssignmentGetCall.html), [*insert*](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/struct.LicenseAssignmentInsertCall.html), [*list for product*](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/struct.LicenseAssignmentListForProductCall.html), [*list for product and sku*](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/struct.LicenseAssignmentListForProductAndSkuCall.html), [*patch*](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/struct.LicenseAssignmentPatchCall.html) and [*update*](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/struct.LicenseAssignmentUpdateCall.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-licensing1/1.0.4+20150901/google_licensing1/struct.Licensing.html)** +* **[Hub](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/struct.Licensing.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/trait.Part.html)** + * **[Parts](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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-licensing1/1.0.4+20150901/google_licensing1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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-licensing1/1.0.4+20150901/google_licensing1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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-licensing1/1.0.4+20150901/google_licensing1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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-licensing1/1.0.4+20150901/google_licensing1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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-licensing1/1.0.4+20150901/google_licensing1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/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-licensing1/1.0.4+20170213/google_licensing1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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-licensing1/1.0.4+20150901/google_licensing1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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-licensing1/1.0.4+20150901/google_licensing1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-licensing1/1.0.4+20150901/google_licensing1/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-licensing1/1.0.4+20170213/google_licensing1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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-licensing1/1.0.4+20150901/google_licensing1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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-licensing1/1.0.4+20150901/google_licensing1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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-licensing1/1.0.4+20150901/google_licensing1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-licensing1/1.0.4+20170213/google_licensing1/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/licensing1/src/lib.rs b/gen/licensing1/src/lib.rs index 1303ce168a..8f39fc54ce 100644 --- a/gen/licensing1/src/lib.rs +++ b/gen/licensing1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *licensing* crate version *1.0.4+20150901*, where *20150901* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *licensing* crate version *1.0.4+20170213*, where *20170213* is the exact revision of the *licensing:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *licensing* *v1* API can be found at the //! [official documentation site](https://developers.google.com/google-apps/licensing/). @@ -178,7 +178,7 @@ // 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 +// 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)] @@ -223,7 +223,7 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { - /// View and manage Google Apps licenses for your domain + /// View and manage G Suite licenses for your domain AppLicensing, } @@ -305,8 +305,6 @@ pub struct Licensing { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Licensing {} @@ -319,8 +317,6 @@ impl<'a, C, A> Licensing client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/apps/licensing/v1/product/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -337,26 +333,6 @@ impl<'a, C, A> Licensing self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/apps/licensing/v1/product/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -380,20 +356,26 @@ impl<'a, C, A> Licensing /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LicenseAssignment { - /// Name of the sku of the product. + /// Id of the sku of the product. #[serde(rename="skuId")] pub sku_id: Option, /// Identifies the resource as a LicenseAssignment. pub kind: Option, - /// ETag of the resource. - pub etags: Option, /// Email id of the user. #[serde(rename="userId")] pub user_id: Option, + /// Display Name of the product. + #[serde(rename="productName")] + pub product_name: Option, + /// Display Name of the sku of the product. + #[serde(rename="skuName")] + pub sku_name: Option, + /// ETag of the resource. + pub etags: Option, /// Link to this page. #[serde(rename="selfLink")] pub self_link: Option, - /// Name of the product. + /// Id of the product. #[serde(rename="productId")] pub product_id: Option, } @@ -726,7 +708,7 @@ impl<'a, C, A> LicenseAssignmentDeleteCall<'a, C, A> where C: BorrowMut LicenseAssignmentListForProductCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{productId}/users"; + let mut url = "https://www.googleapis.com/apps/licensing/v1/product/{productId}/users".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppLicensing.as_ref().to_string(), ()); } @@ -1246,7 +1228,7 @@ impl<'a, C, A> LicenseAssignmentGetCall<'a, C, A> where C: BorrowMut LicenseAssignmentListForProductAndSkuCall<'a, C, A> where C: Borr params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{productId}/sku/{skuId}/users"; + let mut url = "https://www.googleapis.com/apps/licensing/v1/product/{productId}/sku/{skuId}/users".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppLicensing.as_ref().to_string(), ()); } @@ -1795,7 +1777,7 @@ impl<'a, C, A> LicenseAssignmentUpdateCall<'a, C, A> where C: BorrowMut LicenseAssignmentPatchCall<'a, C, A> where C: BorrowMut LicenseAssignmentInsertCall<'a, C, A> where C: BorrowMut LicenseAssignmentInsertCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Logging (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging2-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-logging2] path = "../logging2" -version = "1.0.4+20161206" +version = "1.0.4+20170516" diff --git a/gen/logging2-cli/README.md b/gen/logging2-cli/README.md index c2e4dd6eb2..e07c7cbc31 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 *20161206*. The CLI is at version *1.0.4*. +This documentation was generated from the *Logging* API at revision *20170516*. The CLI is at version *1.0.4*. ```bash logging2 [options] diff --git a/gen/logging2-cli/mkdocs.yml b/gen/logging2-cli/mkdocs.yml index d93b6222c6..dfcc98d2b8 100644 --- a/gen/logging2-cli/mkdocs.yml +++ b/gen/logging2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Logging v1.0.4+20161206 +site_name: Logging v1.0.4+20170516 site_url: http://byron.github.io/google-apis-rs/google-logging2-cli site_description: A complete library to interact with Logging (protocol v2) diff --git a/gen/logging2-cli/src/main.rs b/gen/logging2-cli/src/main.rs index 09005e3a4e..7f0a5e9b3d 100644 --- a/gen/logging2-cli/src/main.rs +++ b/gen/logging2-cli/src/main.rs @@ -187,8 +187,9 @@ impl<'n> Engine<'n> { "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", "name", "output-version-format", "start-time", "writer-identity"]); + 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 } @@ -445,8 +446,9 @@ impl<'n> Engine<'n> { "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", "name", "output-version-format", "start-time", "writer-identity"]); + 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 } @@ -830,8 +832,9 @@ impl<'n> Engine<'n> { "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", "name", "output-version-format", "start-time", "writer-identity"]); + 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 } @@ -1088,8 +1091,9 @@ impl<'n> Engine<'n> { "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", "name", "output-version-format", "start-time", "writer-identity"]); + 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 } @@ -1353,8 +1357,9 @@ impl<'n> Engine<'n> { "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", "name", "output-version-format", "start-time", "writer-identity"]); + 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 } @@ -1611,8 +1616,9 @@ impl<'n> Engine<'n> { "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", "name", "output-version-format", "start-time", "writer-identity"]); + 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 } @@ -1812,8 +1818,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "filter", "name", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -2063,8 +2069,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "filter", "name", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -2156,8 +2162,9 @@ impl<'n> Engine<'n> { "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", "name", "output-version-format", "start-time", "writer-identity"]); + 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 } @@ -2414,8 +2421,9 @@ impl<'n> Engine<'n> { "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", "name", "output-version-format", "start-time", "writer-identity"]); + 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 } @@ -2728,7 +2736,7 @@ fn main() { let arg_data = [ ("billing-accounts", "methods: 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list' and 'sinks-update'", vec![ ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries."##), + Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/billing-accounts_logs-delete", vec![ (Some(r##"log-name"##), @@ -2736,6 +2744,8 @@ fn main() { 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)), @@ -2753,7 +2763,7 @@ fn main() { Some(false)), ]), ("logs-list", - Some(r##"Lists the logs in projects or organizations. Only logs that have entries are listed."##), + 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/billing-accounts_logs-list", vec![ (Some(r##"parent"##), @@ -2761,6 +2771,8 @@ fn main() { 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)), @@ -2786,6 +2798,8 @@ fn main() { 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)), @@ -2817,7 +2831,9 @@ fn main() { 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]" - It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist."##), + "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)), @@ -2839,9 +2855,11 @@ fn main() { vec![ (Some(r##"sink-name"##), None, - Some(r##"Required. The parent resource name of the sink: + 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)), @@ -2864,7 +2882,12 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789"."##), + 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)), @@ -2889,6 +2912,8 @@ fn main() { 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)), @@ -2937,7 +2962,7 @@ fn main() { Some(false)), ]), ("write", - Some(r##"Writes log entries to Stackdriver Logging. All log entries are written by this method."##), + Some(r##"Writes log entries to Stackdriver Logging."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/entries_write", vec![ (Some(r##"kv"##), @@ -2962,7 +2987,7 @@ fn main() { ("folders", "methods: 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list' and 'sinks-update'", vec![ ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries."##), + Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/folders_logs-delete", vec![ (Some(r##"log-name"##), @@ -2970,6 +2995,8 @@ fn main() { 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)), @@ -2987,7 +3014,7 @@ fn main() { Some(false)), ]), ("logs-list", - Some(r##"Lists the logs in projects or organizations. Only logs that have entries are listed."##), + 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/folders_logs-list", vec![ (Some(r##"parent"##), @@ -2995,6 +3022,8 @@ fn main() { 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)), @@ -3020,6 +3049,8 @@ fn main() { 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)), @@ -3051,7 +3082,9 @@ fn main() { 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]" - It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist."##), + "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)), @@ -3073,9 +3106,11 @@ fn main() { vec![ (Some(r##"sink-name"##), None, - Some(r##"Required. The parent resource name of the sink: + 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)), @@ -3098,7 +3133,12 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789"."##), + 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)), @@ -3123,6 +3163,8 @@ fn main() { 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)), @@ -3168,7 +3210,7 @@ fn main() { ("organizations", "methods: 'logs-delete', 'logs-list', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list' and 'sinks-update'", vec![ ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries."##), + Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/organizations_logs-delete", vec![ (Some(r##"log-name"##), @@ -3176,6 +3218,8 @@ fn main() { 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)), @@ -3193,7 +3237,7 @@ fn main() { Some(false)), ]), ("logs-list", - Some(r##"Lists the logs in projects or organizations. Only logs that have entries are listed."##), + 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/organizations_logs-list", vec![ (Some(r##"parent"##), @@ -3201,6 +3245,8 @@ fn main() { 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)), @@ -3226,6 +3272,8 @@ fn main() { 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)), @@ -3257,7 +3305,9 @@ fn main() { 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]" - It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist."##), + "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)), @@ -3279,9 +3329,11 @@ fn main() { vec![ (Some(r##"sink-name"##), None, - Some(r##"Required. The parent resource name of the sink: + 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)), @@ -3304,7 +3356,12 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789"."##), + 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)), @@ -3329,6 +3386,8 @@ fn main() { 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)), @@ -3355,7 +3414,7 @@ fn main() { ("projects", "methods: 'logs-delete', 'logs-list', 'metrics-create', 'metrics-delete', 'metrics-get', 'metrics-list', 'metrics-update', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list' and 'sinks-update'", vec![ ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries."##), + Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries. Log entries written shortly before the delete operation might not be deleted."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_cli/projects_logs-delete", vec![ (Some(r##"log-name"##), @@ -3363,6 +3422,8 @@ fn main() { 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)), @@ -3380,7 +3441,7 @@ fn main() { Some(false)), ]), ("logs-list", - Some(r##"Lists the logs in projects or organizations. Only logs that have entries are listed."##), + 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/projects_logs-list", vec![ (Some(r##"parent"##), @@ -3388,6 +3449,8 @@ fn main() { 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)), @@ -3545,6 +3608,8 @@ fn main() { 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)), @@ -3576,7 +3641,9 @@ fn main() { 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]" - It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist."##), + "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)), @@ -3598,9 +3665,11 @@ fn main() { vec![ (Some(r##"sink-name"##), None, - Some(r##"Required. The parent resource name of the sink: + 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)), @@ -3623,7 +3692,12 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789"."##), + 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)), @@ -3648,6 +3722,8 @@ fn main() { 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)), @@ -3676,7 +3752,7 @@ fn main() { let mut app = App::new("logging2") .author("Sebastian Thiel ") - .version("1.0.4+20161206") + .version("1.0.4+20170516") .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 c2eb8ef5cb..bcb253dd01 100644 --- a/gen/logging2/Cargo.toml +++ b/gen/logging2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-logging2" -version = "1.0.4+20161206" +version = "1.0.4+20170516" 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.4+20161206" +documentation = "https://docs.rs/google-logging2/1.0.4+20170516" license = "MIT" keywords = ["logging", "google", "protocol", "web", "api"] diff --git a/gen/logging2/README.md b/gen/logging2/README.md index e3c0340356..117be83d9e 100644 --- a/gen/logging2/README.md +++ b/gen/logging2/README.md @@ -5,26 +5,26 @@ DO NOT EDIT ! --> The `google-logging2` library allows access to all features of the *Google Logging* service. -This documentation was generated from *Logging* crate version *1.0.4+20161206*, where *20161206* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Logging* crate version *1.0.4+20170516*, where *20170516* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161206/google_logging2/struct.Logging.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.Logging.html) ... * billing accounts - * [*logs delete*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.BillingAccountLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.BillingAccountLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.BillingAccountSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.BillingAccountSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.BillingAccountSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.BillingAccountSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.BillingAccountSinkUpdateCall.html) + * [*logs delete*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.BillingAccountLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.BillingAccountLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.BillingAccountSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.BillingAccountSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.BillingAccountSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.BillingAccountSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.BillingAccountSinkUpdateCall.html) * entries - * [*list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.EntryWriteCall.html) + * [*list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.EntryWriteCall.html) * folders - * [*logs delete*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.FolderLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.FolderLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.FolderSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.FolderSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.FolderSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.FolderSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.FolderSinkUpdateCall.html) -* [monitored resource descriptors](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.MonitoredResourceDescriptor.html) - * [*list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.MonitoredResourceDescriptorListCall.html) + * [*logs delete*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.FolderLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.FolderLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.FolderSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.FolderSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.FolderSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.FolderSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.FolderSinkUpdateCall.html) +* [monitored resource descriptors](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.MonitoredResourceDescriptor.html) + * [*list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.MonitoredResourceDescriptorListCall.html) * organizations - * [*logs delete*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.OrganizationLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.OrganizationLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.OrganizationSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.OrganizationSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.OrganizationSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.OrganizationSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.OrganizationSinkUpdateCall.html) + * [*logs delete*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.OrganizationLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.OrganizationLogListCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.OrganizationSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.OrganizationSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.OrganizationSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.OrganizationSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.OrganizationSinkUpdateCall.html) * projects - * [*logs delete*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.ProjectSinkUpdateCall.html) + * [*logs delete*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/struct.ProjectSinkUpdateCall.html) @@ -33,17 +33,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/struct.Logging.html)** +* **[Hub](https://docs.rs/google-logging2/1.0.4+20170516/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.4+20161206/google_logging2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-logging2/1.0.4+20170516/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.4+20161206/google_logging2/trait.Part.html)** + * **[Parts](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-logging2/1.0.4+20161206/google_logging2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-logging2/1.0.4+20170516/google_logging2/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-logging2/1.0.4+20161206/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.4+20170516/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.4+20161206/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.4+20170516/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.4+20161206/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.4+20170516/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.4+20161206/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.4+20170516/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")`. @@ -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-logging2/1.0.4+20161206/google_logging2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-logging2/1.0.4+20161206/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.4+20170516/google_logging2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-logging2/1.0.4+20170516/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.4+20161206/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.4+20170516/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.4+20161206/google_logging2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-logging2/1.0.4+20161206/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.4+20170516/google_logging2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-logging2/1.0.4+20170516/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.4+20161206/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.4+20170516/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.4+20161206/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.4+20170516/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.4+20161206/google_logging2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-logging2/1.0.4+20170516/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 3f0e8ffff3..f0eb50a68e 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.4+20161206*, where *20161206* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Logging* crate version *1.0.4+20170516*, where *20170516* is the exact revision of the *logging:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Logging* *v2* API can be found at the //! [official documentation site](https://cloud.google.com/logging/docs/). @@ -198,7 +198,7 @@ // 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 +// 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)] @@ -243,15 +243,15 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { + /// Administrate log data for your projects + Admin, + /// View log data for your projects Read, /// Submit log data for your projects Write, - /// Administrate log data for your projects - Admin, - /// View and manage your data across Google Cloud Platform services CloudPlatform, @@ -262,9 +262,9 @@ pub enum Scope { impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { + Scope::Admin => "https://www.googleapis.com/auth/logging.admin", Scope::Read => "https://www.googleapis.com/auth/logging.read", Scope::Write => "https://www.googleapis.com/auth/logging.write", - Scope::Admin => "https://www.googleapis.com/auth/logging.admin", Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", } @@ -346,8 +346,6 @@ pub struct Logging { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Logging {} @@ -360,8 +358,6 @@ impl<'a, C, A> Logging client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://logging.googleapis.com/".to_string(), - _root_url: "https://logging.googleapis.com/".to_string(), } } @@ -393,26 +389,6 @@ impl<'a, C, A> Logging self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://logging.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://logging.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -513,9 +489,9 @@ impl ResponseResult for ListLogMetricsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MonitoredResource { - /// Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Cloud SQL databases use the labels "database_id" and "zone". + /// 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". pub labels: Option>, - /// Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Cloud SQL database is "cloudsql_database". + /// 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. #[serde(rename="type")] pub type_: Option, } @@ -542,7 +518,7 @@ pub struct LogEntryOperation { impl Part for LogEntryOperation {} -/// 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 or organization. +/// 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. /// /// # Activities /// @@ -564,30 +540,36 @@ impl Part for LogEntryOperation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LogSink { - /// Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. The filter must use the log entry format specified by the output_version_format parameter. For example, in the v2 format: - /// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR - /// - pub filter: Option, + /// Optional. The log entry format to use for this sink's exported log entries. The v2 format is used by default. The v1 format is deprecated and should be used only as part of a migration effort to v2. See Migration to the v2 API. + #[serde(rename="outputVersionFormat")] + pub output_version_format: Option, + /// 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: /// "storage.googleapis.com/[GCS_BUCKET]" /// "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" /// "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" /// The sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs With Sinks. pub destination: Option, - /// 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, + /// Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. The filter must use the log entry format specified by the output_version_format parameter. For example, in the v2 format: + /// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR + /// + pub filter: Option, /// Optional. The time at which this sink will begin exporting log entries. Log entries are exported only if their timestamp is not earlier than the start time. The default value of this field is the time the sink is created or updated. #[serde(rename="startTime")] pub start_time: Option, - /// Optional. The log entry format to use for this sink's exported log entries. The v2 format is used by default. The v1 format is deprecated and should be used only as part of a migration effort to v2. See Migration to the v2 API. - #[serde(rename="outputVersionFormat")] - pub output_version_format: Option, - /// 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, /// Optional. The time at which this sink will stop exporting log entries. Log entries are exported only if their timestamp is earlier than the end time. If this field is not supplied, there is no end time. If both a start time and an end time are provided, then the end time must be later than the start time. #[serde(rename="endTime")] pub end_time: Option, + /// 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, + /// 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: + /// logName:("projects/test-project1/" OR "projects/test-project2/") AND + /// resource.type=gce_instance + /// + #[serde(rename="includeChildren")] + pub include_children: Option, } impl RequestValue for LogSink {} @@ -605,19 +587,21 @@ impl ResponseResult for LogSink {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListLogEntriesRequest { - /// 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 LogEntry.insertId. + /// 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. #[serde(rename="orderBy")] pub order_by: Option, - /// Required. Names of one or more resources from which to retrieve log entries: + /// Required. Names of one or more parent resources from which to retrieve log entries: /// "projects/[PROJECT_ID]" /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" /// Projects listed in the project_ids field are added to this list. #[serde(rename="resourceNames")] pub resource_names: Option>, - /// 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. + /// 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. #[serde(rename="pageSize")] pub page_size: Option, - /// 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. + /// 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. #[serde(rename="pageToken")] pub page_token: Option, /// 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. @@ -782,10 +766,12 @@ pub struct WriteLogEntriesRequest { /// 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]" + /// "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" 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, the response status will be the error associated with one of the failed entries and include error details in the form of WriteLogEntriesPartialErrors. + /// 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. @@ -796,7 +782,7 @@ pub struct WriteLogEntriesRequest { /// "zone": "us-central1-a", "instance_id": "00000000000000000000" }} /// See LogEntry. pub resource: Option, - /// Required. The log entries to write. Values supplied for the fields log_name, resource, and labels in this entries.write request are added to those log entries that do not provide their own values for the fields.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should write multiple log entries at once rather than calling this method for each individual log entry. + /// Required. The log entries to write. Values supplied for the fields log_name, resource, and labels in this entries.write request are inserted into those log entries in this list that do not provide their own values.Stackdriver Logging also creates and inserts values for timestamp and insert_id if the entries do not provide them. The created insert_id for the N'th entry in this list will be greater than earlier entries and less than later entries. Otherwise, the order of log entries in this list does not matter.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should write multiple log entries at once rather than calling this method for each individual log entry. pub entries: Option>, } @@ -832,12 +818,14 @@ pub struct LogEntry { pub http_request: Option, /// Required. The monitored resource associated with this log entry. Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error. pub resource: Option, + /// Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT. + pub severity: Option, + /// Optional. Resource name of the trace associated with the log entry, if any. If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824 + pub trace: Option, /// The log entry payload, represented as a Unicode string (UTF-8). #[serde(rename="textPayload")] pub text_payload: Option, - /// Optional. 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. If omitted, Stackdriver Logging will use the time the log entry is received. + /// Optional. The time the event described by the log entry occurred. If omitted in a new log entry, Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the past are accepted. pub timestamp: Option, /// Optional. A set of user-defined (key, value) data that provides additional information about the log entry. pub labels: Option>, @@ -850,10 +838,15 @@ pub struct LogEntry { /// Required. The resource name of the log to which this log entry belongs: /// "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 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. A unique ID for the log entry. If you provide this field, the logging service considers other log entries in the same project with the same ID as duplicates which can be removed. If omitted, Stackdriver Logging will generate a unique ID for this log entry. + /// Output only. The time the log entry was received by Stackdriver Logging. + #[serde(rename="receiveTimestamp")] + pub receive_timestamp: Option, + /// Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own unique identifier. The insert_id is used to order log entries that have the same timestamp value. #[serde(rename="insertId")] pub insert_id: Option, /// Optional. Information about an operation associated with the log entry, if applicable. @@ -861,8 +854,6 @@ pub struct LogEntry { /// 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 {} @@ -876,8 +867,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 { @@ -887,10 +878,10 @@ pub struct LogMetric { pub filter: Option, /// Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed. pub version: Option, - /// Optional. A description of this metric, which is used in documentation. - pub description: Option, /// Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: "projects/my-project/metrics/nginx%2Frequests". pub name: Option, + /// Optional. A description of this metric, which is used in documentation. + pub description: Option, } impl RequestValue for LogMetric {} @@ -916,10 +907,10 @@ pub struct MonitoredResourceDescriptor { /// Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters. #[serde(rename="type")] pub type_: Option, - /// Optional. A detailed description of the monitored resource type that might be used in documentation. - pub description: 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 Resource for MonitoredResourceDescriptor {} @@ -974,7 +965,12 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789". + /// * `parent` - Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// pub fn sinks_list(&self, parent: &str) -> FolderSinkListCall<'a, C, A> { FolderSinkListCall { hub: self.hub, @@ -997,6 +993,8 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// * `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) -> FolderSinkUpdateCall<'a, C, A> { FolderSinkUpdateCall { @@ -1016,9 +1014,11 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// /// # Arguments /// - /// * `sinkName` - Required. The parent resource name of the sink: + /// * `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 sinks_get(&self, sink_name: &str) -> FolderSinkGetCall<'a, C, A> { FolderSinkGetCall { @@ -1040,6 +1040,8 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// * `parent` - Required. The resource in which to create the sink: /// "projects/[PROJECT_ID]" /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" /// Examples: "projects/my-logging-project", "organizations/123456789". pub fn sinks_create(&self, request: LogSink, parent: &str) -> FolderSinkCreateCall<'a, C, A> { FolderSinkCreateCall { @@ -1062,7 +1064,9 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// * `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]" - /// It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist. + /// "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) -> FolderSinkDeleteCall<'a, C, A> { FolderSinkDeleteCall { hub: self.hub, @@ -1075,13 +1079,15 @@ impl<'a, C, A> FolderMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the logs in projects or organizations. Only logs that have entries are listed. + /// 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 logs_list(&self, parent: &str) -> FolderLogListCall<'a, C, A> { FolderLogListCall { @@ -1097,13 +1103,15 @@ 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. + /// 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 { @@ -1158,13 +1166,15 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the logs in projects or organizations. Only logs that have entries are listed. + /// 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 logs_list(&self, parent: &str) -> OrganizationLogListCall<'a, C, A> { OrganizationLogListCall { @@ -1180,13 +1190,15 @@ 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. + /// 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) -> OrganizationLogDeleteCall<'a, C, A> { OrganizationLogDeleteCall { @@ -1208,6 +1220,8 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// * `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) -> OrganizationSinkUpdateCall<'a, C, A> { OrganizationSinkUpdateCall { @@ -1227,9 +1241,11 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// # Arguments /// - /// * `sinkName` - Required. The parent resource name of the sink: + /// * `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 sinks_get(&self, sink_name: &str) -> OrganizationSinkGetCall<'a, C, A> { OrganizationSinkGetCall { @@ -1247,7 +1263,12 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789". + /// * `parent` - Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// pub fn sinks_list(&self, parent: &str) -> OrganizationSinkListCall<'a, C, A> { OrganizationSinkListCall { hub: self.hub, @@ -1269,7 +1290,9 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// * `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]" - /// It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist. + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" + /// Example: "projects/my-project-id/sinks/my-sink-id". pub fn sinks_delete(&self, sink_name: &str) -> OrganizationSinkDeleteCall<'a, C, A> { OrganizationSinkDeleteCall { hub: self.hub, @@ -1290,6 +1313,8 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// * `parent` - Required. The resource in which to create the sink: /// "projects/[PROJECT_ID]" /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" /// Examples: "projects/my-logging-project", "organizations/123456789". pub fn sinks_create(&self, request: LogSink, parent: &str) -> OrganizationSinkCreateCall<'a, C, A> { OrganizationSinkCreateCall { @@ -1346,7 +1371,7 @@ impl<'a, C, A> EntryMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Writes log entries to Stackdriver Logging. All log entries are written by this method. + /// Writes log entries to Stackdriver Logging. /// /// # Arguments /// @@ -1429,6 +1454,8 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// * `parent` - Required. The resource in which to create the sink: /// "projects/[PROJECT_ID]" /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" /// Examples: "projects/my-logging-project", "organizations/123456789". pub fn sinks_create(&self, request: LogSink, parent: &str) -> BillingAccountSinkCreateCall<'a, C, A> { BillingAccountSinkCreateCall { @@ -1444,13 +1471,15 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the logs in projects or organizations. Only logs that have entries are listed. + /// 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 logs_list(&self, parent: &str) -> BillingAccountLogListCall<'a, C, A> { BillingAccountLogListCall { @@ -1470,7 +1499,12 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789". + /// * `parent` - Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// pub fn sinks_list(&self, parent: &str) -> BillingAccountSinkListCall<'a, C, A> { BillingAccountSinkListCall { hub: self.hub, @@ -1492,7 +1526,9 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// * `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]" - /// It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist. + /// "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) -> BillingAccountSinkDeleteCall<'a, C, A> { BillingAccountSinkDeleteCall { hub: self.hub, @@ -1509,9 +1545,11 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// /// # Arguments /// - /// * `sinkName` - Required. The parent resource name of the sink: + /// * `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 sinks_get(&self, sink_name: &str) -> BillingAccountSinkGetCall<'a, C, A> { BillingAccountSinkGetCall { @@ -1533,6 +1571,8 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// * `sinkName` - Required. The full resource name of the sink to update, including the parent resource and the sink identifier: /// "projects/[PROJECT_ID]/sinks/[SINK_ID]" /// "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]" + /// "folders/[FOLDER_ID]/sinks/[SINK_ID]" /// Example: "projects/my-project-id/sinks/my-sink-id". pub fn sinks_update(&self, request: LogSink, sink_name: &str) -> BillingAccountSinkUpdateCall<'a, C, A> { BillingAccountSinkUpdateCall { @@ -1548,13 +1588,15 @@ impl<'a, C, A> BillingAccountMethods<'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. + /// 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) -> BillingAccountLogDeleteCall<'a, C, A> { BillingAccountLogDeleteCall { @@ -1664,13 +1706,15 @@ 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. + /// 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 { @@ -1703,13 +1747,15 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the logs in projects or organizations. Only logs that have entries are listed. + /// 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 logs_list(&self, parent: &str) -> ProjectLogListCall<'a, C, A> { ProjectLogListCall { @@ -1775,6 +1821,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `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 { @@ -1794,7 +1842,12 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `parent` - Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789". + /// * `parent` - Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// pub fn sinks_list(&self, parent: &str) -> ProjectSinkListCall<'a, C, A> { ProjectSinkListCall { hub: self.hub, @@ -1813,9 +1866,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// # Arguments /// - /// * `sinkName` - Required. The parent resource name of the sink: + /// * `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 sinks_get(&self, sink_name: &str) -> ProjectSinkGetCall<'a, C, A> { ProjectSinkGetCall { @@ -1836,7 +1891,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `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]" - /// It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist. + /// "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, @@ -1857,6 +1914,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `parent` - Required. The resource in which to create the sink: /// "projects/[PROJECT_ID]" /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" /// Examples: "projects/my-logging-project", "organizations/123456789". pub fn sinks_create(&self, request: LogSink, parent: &str) -> ProjectSinkCreateCall<'a, C, A> { ProjectSinkCreateCall { @@ -2000,7 +2059,7 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; + let mut url = "https://logging.googleapis.com/v2/{+parent}/sinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2106,7 +2165,12 @@ impl<'a, C, A> FolderSinkListCall<'a, C, A> where C: BorrowMut, A } - /// Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789". + /// 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. /// @@ -2271,7 +2335,7 @@ impl<'a, C, A> FolderSinkUpdateCall<'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 = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2404,6 +2468,8 @@ impl<'a, C, A> FolderSinkUpdateCall<'a, C, A> where C: BorrowMut, /// 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. @@ -2416,8 +2482,8 @@ impl<'a, C, A> FolderSinkUpdateCall<'a, C, A> where C: BorrowMut, } /// 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 was 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 was true and the new value is false. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is false. /// /// Sets the *unique writer identity* query property to the given value. pub fn unique_writer_identity(mut self, new_value: bool) -> FolderSinkUpdateCall<'a, C, A> { @@ -2553,7 +2619,7 @@ impl<'a, C, A> FolderSinkGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + let mut url = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2659,9 +2725,11 @@ impl<'a, C, A> FolderSinkGetCall<'a, C, A> where C: BorrowMut, A: } - /// Required. The parent resource name of the sink: + /// 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. @@ -2813,7 +2881,7 @@ impl<'a, C, A> FolderSinkCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; + let mut url = "https://logging.googleapis.com/v2/{+parent}/sinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2946,6 +3014,8 @@ impl<'a, C, A> FolderSinkCreateCall<'a, C, A> where C: BorrowMut, /// 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". /// /// Sets the *parent* path property to the given value. @@ -2956,7 +3026,7 @@ impl<'a, C, A> FolderSinkCreateCall<'a, C, A> where C: BorrowMut, 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 cloud-logs@google.com, the same identity used 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. + /// 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) -> FolderSinkCreateCall<'a, C, A> { @@ -3092,7 +3162,7 @@ impl<'a, C, A> FolderSinkDeleteCall<'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 = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3201,7 +3271,9 @@ impl<'a, C, A> FolderSinkDeleteCall<'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]" - /// It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist. + /// "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. /// @@ -3269,7 +3341,7 @@ impl<'a, C, A> FolderSinkDeleteCall<'a, C, A> where C: BorrowMut, } -/// Lists the logs in projects or organizations. Only logs that have entries are listed. +/// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. /// /// A builder for the *logs.list* method supported by a *folder* resource. /// It is not used directly, but through a `FolderMethods` instance. @@ -3350,7 +3422,7 @@ impl<'a, C, A> FolderLogListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; + let mut url = "https://logging.googleapis.com/v2/{+parent}/logs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3459,6 +3531,8 @@ impl<'a, C, A> FolderLogListCall<'a, C, A> where C: BorrowMut, A: /// 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. @@ -3541,7 +3615,7 @@ impl<'a, C, A> FolderLogListCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes all the log entries in a log. The log reappears if it receives new entries. +/// 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. @@ -3612,7 +3686,7 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+logName}"; + let mut url = "https://logging.googleapis.com/v2/{+logName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3721,6 +3795,8 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, /// 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. @@ -3789,7 +3865,7 @@ impl<'a, C, A> FolderLogDeleteCall<'a, C, A> where C: BorrowMut, } -/// Lists the logs in projects or organizations. Only logs that have entries are listed. +/// Lists the logs in projects, organizations, folders, or billing accounts. Only logs that have entries are listed. /// /// A builder for the *logs.list* method supported by a *organization* resource. /// It is not used directly, but through a `OrganizationMethods` instance. @@ -3870,7 +3946,7 @@ impl<'a, C, A> OrganizationLogListCall<'a, C, A> where C: BorrowMut OrganizationLogListCall<'a, C, A> where C: BorrowMut OrganizationLogListCall<'a, C, A> where C: BorrowMut OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationLogDeleteCall<'a, C, A> where C: BorrowMut OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut OrganizationSinkUpdateCall<'a, C, A> where C: BorrowMut OrganizationSinkUpdateCall<'a, C, A> { @@ -4674,7 +4756,7 @@ impl<'a, C, A> OrganizationSinkGetCall<'a, C, A> where C: BorrowMut OrganizationSinkGetCall<'a, C, A> where C: BorrowMut OrganizationSinkListCall<'a, C, A> where C: BorrowMut OrganizationSinkListCall<'a, C, A> where C: BorrowMut OrganizationSinkDeleteCall<'a, C, A> where C: BorrowMut OrganizationSinkDeleteCall<'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 OrganizationSinkCreateCall<'a, C, A> { @@ -5659,7 +5752,7 @@ impl<'a, C, A> OrganizationSinkCreateCall<'a, C, A> where C: BorrowMut EntryWriteCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/entries:write"; + let mut url = "https://logging.googleapis.com/v2/entries:write".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5973,7 +6066,7 @@ impl<'a, C, A> EntryListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/entries:list"; + let mut url = "https://logging.googleapis.com/v2/entries:list".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6220,7 +6313,7 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountSinkCreateCall<'a, C, A> { @@ -6428,7 +6523,7 @@ impl<'a, C, A> BillingAccountSinkCreateCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> where C: BorrowMut BillingAccountSinkListCall<'a, C, A> where C: BorrowMut BillingAccountSinkListCall<'a, C, A> where C: BorrowMut BillingAccountSinkDeleteCall<'a, C, A> where C: BorrowMut BillingAccountSinkDeleteCall<'a, C, A> where C: BorrowMut BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut BillingAccountSinkGetCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountSinkUpdateCall<'a, C, A> { @@ -7759,7 +7867,7 @@ impl<'a, C, A> BillingAccountSinkUpdateCall<'a, C, A> where C: BorrowMut BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut BillingAccountLogDeleteCall<'a, C, A> where C: BorrowMut MonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/monitoredResourceDescriptors"; + let mut url = "https://logging.googleapis.com/v2/monitoredResourceDescriptors".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8239,7 +8349,7 @@ impl<'a, C, A> MonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut< } -/// Deletes all the log entries in a log. The log reappears if it receives new entries. +/// 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. @@ -8310,7 +8420,7 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+logName}"; + let mut url = "https://logging.googleapis.com/v2/{+logName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8419,6 +8529,8 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, /// 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. @@ -8558,7 +8670,7 @@ impl<'a, C, A> ProjectMetricGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+metricName}"; + let mut url = "https://logging.googleapis.com/v2/{+metricName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8734,7 +8846,7 @@ impl<'a, C, A> ProjectMetricGetCall<'a, C, A> where C: BorrowMut, } -/// Lists the logs in projects or organizations. Only logs that have entries are listed. +/// 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. /// It is not used directly, but through a `ProjectMethods` instance. @@ -8815,7 +8927,7 @@ impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/logs"; + let mut url = "https://logging.googleapis.com/v2/{+parent}/logs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8924,6 +9036,8 @@ impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A /// 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. @@ -9084,7 +9198,7 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut ProjectMetricListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/metrics"; + let mut url = "https://logging.googleapis.com/v2/{+parent}/metrics".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9638,7 +9752,7 @@ impl<'a, C, A> ProjectSinkUpdateCall<'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 = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9771,6 +9885,8 @@ impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut /// 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. @@ -9783,8 +9899,8 @@ impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut } /// 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 was 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 was true and the new value is false. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is false. /// /// Sets the *unique writer identity* query property to the given value. pub fn unique_writer_identity(mut self, new_value: bool) -> ProjectSinkUpdateCall<'a, C, A> { @@ -9930,7 +10046,7 @@ impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; + let mut url = "https://logging.googleapis.com/v2/{+parent}/sinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10036,7 +10152,12 @@ impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, } - /// Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789". + /// 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. /// @@ -10189,7 +10310,7 @@ impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+sinkName}"; + let mut url = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10295,9 +10416,11 @@ impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, A } - /// Required. The parent resource name of the sink: + /// 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. @@ -10437,7 +10560,7 @@ 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 = "https://logging.googleapis.com/v2/{+sinkName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10546,7 +10669,9 @@ 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]" - /// It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist. + /// "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. /// @@ -10697,7 +10822,7 @@ impl<'a, C, A> ProjectSinkCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/{+parent}/sinks"; + let mut url = "https://logging.googleapis.com/v2/{+parent}/sinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10830,6 +10955,8 @@ impl<'a, C, A> ProjectSinkCreateCall<'a, C, A> where C: BorrowMut /// 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". /// /// Sets the *parent* path property to the given value. @@ -10840,7 +10967,7 @@ impl<'a, C, A> ProjectSinkCreateCall<'a, C, A> where C: BorrowMut 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 cloud-logs@google.com, the same identity used 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. + /// 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) -> ProjectSinkCreateCall<'a, C, A> { @@ -10983,7 +11110,7 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with Logging (protocol v2beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/logging2_beta1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-logging2_beta1] path = "../logging2_beta1" -version = "1.0.4+20161206" +version = "1.0.4+20170516" diff --git a/gen/logging2_beta1-cli/README.md b/gen/logging2_beta1-cli/README.md index a1238b269b..600a4d323b 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 *20161206*. The CLI is at version *1.0.4*. +This documentation was generated from the *Logging* API at revision *20170516*. The CLI is at version *1.0.4*. ```bash logging2-beta1 [options] diff --git a/gen/logging2_beta1-cli/mkdocs.yml b/gen/logging2_beta1-cli/mkdocs.yml index 8fe783295c..00888598d6 100644 --- a/gen/logging2_beta1-cli/mkdocs.yml +++ b/gen/logging2_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Logging v1.0.4+20161206 +site_name: Logging v1.0.4+20170516 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 6cb446866e..793d020619 100644 --- a/gen/logging2_beta1-cli/src/main.rs +++ b/gen/logging2_beta1-cli/src/main.rs @@ -642,8 +642,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "filter", "name", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -893,8 +893,8 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "filter" => Some(("filter", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "version" => Some(("version", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { let suggestion = FieldCursor::did_you_mean(key, &vec!["description", "filter", "name", "version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); @@ -986,8 +986,9 @@ impl<'n> Engine<'n> { "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", "name", "output-version-format", "start-time", "writer-identity"]); + 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 } @@ -1244,8 +1245,9 @@ impl<'n> Engine<'n> { "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", "name", "output-version-format", "start-time", "writer-identity"]); + 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 } @@ -1499,7 +1501,7 @@ fn main() { let arg_data = [ ("billing-accounts", "methods: 'logs-delete' and 'logs-list'", vec![ ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries."##), + 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_beta1_cli/billing-accounts_logs-delete", vec![ (Some(r##"log-name"##), @@ -1507,6 +1509,8 @@ fn main() { 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)), @@ -1524,7 +1528,7 @@ fn main() { Some(false)), ]), ("logs-list", - Some(r##"Lists the logs in projects or organizations. Only logs that have entries are listed."##), + 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_beta1_cli/billing-accounts_logs-list", vec![ (Some(r##"parent"##), @@ -1532,6 +1536,8 @@ fn main() { 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)), @@ -1574,7 +1580,7 @@ fn main() { Some(false)), ]), ("write", - Some(r##"Writes log entries to Stackdriver Logging. All log entries are written by this method."##), + Some(r##"Writes log entries to Stackdriver Logging."##), "Details at http://byron.github.io/google-apis-rs/google_logging2_beta1_cli/entries_write", vec![ (Some(r##"kv"##), @@ -1618,7 +1624,7 @@ fn main() { ("organizations", "methods: 'logs-delete' and 'logs-list'", vec![ ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries."##), + 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_beta1_cli/organizations_logs-delete", vec![ (Some(r##"log-name"##), @@ -1626,6 +1632,8 @@ fn main() { 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)), @@ -1643,7 +1651,7 @@ fn main() { Some(false)), ]), ("logs-list", - Some(r##"Lists the logs in projects or organizations. Only logs that have entries are listed."##), + 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_beta1_cli/organizations_logs-list", vec![ (Some(r##"parent"##), @@ -1651,6 +1659,8 @@ fn main() { 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)), @@ -1671,7 +1681,7 @@ fn main() { ("projects", "methods: 'logs-delete', 'logs-list', 'metrics-create', 'metrics-delete', 'metrics-get', 'metrics-list', 'metrics-update', 'sinks-create', 'sinks-delete', 'sinks-get', 'sinks-list' and 'sinks-update'", vec![ ("logs-delete", - Some(r##"Deletes all the log entries in a log. The log reappears if it receives new entries."##), + 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_beta1_cli/projects_logs-delete", vec![ (Some(r##"log-name"##), @@ -1679,6 +1689,8 @@ fn main() { 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)), @@ -1696,7 +1708,7 @@ fn main() { Some(false)), ]), ("logs-list", - Some(r##"Lists the logs in projects or organizations. Only logs that have entries are listed."##), + 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_beta1_cli/projects_logs-list", vec![ (Some(r##"parent"##), @@ -1704,6 +1716,8 @@ fn main() { 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)), @@ -1861,6 +1875,8 @@ fn main() { 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)), @@ -1892,7 +1908,9 @@ fn main() { 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]" - It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist."##), + "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)), @@ -1914,9 +1932,11 @@ fn main() { vec![ (Some(r##"sink-name"##), None, - Some(r##"Required. The parent resource name of the sink: + 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)), @@ -1939,7 +1959,12 @@ fn main() { vec![ (Some(r##"parent"##), None, - Some(r##"Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789"."##), + 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)), @@ -1964,6 +1989,8 @@ fn main() { 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)), @@ -1992,7 +2019,7 @@ fn main() { let mut app = App::new("logging2-beta1") .author("Sebastian Thiel ") - .version("1.0.4+20161206") + .version("1.0.4+20170516") .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 53c7fd5140..242e4286a1 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.4+20161206" +version = "1.0.4+20170516" 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.4+20161206" +documentation = "https://docs.rs/google-logging2_beta1/1.0.4+20170516" license = "MIT" keywords = ["logging", "google", "protocol", "web", "api"] diff --git a/gen/logging2_beta1/README.md b/gen/logging2_beta1/README.md index 31458fd6b8..e724a7924d 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.4+20161206*, where *20161206* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Logging* crate version *1.0.4+20170516*, where *20170516* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161206/google_logging2_beta1/struct.Logging.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.Logging.html) ... * billing accounts - * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.BillingAccountLogDeleteCall.html) and [*logs list*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.BillingAccountLogListCall.html) + * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.BillingAccountLogDeleteCall.html) and [*logs list*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.BillingAccountLogListCall.html) * entries - * [*list*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.EntryWriteCall.html) -* [monitored resource descriptors](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.MonitoredResourceDescriptor.html) - * [*list*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.MonitoredResourceDescriptorListCall.html) + * [*list*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.EntryListCall.html) and [*write*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.EntryWriteCall.html) +* [monitored resource descriptors](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.MonitoredResourceDescriptor.html) + * [*list*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.MonitoredResourceDescriptorListCall.html) * organizations - * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.OrganizationLogDeleteCall.html) and [*logs list*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.OrganizationLogListCall.html) + * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.OrganizationLogDeleteCall.html) and [*logs list*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.OrganizationLogListCall.html) * projects - * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/struct.ProjectSinkUpdateCall.html) + * [*logs delete*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectLogDeleteCall.html), [*logs list*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectLogListCall.html), [*metrics create*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectMetricCreateCall.html), [*metrics delete*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectMetricDeleteCall.html), [*metrics get*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectMetricGetCall.html), [*metrics list*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectMetricListCall.html), [*metrics update*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectMetricUpdateCall.html), [*sinks create*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectSinkCreateCall.html), [*sinks delete*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectSinkDeleteCall.html), [*sinks get*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectSinkGetCall.html), [*sinks list*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/struct.ProjectSinkListCall.html) and [*sinks update*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/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.4+20161206/google_logging2_beta1/struct.Logging.html)** +* **[Hub](https://docs.rs/google-logging2_beta1/1.0.4+20170516/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.4+20161206/google_logging2_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-logging2_beta1/1.0.4+20170516/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.4+20161206/google_logging2_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-logging2_beta1/1.0.4+20170516/google_logging2_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-logging2_beta1/1.0.4+20161206/google_logging2_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-logging2_beta1/1.0.4+20170516/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. @@ -127,17 +127,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-logging2_beta1/1.0.4+20161206/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.4+20170516/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.4+20161206/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.4+20170516/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.4+20161206/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.4+20170516/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.4+20161206/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.4+20170516/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")`. @@ -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-logging2_beta1/1.0.4+20161206/google_logging2_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-logging2_beta1/1.0.4+20161206/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.4+20170516/google_logging2_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-logging2_beta1/1.0.4+20170516/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.4+20161206/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.4+20170516/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.4+20161206/google_logging2_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-logging2_beta1/1.0.4+20161206/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.4+20170516/google_logging2_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-logging2_beta1/1.0.4+20170516/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.4+20161206/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.4+20170516/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.4+20161206/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.4+20170516/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.4+20161206/google_logging2_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-logging2_beta1/1.0.4+20170516/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 c865bc938a..3f1c13ba18 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.4+20161206*, where *20161206* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Logging* crate version *1.0.4+20170516*, where *20170516* is the exact revision of the *logging:v2beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Logging* *v2_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/logging/docs/). @@ -182,7 +182,7 @@ // 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 +// 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)] @@ -227,15 +227,15 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { + /// Administrate log data for your projects + Admin, + /// View log data for your projects Read, /// Submit log data for your projects Write, - /// Administrate log data for your projects - Admin, - /// View and manage your data across Google Cloud Platform services CloudPlatform, @@ -246,9 +246,9 @@ pub enum Scope { impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { + Scope::Admin => "https://www.googleapis.com/auth/logging.admin", Scope::Read => "https://www.googleapis.com/auth/logging.read", Scope::Write => "https://www.googleapis.com/auth/logging.write", - Scope::Admin => "https://www.googleapis.com/auth/logging.admin", Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only", } @@ -323,8 +323,6 @@ pub struct Logging { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Logging {} @@ -337,8 +335,6 @@ impl<'a, C, A> Logging client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://logging.googleapis.com/".to_string(), - _root_url: "https://logging.googleapis.com/".to_string(), } } @@ -367,26 +363,6 @@ impl<'a, C, A> Logging self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://logging.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://logging.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -486,9 +462,9 @@ impl ResponseResult for ListLogMetricsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MonitoredResource { - /// Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Cloud SQL databases use the labels "database_id" and "zone". + /// 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". pub labels: Option>, - /// Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Cloud SQL database is "cloudsql_database". + /// 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. #[serde(rename="type")] pub type_: Option, } @@ -515,7 +491,7 @@ pub struct LogEntryOperation { impl Part for LogEntryOperation {} -/// 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 or organization. +/// 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. /// /// # Activities /// @@ -528,30 +504,36 @@ impl Part for LogEntryOperation {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LogSink { - /// Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. The filter must use the log entry format specified by the output_version_format parameter. For example, in the v2 format: - /// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR - /// - pub filter: Option, + /// Optional. The log entry format to use for this sink's exported log entries. The v2 format is used by default. The v1 format is deprecated and should be used only as part of a migration effort to v2. See Migration to the v2 API. + #[serde(rename="outputVersionFormat")] + pub output_version_format: Option, + /// 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: /// "storage.googleapis.com/[GCS_BUCKET]" /// "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]" /// "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]" /// The sink's writer_identity, set when the sink is created, must have permission to write to the destination or else the log entries are not exported. For more information, see Exporting Logs With Sinks. pub destination: Option, - /// 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, + /// Optional. An advanced logs filter. The only exported log entries are those that are in the resource owning the sink and that match the filter. The filter must use the log entry format specified by the output_version_format parameter. For example, in the v2 format: + /// logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR + /// + pub filter: Option, /// Optional. The time at which this sink will begin exporting log entries. Log entries are exported only if their timestamp is not earlier than the start time. The default value of this field is the time the sink is created or updated. #[serde(rename="startTime")] pub start_time: Option, - /// Optional. The log entry format to use for this sink's exported log entries. The v2 format is used by default. The v1 format is deprecated and should be used only as part of a migration effort to v2. See Migration to the v2 API. - #[serde(rename="outputVersionFormat")] - pub output_version_format: Option, - /// 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, /// Optional. The time at which this sink will stop exporting log entries. Log entries are exported only if their timestamp is earlier than the end time. If this field is not supplied, there is no end time. If both a start time and an end time are provided, then the end time must be later than the start time. #[serde(rename="endTime")] pub end_time: Option, + /// 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, + /// 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: + /// logName:("projects/test-project1/" OR "projects/test-project2/") AND + /// resource.type=gce_instance + /// + #[serde(rename="includeChildren")] + pub include_children: Option, } impl RequestValue for LogSink {} @@ -569,19 +551,21 @@ impl ResponseResult for LogSink {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListLogEntriesRequest { - /// 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 LogEntry.insertId. + /// 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. #[serde(rename="orderBy")] pub order_by: Option, - /// Required. Names of one or more resources from which to retrieve log entries: + /// Required. Names of one or more parent resources from which to retrieve log entries: /// "projects/[PROJECT_ID]" /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" /// Projects listed in the project_ids field are added to this list. #[serde(rename="resourceNames")] pub resource_names: Option>, - /// 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. + /// 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. #[serde(rename="pageSize")] pub page_size: Option, - /// 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. + /// 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. #[serde(rename="pageToken")] pub page_token: Option, /// 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. @@ -739,10 +723,12 @@ pub struct WriteLogEntriesRequest { /// 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]" + /// "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" 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, the response status will be the error associated with one of the failed entries and include error details in the form of WriteLogEntriesPartialErrors. + /// 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. @@ -753,7 +739,7 @@ pub struct WriteLogEntriesRequest { /// "zone": "us-central1-a", "instance_id": "00000000000000000000" }} /// See LogEntry. pub resource: Option, - /// Required. The log entries to write. Values supplied for the fields log_name, resource, and labels in this entries.write request are added to those log entries that do not provide their own values for the fields.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should write multiple log entries at once rather than calling this method for each individual log entry. + /// Required. The log entries to write. Values supplied for the fields log_name, resource, and labels in this entries.write request are inserted into those log entries in this list that do not provide their own values.Stackdriver Logging also creates and inserts values for timestamp and insert_id if the entries do not provide them. The created insert_id for the N'th entry in this list will be greater than earlier entries and less than later entries. Otherwise, the order of log entries in this list does not matter.To improve throughput and to avoid exceeding the quota limit for calls to entries.write, you should write multiple log entries at once rather than calling this method for each individual log entry. pub entries: Option>, } @@ -789,15 +775,18 @@ pub struct LogEntry { pub http_request: Option, /// Required. The monitored resource associated with this log entry. Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error. pub resource: Option, + /// Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT. + pub severity: Option, /// 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. If omitted, Stackdriver Logging will use the time the log entry is received. + /// Optional. The time the event described by the log entry occurred. If omitted in a new log entry, Stackdriver Logging will insert the time the log entry is received. Stackdriver Logging might reject log entries whose time stamps are more than a couple of hours in the future. Log entries with time stamps in the past are accepted. pub timestamp: Option, /// Optional. A set of user-defined (key, value) data that provides additional information about the log entry. pub labels: Option>, + /// Optional. A unique identifier for the log entry. If you provide a value, then Stackdriver Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which can be removed. If omitted in new log entries, then Stackdriver Logging will insert its own unique identifier. The insert_id is used to order log entries that have the same timestamp value. + #[serde(rename="insertId")] + pub insert_id: Option, /// The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads. #[serde(rename="protoPayload")] pub proto_payload: Option>, @@ -807,19 +796,21 @@ pub struct LogEntry { /// Required. The resource name of the log to which this log entry belongs: /// "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 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. A unique ID for the log entry. If you provide this field, the logging service considers other log entries in the same project with the same ID as duplicates which can be removed. If omitted, Stackdriver Logging will generate a unique ID for this log entry. - #[serde(rename="insertId")] - pub insert_id: Option, + /// Output only. The time the log entry was received by Stackdriver Logging. + #[serde(rename="receiveTimestamp")] + pub receive_timestamp: Option, + /// Optional. Resource name of the trace associated with the log entry, if any. If it contains a relative resource name, the name is assumed to be relative to //tracing.googleapis.com. Example: projects/my-projectid/traces/06796866738c859f2f19b7cfb3214824 + pub trace: Option, /// 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 {} @@ -833,8 +824,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 { @@ -844,10 +835,10 @@ pub struct LogMetric { pub filter: Option, /// Output only. The API version that created or updated this metric. The version also dictates the syntax of the filter expression. When a value for this field is missing, the default value of V2 should be assumed. pub version: Option, - /// Optional. A description of this metric, which is used in documentation. - pub description: Option, /// Required. The client-assigned metric identifier. Examples: "error_count", "nginx/requests".Metric identifiers are limited to 100 characters and can include only the following characters: A-Z, a-z, 0-9, and the special characters _-.,+!*',()%/. The forward-slash character (/) denotes a hierarchy of name pieces, and it cannot be the first character of the name.The metric identifier in this field must not be URL-encoded (https://en.wikipedia.org/wiki/Percent-encoding). However, when the metric identifier appears as the [METRIC_ID] part of a metric_name API parameter, then the metric identifier must be URL-encoded. Example: "projects/my-project/metrics/nginx%2Frequests". pub name: Option, + /// Optional. A description of this metric, which is used in documentation. + pub description: Option, } impl RequestValue for LogMetric {} @@ -865,18 +856,18 @@ impl ResponseResult for LogMetric {} /// #[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. A detailed description of the monitored resource type that might be used in documentation. - pub description: Option, + /// Required. A set of labels used to describe instances of this monitored resource type. For example, an individual Google Cloud SQL database is identified by values for the labels "database_id" and "zone". + pub labels: Option>, + /// Optional. A concise name for the monitored resource type that might be displayed in user interfaces. It should be a Title Cased Noun Phrase, without any article or other determiners. For example, "Google Cloud SQL Database". + #[serde(rename="displayName")] + pub display_name: Option, /// 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 Resource for MonitoredResourceDescriptor {} @@ -927,13 +918,15 @@ 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. + /// 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) -> OrganizationLogDeleteCall<'a, C, A> { OrganizationLogDeleteCall { @@ -947,13 +940,15 @@ impl<'a, C, A> OrganizationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the logs in projects or organizations. Only logs that have entries are listed. + /// 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 logs_list(&self, parent: &str) -> OrganizationLogListCall<'a, C, A> { OrganizationLogListCall { @@ -1010,13 +1005,15 @@ impl<'a, C, A> BillingAccountMethods<'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. + /// 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) -> BillingAccountLogDeleteCall<'a, C, A> { BillingAccountLogDeleteCall { @@ -1030,13 +1027,15 @@ impl<'a, C, A> BillingAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the logs in projects or organizations. Only logs that have entries are listed. + /// 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 logs_list(&self, parent: &str) -> BillingAccountLogListCall<'a, C, A> { BillingAccountLogListCall { @@ -1146,13 +1145,59 @@ 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. /// /// # Arguments /// - /// * `parent` - Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789". + /// * `parent` - Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// pub fn sinks_list(&self, parent: &str) -> ProjectSinkListCall<'a, C, A> { ProjectSinkListCall { hub: self.hub, @@ -1165,35 +1210,17 @@ 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. - /// - /// # Arguments - /// - /// * `logName` - Required. The resource name of the log to delete: - /// "projects/[PROJECT_ID]/logs/[LOG_ID]" - /// "organizations/[ORGANIZATION_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: /// /// Gets a sink. /// /// # Arguments /// - /// * `sinkName` - Required. The parent resource name of the sink: + /// * `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 sinks_get(&self, sink_name: &str) -> ProjectSinkGetCall<'a, C, A> { ProjectSinkGetCall { @@ -1226,25 +1253,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. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field. @@ -1255,6 +1263,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `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 { @@ -1270,13 +1280,15 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists the logs in projects or organizations. Only logs that have entries are listed. + /// 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 logs_list(&self, parent: &str) -> ProjectLogListCall<'a, C, A> { ProjectLogListCall { @@ -1319,6 +1331,8 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `parent` - Required. The resource in which to create the sink: /// "projects/[PROJECT_ID]" /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" /// Examples: "projects/my-logging-project", "organizations/123456789". pub fn sinks_create(&self, request: LogSink, parent: &str) -> ProjectSinkCreateCall<'a, C, A> { ProjectSinkCreateCall { @@ -1383,7 +1397,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// * `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]" - /// It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist. + /// "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, @@ -1454,7 +1470,7 @@ impl<'a, C, A> EntryMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Writes log entries to Stackdriver Logging. All log entries are written by this method. + /// Writes log entries to Stackdriver Logging. /// /// # Arguments /// @@ -1478,7 +1494,7 @@ impl<'a, C, A> EntryMethods<'a, C, A> { // CallBuilders ### // ################# -/// Deletes all the log entries in a log. The log reappears if it receives new entries. +/// 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 *organization* resource. /// It is not used directly, but through a `OrganizationMethods` instance. @@ -1549,7 +1565,7 @@ 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> 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 BillingAccountLogDeleteCall<'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 BillingAccountLogListCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> where C: BorrowMut BillingAccountLogListCall<'a, C, A> where C: BorrowMut MonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/monitoredResourceDescriptors"; + let mut url = "https://logging.googleapis.com/v2beta1/monitoredResourceDescriptors".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2712,10 +2736,10 @@ impl<'a, C, A> MonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut< /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -2750,9 +2774,9 @@ impl<'a, C, A> MonitoredResourceDescriptorListCall<'a, C, A> where C: BorrowMut< } -/// Lists sinks. +/// Gets a logs-based metric. /// -/// A builder for the *sinks.list* method supported by a *project* resource. +/// A builder for the *metrics.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -2776,31 +2800,27 @@ impl<'a, C, A> MonitoredResourceDescriptorListCall<'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.projects().sinks_list("parent") -/// .page_token("nonumy") -/// .page_size(-19) +/// let result = hub.projects().metrics_get("metricName") /// .doit(); /// # } /// ``` -pub struct ProjectSinkListCall<'a, C, A> +pub struct ProjectMetricGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Logging, - _parent: String, - _page_token: Option, - _page_size: Option, + _metric_name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectSinkListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectMetricGetCall<'a, C, A> {} -impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +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, ListSinksResponse)> { + 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}; @@ -2809,17 +2829,11 @@ impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "logging.projects.sinks.list", + dlg.begin(MethodInfo { id: "logging.projects.metrics.get", 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() { + 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)); @@ -2831,12 +2845,12 @@ impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/sinks"; + let mut url = "https://logging.googleapis.com/v2beta1/{+metricName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } - for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + for &(find_this, param_name) in [("{+metricName}", "metricName")].iter() { let mut replace_with = String::new(); for &(name, ref value) in params.iter() { if name == param_name { @@ -2851,7 +2865,7 @@ impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, } { let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["parent"].iter() { + for param_name in ["metricName"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -2937,28 +2951,16 @@ impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, } - /// Required. The parent resource whose sinks are to be listed. Examples: "projects/my-logging-project", "organizations/123456789". + /// The resource name of the desired metric: + /// "projects/[PROJECT_ID]/metrics/[METRIC_ID]" + /// /// - /// Sets the *parent* path property to the given value. + /// 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 parent(mut self, new_value: &str) -> ProjectSinkListCall<'a, C, A> { - self._parent = new_value.to_string(); - self - } - /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ProjectSinkListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> ProjectSinkListCall<'a, C, A> { - self._page_size = Some(new_value); + 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 @@ -2967,7 +2969,7 @@ impl<'a, C, A> ProjectSinkListCall<'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) -> ProjectSinkListCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectMetricGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2981,10 +2983,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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -2994,7 +2996,7 @@ impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ProjectSinkListCall<'a, C, A> + 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 @@ -3011,7 +3013,7 @@ impl<'a, C, A> ProjectSinkListCall<'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) -> ProjectSinkListCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectMetricGetCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -3019,7 +3021,7 @@ impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, } -/// Deletes all the log entries in a log. The log reappears if it receives new entries. +/// 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. @@ -3090,7 +3092,7 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+logName}"; + let mut url = "https://logging.googleapis.com/v2beta1/{+logName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3199,6 +3201,8 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, /// 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. @@ -3229,10 +3233,10 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3267,6 +3271,280 @@ impl<'a, C, A> ProjectLogDeleteCall<'a, C, A> where C: BorrowMut, } +/// Lists sinks. +/// +/// A builder for the *sinks.list* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate 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::new(), +/// # ::default(), None); +/// # let mut hub = Logging::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().sinks_list("parent") +/// .page_token("gubergren") +/// .page_size(-95) +/// .doit(); +/// # } +/// ``` +pub struct ProjectSinkListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Logging, + _parent: String, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectSinkListCall<'a, C, A> {} + +impl<'a, C, A> ProjectSinkListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListSinksResponse)> { + use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "logging.projects.sinks.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("parent", self._parent.to_string())); + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "parent", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://logging.googleapis.com/v2beta1/{+parent}/sinks".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+parent}", "parent")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["parent"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Required. The parent resource whose sinks are to be listed: + /// "projects/[PROJECT_ID]" + /// "organizations/[ORGANIZATION_ID]" + /// "billingAccounts/[BILLING_ACCOUNT_ID]" + /// "folders/[FOLDER_ID]" + /// + /// + /// Sets the *parent* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn parent(mut self, new_value: &str) -> ProjectSinkListCall<'a, C, A> { + self._parent = new_value.to_string(); + self + } + /// Optional. If present, then retrieve the next batch of results from the preceding call to this method. pageToken must be the value of nextPageToken from the previous response. The values of other method parameters should be identical to those in the previous call. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ProjectSinkListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Optional. The maximum number of results to return from this request. Non-positive values are ignored. The presence of nextPageToken in the response indicates that more results might be available. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> ProjectSinkListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectSinkListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *upload_protocol* (query-string) - 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) -> ProjectSinkListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectSinkListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Gets a sink. /// /// A builder for the *sinks.get* method supported by a *project* resource. @@ -3338,7 +3616,7 @@ impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+sinkName}"; + let mut url = "https://logging.googleapis.com/v2beta1/{+sinkName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3444,9 +3722,11 @@ impl<'a, C, A> ProjectSinkGetCall<'a, C, A> where C: BorrowMut, A } - /// Required. The parent resource name of the sink: + /// 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. @@ -3477,10 +3757,10 @@ impl<'a, C, A> 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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3593,7 +3873,7 @@ impl<'a, C, A> ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut ProjectMetricUpdateCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Logging::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().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. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. - /// * *callback* (query-string) - JSONP - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, 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. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing 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: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Updates a sink. If the named sink doesn't exist, then this method is identical to sinks.create. If the named sink does exist, then this method replaces the following fields in the existing sink with values from the new sink: destination, filter, output_version_format, start_time, and end_time. The updated filter might also have a new writer_identity; see the unique_writer_identity field. /// /// A builder for the *sinks.update* method supported by a *project* resource. @@ -4123,7 +4156,7 @@ impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+sinkName}"; + let mut url = "https://logging.googleapis.com/v2beta1/{+sinkName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4256,6 +4289,8 @@ impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut /// 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. @@ -4268,8 +4303,8 @@ impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut } /// 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 was 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 was true and the new value is false. + /// If the old value is false and the new value is true, then writer_identity is changed to a unique service account. + /// It is an error if the old value is true and the new value is false. /// /// Sets the *unique writer identity* query property to the given value. pub fn unique_writer_identity(mut self, new_value: bool) -> ProjectSinkUpdateCall<'a, C, A> { @@ -4296,10 +4331,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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4334,7 +4369,7 @@ impl<'a, C, A> ProjectSinkUpdateCall<'a, C, A> where C: BorrowMut } -/// Lists the logs in projects or organizations. Only logs that have entries are listed. +/// 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. /// It is not used directly, but through a `ProjectMethods` instance. @@ -4415,7 +4450,7 @@ impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/logs"; + let mut url = "https://logging.googleapis.com/v2beta1/{+parent}/logs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4524,6 +4559,8 @@ impl<'a, C, A> ProjectLogListCall<'a, C, A> where C: BorrowMut, A /// 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. @@ -4568,10 +4605,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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -4677,7 +4714,7 @@ impl<'a, C, A> ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricDeleteCall<'a, C, A> where C: BorrowMut ProjectSinkCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/sinks"; + let mut url = "https://logging.googleapis.com/v2beta1/{+parent}/sinks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5069,6 +5106,8 @@ impl<'a, C, A> ProjectSinkCreateCall<'a, C, A> where C: BorrowMut /// 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". /// /// Sets the *parent* path property to the given value. @@ -5079,7 +5118,7 @@ impl<'a, C, A> ProjectSinkCreateCall<'a, C, A> where C: BorrowMut 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 cloud-logs@google.com, the same identity used 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. + /// 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) -> ProjectSinkCreateCall<'a, C, A> { @@ -5106,10 +5145,10 @@ impl<'a, C, A> 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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5222,7 +5261,7 @@ impl<'a, C, A> ProjectMetricCreateCall<'a, C, A> where C: BorrowMut ProjectMetricCreateCall<'a, C, A> where C: BorrowMut ProjectMetricListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/{+parent}/metrics"; + let mut url = "https://logging.googleapis.com/v2beta1/{+parent}/metrics".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5655,10 +5694,10 @@ impl<'a, C, A> 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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -5764,7 +5803,7 @@ 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() + "v2beta1/{+sinkName}"; + let mut url = "https://logging.googleapis.com/v2beta1/{+sinkName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5873,7 +5912,9 @@ 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]" - /// It is an error if the sink does not exist. Example: "projects/my-project-id/sinks/my-sink-id". It is an error if the sink does not exist. + /// "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. /// @@ -5903,10 +5944,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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6016,7 +6057,7 @@ impl<'a, C, A> EntryListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/entries:list"; + let mut url = "https://logging.googleapis.com/v2beta1/entries:list".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6142,10 +6183,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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6180,7 +6221,7 @@ impl<'a, C, A> EntryListCall<'a, C, A> where C: BorrowMut, A: oau } -/// Writes log entries to Stackdriver Logging. All log entries are written by this method. +/// Writes log entries to Stackdriver Logging. /// /// A builder for the *write* method supported by a *entry* resource. /// It is not used directly, but through a `EntryMethods` instance. @@ -6255,7 +6296,7 @@ impl<'a, C, A> EntryWriteCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2beta1/entries:write"; + let mut url = "https://logging.googleapis.com/v2beta1/entries:write".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6381,10 +6422,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. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -6419,3 +6460,4 @@ impl<'a, C, A> EntryWriteCall<'a, C, A> where C: BorrowMut, A: oa } + diff --git a/gen/manager1_beta2-cli/Cargo.toml b/gen/manager1_beta2-cli/Cargo.toml index 3a161152c4..15c78cd527 100644 --- a/gen/manager1_beta2-cli/Cargo.toml +++ b/gen/manager1_beta2-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/manager1_beta2/src/lib.rs b/gen/manager1_beta2/src/lib.rs index 3e7c61d276..5b18170ef5 100644 --- a/gen/manager1_beta2/src/lib.rs +++ b/gen/manager1_beta2/src/lib.rs @@ -177,7 +177,7 @@ // 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 +// 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)] @@ -328,8 +328,6 @@ pub struct Manager { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Manager {} @@ -342,8 +340,6 @@ impl<'a, C, A> Manager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/manager/v1beta2/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -363,26 +359,6 @@ impl<'a, C, A> Manager self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/manager/v1beta2/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1470,7 +1446,7 @@ impl<'a, C, A> TemplateListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{projectId}/templates"; + let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/templates".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -1719,7 +1695,7 @@ impl<'a, C, A> TemplateDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "{projectId}/templates/{templateName}"; + let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/templates/{templateName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1959,7 +1935,7 @@ impl<'a, C, A> TemplateInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{projectId}/templates"; + let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/templates".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2219,7 +2195,7 @@ impl<'a, C, A> TemplateGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{projectId}/templates/{templateName}"; + let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/templates/{templateName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -2471,7 +2447,7 @@ impl<'a, C, A> DeploymentInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{projectId}/regions/{region}/deployments"; + let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/regions/{region}/deployments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppengineAdmin.as_ref().to_string(), ()); } @@ -2742,7 +2718,7 @@ impl<'a, C, A> DeploymentGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{projectId}/regions/{region}/deployments/{deploymentName}"; + let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/regions/{region}/deployments/{deploymentName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3006,7 +2982,7 @@ impl<'a, C, A> DeploymentListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{projectId}/regions/{region}/deployments"; + let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/regions/{region}/deployments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -3266,7 +3242,7 @@ impl<'a, C, A> DeploymentDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "{projectId}/regions/{region}/deployments/{deploymentName}"; + let mut url = "https://www.googleapis.com/manager/v1beta2/projects/{projectId}/regions/{region}/deployments/{deploymentName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3438,3 +3414,4 @@ impl<'a, C, A> DeploymentDeleteCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/manufacturers1-cli/Cargo.toml b/gen/manufacturers1-cli/Cargo.toml index a6bebf396b..57233a9553 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.4+20161028" +version = "1.0.4+20170412" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-manufacturers1] path = "../manufacturers1" -version = "1.0.4+20161028" +version = "1.0.4+20170412" diff --git a/gen/manufacturers1-cli/README.md b/gen/manufacturers1-cli/README.md index f377e79247..8003a66d6b 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 *20161028*. The CLI is at version *1.0.4*. +This documentation was generated from the *Manufacturer Center* API at revision *20170412*. The CLI is at version *1.0.4*. ```bash manufacturers1 [options] diff --git a/gen/manufacturers1-cli/mkdocs.yml b/gen/manufacturers1-cli/mkdocs.yml index 889549c0fa..342a96046b 100644 --- a/gen/manufacturers1-cli/mkdocs.yml +++ b/gen/manufacturers1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Manufacturer Center v1.0.4+20161028 +site_name: Manufacturer Center v1.0.4+20170412 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 935bc2d963..fb263b3e70 100644 --- a/gen/manufacturers1-cli/src/main.rs +++ b/gen/manufacturers1-cli/src/main.rs @@ -333,7 +333,7 @@ fn main() { let mut app = App::new("manufacturers1") .author("Sebastian Thiel ") - .version("1.0.4+20161028") + .version("1.0.4+20170412") .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 67167a4556..63c48405b8 100644 --- a/gen/manufacturers1/Cargo.toml +++ b/gen/manufacturers1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-manufacturers1" -version = "1.0.4+20161028" +version = "1.0.4+20170412" 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.4+20161028" +documentation = "https://docs.rs/google-manufacturers1/1.0.4+20170412" license = "MIT" keywords = ["manufacturers", "google", "protocol", "web", "api"] diff --git a/gen/manufacturers1/README.md b/gen/manufacturers1/README.md index 49328e767d..3f9624f89b 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.4+20161028*, where *20161028* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Manufacturer Center* crate version *1.0.4+20170412*, where *20170412* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161028/google_manufacturers1/struct.ManufacturerCenter.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-manufacturers1/1.0.4+20170412/google_manufacturers1/struct.ManufacturerCenter.html) ... * accounts - * [*products get*](https://docs.rs/google-manufacturers1/1.0.4+20161028/google_manufacturers1/struct.AccountProductGetCall.html) and [*products list*](https://docs.rs/google-manufacturers1/1.0.4+20161028/google_manufacturers1/struct.AccountProductListCall.html) + * [*products get*](https://docs.rs/google-manufacturers1/1.0.4+20170412/google_manufacturers1/struct.AccountProductGetCall.html) and [*products list*](https://docs.rs/google-manufacturers1/1.0.4+20170412/google_manufacturers1/struct.AccountProductListCall.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.4+20161028/google_manufacturers1/struct.ManufacturerCenter.html)** +* **[Hub](https://docs.rs/google-manufacturers1/1.0.4+20170412/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.4+20161028/google_manufacturers1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-manufacturers1/1.0.4+20161028/google_manufacturers1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-manufacturers1/1.0.4+20161028/google_manufacturers1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-manufacturers1/1.0.4+20170412/google_manufacturers1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-manufacturers1/1.0.4+20170412/google_manufacturers1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-manufacturers1/1.0.4+20170412/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.4+20161028/google_manufacturers1/trait.Part.html)** + * **[Parts](https://docs.rs/google-manufacturers1/1.0.4+20170412/google_manufacturers1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-manufacturers1/1.0.4+20161028/google_manufacturers1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-manufacturers1/1.0.4+20170412/google_manufacturers1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -115,17 +115,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-manufacturers1/1.0.4+20161028/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.4+20170412/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.4+20161028/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.4+20170412/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.4+20161028/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.4+20170412/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.4+20161028/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.4+20170412/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")`. @@ -135,29 +135,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.4+20161028/google_manufacturers1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-manufacturers1/1.0.4+20161028/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.4+20170412/google_manufacturers1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-manufacturers1/1.0.4+20170412/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.4+20161028/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.4+20170412/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.4+20161028/google_manufacturers1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-manufacturers1/1.0.4+20161028/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.4+20170412/google_manufacturers1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-manufacturers1/1.0.4+20170412/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.4+20161028/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.4+20170412/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.4+20161028/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.4+20170412/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.4+20161028/google_manufacturers1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-manufacturers1/1.0.4+20170412/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 cf0ec5533b..b8d9e365c2 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.4+20161028*, where *20161028* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Manufacturer Center* crate version *1.0.4+20170412*, where *20170412* is the exact revision of the *manufacturers:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Manufacturer Center* *v1* API can be found at the //! [official documentation site](https://developers.google.com/manufacturers/). @@ -170,7 +170,7 @@ // 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 +// 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)] @@ -295,8 +295,6 @@ pub struct ManufacturerCenter { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for ManufacturerCenter {} @@ -309,8 +307,6 @@ impl<'a, C, A> ManufacturerCenter client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://manufacturers.googleapis.com/".to_string(), - _root_url: "https://manufacturers.googleapis.com/".to_string(), } } @@ -327,72 +323,26 @@ impl<'a, C, A> ManufacturerCenter self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://manufacturers.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://manufacturers.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// Attributes of the product. For more information, see -/// https://support.google.com/manufacturers/answer/6124116. +/// The number of products in a single package. For more information, see +/// https://support.google.com/manufacturers/answer/6124116#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 Attributes { - /// The name of the group of products related to the product. For more - /// information, see - /// https://support.google.com/manufacturers/answer/6124116#productline. - #[serde(rename="productLine")] - pub product_line: Option, - /// The title of the product. For more information, see - /// https://support.google.com/manufacturers/answer/6124116#title. - pub title: Option, - /// The Manufacturer Part Number (MPN) of the product. For more information, - /// see https://support.google.com/manufacturers/answer/6124116#mpn. - pub mpn: Option, - /// The brand name of the product. For more information, see - /// https://support.google.com/manufacturers/answer/6124116#brand. - pub brand: Option, - /// The canonical name of the product. For more information, see - /// https://support.google.com/manufacturers/answer/6124116#productname. - #[serde(rename="productName")] - pub product_name: Option, - /// The URL of the manufacturer's detail page of the product. For more - /// information, see - /// https://support.google.com/manufacturers/answer/6124116#productpage. - #[serde(rename="productPageUrl")] - pub product_page_url: 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>, - /// The manufacturer's category of the product. For more information, see - /// https://support.google.com/manufacturers/answer/6124116#producttype. - #[serde(rename="productType")] - pub product_type: Option>, +pub struct Count { + /// The numeric value of the number of products in a package. + pub value: Option, + /// The unit in which these products are counted. + pub unit: Option, } -impl Part for Attributes {} +impl Part for Count {} /// Product data. @@ -426,6 +376,18 @@ pub struct Product { /// @OutputOnly #[serde(rename="contentLanguage")] pub content_language: Option, + /// Name in the format `{target_country}:{content_language}:{product_id}`. + /// + /// `target_country` - The target country of the product as a CLDR territory + /// 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, /// Attributes of the product provided manually via the Manufacturer Center UI. /// @OutputOnly #[serde(rename="manuallyProvidedAttributes")] @@ -441,52 +403,56 @@ pub struct Product { /// feeds. #[serde(rename="uploadedAttributes")] pub uploaded_attributes: 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 ResponseResult for Product {} -/// Product issue. +/// The capacity of a product. For more information, see +/// https://support.google.com/manufacturers/answer/6124116#capacity. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Issue { - /// If present, the attribute that triggered the issue. For more information - /// about attributes, see - /// https://support.google.com/manufacturers/answer/6124116. - pub attribute: Option, - /// The server-generated type of the issue, for example, - /// “INCORRECT_TEXT_FORMATTING”, “IMAGE_NOT_SERVEABLE”, etc. - #[serde(rename="type")] - pub type_: Option, - /// The severity of the issue. - pub severity: Option, - /// Description of the issue. - pub description: Option, +pub struct Capacity { + /// The numeric value of the capacity. + pub value: Option, + /// The unit of the capacity, i.e., MB, GB, or TB. + pub unit: Option, } -impl Part for Issue {} +impl Part for Capacity {} + + +/// An image. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Image { + /// The status of the image. + /// @OutputOnly + pub status: Option, + /// The URL of the image. For crawled images, this is the provided URL. For + /// uploaded images, this is a serving URL from Google if the image has been + /// processed successfully. + #[serde(rename="imageUrl")] + pub image_url: Option, + /// The type of the image, i.e., crawled or uploaded. + /// @OutputOnly + #[serde(rename="type")] + pub type_: Option, +} + +impl Part for Image {} /// There is no detailed description. @@ -510,6 +476,210 @@ pub struct ListProductsResponse { impl ResponseResult for ListProductsResponse {} +/// A feature description of the product. For more information, see +/// https://support.google.com/manufacturers/answer/6124116#featuredesc. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct FeatureDescription { + /// A short description of the feature. + pub headline: Option, + /// A detailed description of the feature. + pub text: Option, + /// An optional image describing the feature. + pub image: Option, +} + +impl Part for FeatureDescription {} + + +/// A product detail of the product. For more information, see +/// https://support.google.com/manufacturers/answer/6124116#productdetail. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ProductDetail { + /// The name of the attribute. + #[serde(rename="attributeName")] + pub attribute_name: Option, + /// The value of the attribute. + #[serde(rename="attributeValue")] + pub attribute_value: Option, + /// A short section name that can be reused between multiple product details. + #[serde(rename="sectionName")] + pub section_name: Option, +} + +impl Part for ProductDetail {} + + +/// Attributes of the product. For more information, see +/// https://support.google.com/manufacturers/answer/6124116. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Attributes { + /// The name of the group of products related to the product. For more + /// information, see + /// https://support.google.com/manufacturers/answer/6124116#productline. + #[serde(rename="productLine")] + pub product_line: Option, + /// The color of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#color. + pub color: Option, + /// The release date of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#release. + #[serde(rename="releaseDate")] + pub release_date: Option, + /// The item group id of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#itemgroupid. + #[serde(rename="itemGroupId")] + pub item_group_id: Option, + /// The videos of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#video. + #[serde(rename="videoLink")] + pub video_link: Option>, + /// The flavor of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#flavor. + pub flavor: Option, + /// The scent of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#scent. + pub scent: Option, + /// The size of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#size. + pub size: Option, + /// The capacity of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#capacity. + pub capacity: Option, + /// The title of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#title. + pub title: Option, + /// The pattern of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#pattern. + pub pattern: Option, + /// The disclosure date of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#disclosure. + #[serde(rename="disclosureDate")] + pub disclosure_date: Option, + /// The theme of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#theme. + pub theme: Option, + /// The suggested retail price (MSRP) of the product. For more information, + /// see https://support.google.com/manufacturers/answer/6124116#price. + #[serde(rename="suggestedRetailPrice")] + pub suggested_retail_price: Option, + /// The material of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#material. + pub material: Option, + /// The description of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#description. + pub description: Option, + /// The format of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#format. + pub format: Option, + /// The Manufacturer Part Number (MPN) of the product. For more information, + /// see https://support.google.com/manufacturers/answer/6124116#mpn. + pub mpn: Option, + /// The brand name of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#brand. + pub brand: Option, + /// The details of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#productdetail. + #[serde(rename="productDetail")] + pub product_detail: Option>, + /// The canonical name of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#productname. + #[serde(rename="productName")] + pub product_name: Option, + /// The rich format description of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#featuredesc. + #[serde(rename="featureDescription")] + pub feature_description: Option>, + /// The size system of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#sizesystem. + #[serde(rename="sizeSystem")] + pub size_system: Option, + /// The size type of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#sizetype. + #[serde(rename="sizeType")] + pub size_type: Option, + /// The additional images of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#addlimage. + #[serde(rename="additionalImageLink")] + pub additional_image_link: Option>, + /// The count of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#count. + pub count: Option, + /// The target gender of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#gender. + pub gender: Option, + /// The URL of the detail page of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#productpage. + #[serde(rename="productPageUrl")] + pub product_page_url: Option, + /// The image of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#image. + #[serde(rename="imageLink")] + pub image_link: Option, + /// The category of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#producttype. + #[serde(rename="productType")] + pub product_type: 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>, + /// The target age group of the product. For more information, see + /// https://support.google.com/manufacturers/answer/6124116#agegroup. + #[serde(rename="ageGroup")] + pub age_group: Option, +} + +impl Part for Attributes {} + + +/// Product issue. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Issue { + /// If present, the attribute that triggered the issue. For more information + /// about attributes, see + /// https://support.google.com/manufacturers/answer/6124116. + pub attribute: Option, + /// The server-generated type of the issue, for example, + /// “INCORRECT_TEXT_FORMATTING”, “IMAGE_NOT_SERVEABLE”, etc. + #[serde(rename="type")] + pub type_: Option, + /// Description of the issue. + pub description: Option, + /// The severity of the issue. + pub severity: Option, + /// The timestamp when this issue appeared. + pub timestamp: Option, +} + +impl Part for Issue {} + + +/// A price. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Price { + /// The currency in which the price is denoted. + pub currency: Option, + /// The numeric value of the price. + pub amount: Option, +} + +impl Part for Price {} + + // ################### // MethodBuilders ### @@ -690,7 +860,7 @@ impl<'a, C, A> AccountProductListCall<'a, C, A> where C: BorrowMut AccountProductListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountProductListCall<'a, C, A> @@ -955,7 +1125,7 @@ impl<'a, C, A> AccountProductGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+parent}/products/{+name}"; + let mut url = "https://manufacturers.googleapis.com/v1/{+parent}/products/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Manufacturercenter.as_ref().to_string(), ()); } @@ -1117,12 +1287,12 @@ impl<'a, C, A> AccountProductGetCall<'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) -> AccountProductGetCall<'a, C, A> @@ -1150,3 +1320,4 @@ impl<'a, C, A> AccountProductGetCall<'a, C, A> where C: BorrowMut } + diff --git a/gen/mirror1-cli/Cargo.toml b/gen/mirror1-cli/Cargo.toml index 334364a560..d709bfc3c6 100644 --- a/gen/mirror1-cli/Cargo.toml +++ b/gen/mirror1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-mirror1-cli" -version = "1.0.4+20160616" +version = "1.0.4+20170419" authors = ["Sebastian Thiel "] description = "A complete library to interact with mirror (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mirror1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-mirror1] path = "../mirror1" -version = "1.0.4+20160616" +version = "1.0.4+20170419" diff --git a/gen/mirror1-cli/README.md b/gen/mirror1-cli/README.md index 5dc8621f26..07359067eb 100644 --- a/gen/mirror1-cli/README.md +++ b/gen/mirror1-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 *mirror* API at revision *20160616*. The CLI is at version *1.0.4*. +This documentation was generated from the *mirror* API at revision *20170419*. The CLI is at version *1.0.4*. ```bash mirror1 [options] diff --git a/gen/mirror1-cli/mkdocs.yml b/gen/mirror1-cli/mkdocs.yml index f16c452181..4568cb607f 100644 --- a/gen/mirror1-cli/mkdocs.yml +++ b/gen/mirror1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: mirror v1.0.4+20160616 +site_name: mirror v1.0.4+20170419 site_url: http://byron.github.io/google-apis-rs/google-mirror1-cli site_description: A complete library to interact with mirror (protocol v1) diff --git a/gen/mirror1-cli/src/main.rs b/gen/mirror1-cli/src/main.rs index b4bcdc072f..569606ed0b 100644 --- a/gen/mirror1-cli/src/main.rs +++ b/gen/mirror1-cli/src/main.rs @@ -2564,7 +2564,7 @@ fn main() { let mut app = App::new("mirror1") .author("Sebastian Thiel ") - .version("1.0.4+20160616") + .version("1.0.4+20170419") .about("Interacts with Glass users via the timeline.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_mirror1_cli") .arg(Arg::with_name("url") diff --git a/gen/mirror1/Cargo.toml b/gen/mirror1/Cargo.toml index e9da804e25..0acdf9a2e7 100644 --- a/gen/mirror1/Cargo.toml +++ b/gen/mirror1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-mirror1" -version = "1.0.4+20160616" +version = "1.0.4+20170419" authors = ["Sebastian Thiel "] description = "A complete library to interact with mirror (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/mirror1" homepage = "https://developers.google.com/glass" -documentation = "https://docs.rs/google-mirror1/1.0.4+20160616" +documentation = "https://docs.rs/google-mirror1/1.0.4+20170419" license = "MIT" keywords = ["mirror", "google", "protocol", "web", "api"] diff --git a/gen/mirror1/README.md b/gen/mirror1/README.md index 10473175a7..4d166047cf 100644 --- a/gen/mirror1/README.md +++ b/gen/mirror1/README.md @@ -5,37 +5,37 @@ DO NOT EDIT ! --> The `google-mirror1` library allows access to all features of the *Google mirror* service. -This documentation was generated from *mirror* crate version *1.0.4+20160616*, where *20160616* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *mirror* crate version *1.0.4+20170419*, where *20170419* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *mirror* *v1* API can be found at the [official documentation site](https://developers.google.com/glass). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.Mirror.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.Mirror.html) ... -* [accounts](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.Account.html) - * [*insert*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.AccountInsertCall.html) -* [contacts](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.Contact.html) - * [*delete*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.ContactDeleteCall.html), [*get*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.ContactGetCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.ContactInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.ContactListCall.html), [*patch*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.ContactPatchCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.ContactUpdateCall.html) -* [locations](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.Location.html) - * [*get*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.LocationGetCall.html) and [*list*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.LocationListCall.html) -* [settings](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.Setting.html) - * [*get*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.SettingGetCall.html) -* [subscriptions](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.Subscription.html) - * [*delete*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.SubscriptionInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.SubscriptionListCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.SubscriptionUpdateCall.html) +* [accounts](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.Account.html) + * [*insert*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.AccountInsertCall.html) +* [contacts](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.Contact.html) + * [*delete*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.ContactDeleteCall.html), [*get*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.ContactGetCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.ContactInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.ContactListCall.html), [*patch*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.ContactPatchCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.ContactUpdateCall.html) +* [locations](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.Location.html) + * [*get*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.LocationGetCall.html) and [*list*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.LocationListCall.html) +* [settings](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.Setting.html) + * [*get*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.SettingGetCall.html) +* [subscriptions](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.Subscription.html) + * [*delete*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.SubscriptionInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.SubscriptionListCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.SubscriptionUpdateCall.html) * timeline - * [*attachments delete*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineAttachmentDeleteCall.html), [*attachments get*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineAttachmentGetCall.html), [*attachments insert*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineAttachmentInsertCall.html), [*attachments list*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineAttachmentListCall.html), [*delete*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineDeleteCall.html), [*get*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineGetCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineListCall.html), [*patch*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelinePatchCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineUpdateCall.html) + * [*attachments delete*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineAttachmentDeleteCall.html), [*attachments get*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineAttachmentGetCall.html), [*attachments insert*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineAttachmentInsertCall.html), [*attachments list*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineAttachmentListCall.html), [*delete*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineDeleteCall.html), [*get*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineGetCall.html), [*insert*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineInsertCall.html), [*list*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineListCall.html), [*patch*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelinePatchCall.html) and [*update*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineUpdateCall.html) Upload supported by ... -* [*update timeline*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineUpdateCall.html) -* [*insert timeline*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineInsertCall.html) -* [*attachments insert timeline*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineAttachmentInsertCall.html) +* [*update timeline*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineUpdateCall.html) +* [*insert timeline*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineInsertCall.html) +* [*attachments insert timeline*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineAttachmentInsertCall.html) Download supported by ... -* [*attachments get timeline*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.TimelineAttachmentGetCall.html) +* [*attachments get timeline*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.TimelineAttachmentGetCall.html) @@ -43,17 +43,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/struct.Mirror.html)** +* **[Hub](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/struct.Mirror.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/trait.Part.html)** + * **[Parts](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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-mirror1/1.0.4+20160616/google_mirror1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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-mirror1/1.0.4+20160616/google_mirror1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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-mirror1/1.0.4+20160616/google_mirror1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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-mirror1/1.0.4+20160616/google_mirror1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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-mirror1/1.0.4+20160616/google_mirror1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/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-mirror1/1.0.4+20170419/google_mirror1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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-mirror1/1.0.4+20160616/google_mirror1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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-mirror1/1.0.4+20160616/google_mirror1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-mirror1/1.0.4+20160616/google_mirror1/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-mirror1/1.0.4+20170419/google_mirror1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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-mirror1/1.0.4+20160616/google_mirror1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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-mirror1/1.0.4+20160616/google_mirror1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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-mirror1/1.0.4+20160616/google_mirror1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-mirror1/1.0.4+20170419/google_mirror1/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/mirror1/src/lib.rs b/gen/mirror1/src/lib.rs index 3df2aa5436..f9785a597d 100644 --- a/gen/mirror1/src/lib.rs +++ b/gen/mirror1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *mirror* crate version *1.0.4+20160616*, where *20160616* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *mirror* crate version *1.0.4+20170419*, where *20170419* is the exact revision of the *mirror:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *mirror* *v1* API can be found at the //! [official documentation site](https://developers.google.com/glass). @@ -201,7 +201,7 @@ // 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 +// 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)] @@ -336,8 +336,6 @@ pub struct Mirror { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Mirror {} @@ -350,8 +348,6 @@ impl<'a, C, A> Mirror client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/mirror/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -383,26 +379,6 @@ impl<'a, C, A> Mirror self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/mirror/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1782,7 +1758,7 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionDeleteCall<'a, C, A> where C: BorrowMut SubscriptionUpdateCall<'a, C, A> where C: BorrowMut SubscriptionListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "subscriptions"; + let mut url = "https://www.googleapis.com/mirror/v1/subscriptions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -2702,7 +2678,7 @@ impl<'a, C, A> TimelineAttachmentListCall<'a, C, A> where C: BorrowMut TimelineInsertCall<'a, C, A> where C: BorrowMut, A let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/mirror/v1/timeline", "multipart") + ("https://www.googleapis.com/upload/mirror/v1/timeline".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/mirror/v1/timeline", "resumable") + ("https://www.googleapis.com/resumable/upload/mirror/v1/timeline".to_string(), "resumable") } else { unreachable!() }; @@ -3291,7 +3267,7 @@ impl<'a, C, A> TimelinePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "timeline/{id}"; + let mut url = "https://www.googleapis.com/mirror/v1/timeline/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -3583,7 +3559,7 @@ impl<'a, C, A> TimelineListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "timeline"; + let mut url = "https://www.googleapis.com/mirror/v1/timeline".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -3840,9 +3816,9 @@ impl<'a, C, A> TimelineAttachmentInsertCall<'a, C, A> where C: BorrowMut TimelineAttachmentDeleteCall<'a, C, A> where C: BorrowMut TimelineDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "timeline/{id}"; + let mut url = "https://www.googleapis.com/mirror/v1/timeline/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -4651,9 +4627,9 @@ impl<'a, C, A> TimelineUpdateCall<'a, C, A> where C: BorrowMut, A let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/mirror/v1/timeline/{id}", "multipart") + ("https://www.googleapis.com/upload/mirror/v1/timeline/{id}".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/mirror/v1/timeline/{id}", "resumable") + ("https://www.googleapis.com/resumable/upload/mirror/v1/timeline/{id}".to_string(), "resumable") } else { unreachable!() }; @@ -5043,7 +5019,7 @@ impl<'a, C, A> TimelineAttachmentGetCall<'a, C, A> where C: BorrowMut TimelineGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "timeline/{id}"; + let mut url = "https://www.googleapis.com/mirror/v1/timeline/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -5523,7 +5499,7 @@ impl<'a, C, A> SettingGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "settings/{id}"; + let mut url = "https://www.googleapis.com/mirror/v1/settings/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -5760,7 +5736,7 @@ impl<'a, C, A> LocationGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "locations/{id}"; + let mut url = "https://www.googleapis.com/mirror/v1/locations/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -5993,7 +5969,7 @@ impl<'a, C, A> LocationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "locations"; + let mut url = "https://www.googleapis.com/mirror/v1/locations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasLocation.as_ref().to_string(), ()); } @@ -6207,7 +6183,7 @@ impl<'a, C, A> AccountInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{userToken}/{accountType}/{accountName}"; + let mut url = "https://www.googleapis.com/mirror/v1/accounts/{userToken}/{accountType}/{accountName}".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -6465,7 +6441,7 @@ impl<'a, C, A> ContactGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "contacts/{id}"; + let mut url = "https://www.googleapis.com/mirror/v1/contacts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -6699,7 +6675,7 @@ impl<'a, C, A> ContactDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "contacts/{id}"; + let mut url = "https://www.googleapis.com/mirror/v1/contacts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -6929,7 +6905,7 @@ impl<'a, C, A> ContactInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "contacts"; + let mut url = "https://www.googleapis.com/mirror/v1/contacts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -7164,7 +7140,7 @@ impl<'a, C, A> ContactPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "contacts/{id}"; + let mut url = "https://www.googleapis.com/mirror/v1/contacts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -7421,7 +7397,7 @@ impl<'a, C, A> ContactListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "contacts"; + let mut url = "https://www.googleapis.com/mirror/v1/contacts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -7632,7 +7608,7 @@ impl<'a, C, A> ContactUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "contacts/{id}"; + let mut url = "https://www.googleapis.com/mirror/v1/contacts/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::GlasTimeline.as_ref().to_string(), ()); } @@ -7821,3 +7797,4 @@ impl<'a, C, A> ContactUpdateCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/ml1_beta1-cli/Cargo.toml b/gen/ml1_beta1-cli/Cargo.toml index 73705dfe73..72f1b57201 100644 --- a/gen/ml1_beta1-cli/Cargo.toml +++ b/gen/ml1_beta1-cli/Cargo.toml @@ -4,9 +4,9 @@ [package] name = "google-ml1_beta1-cli" -version = "1.0.4+20161212" +version = "1.0.4+20170515" authors = ["Sebastian Thiel "] -description = "A complete library to interact with Cloud Machine Learning (protocol v1beta1)" +description = "A complete library to interact with Cloud Machine Learning Engine (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/ml1_beta1-cli" homepage = "https://cloud.google.com/ml/" documentation = "http://byron.github.io/google-apis-rs/google_ml1_beta1_cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-ml1_beta1] path = "../ml1_beta1" -version = "1.0.4+20161212" +version = "1.0.4+20170515" diff --git a/gen/ml1_beta1-cli/README.md b/gen/ml1_beta1-cli/README.md index 37821d3401..91af8e15e3 100644 --- a/gen/ml1_beta1-cli/README.md +++ b/gen/ml1_beta1-cli/README.md @@ -3,14 +3,14 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `ml1-beta1` command-line interface *(CLI)* allows to use most features of the *Google Cloud Machine Learning* service from the comfort of your terminal. +The `ml1-beta1` command-line interface *(CLI)* allows to use most features of the *Google Cloud Machine Learning Engine* service from the comfort of your terminal. By default all output is printed to standard out, but flags can be set to direct it into a file independent of your shell's capabilities. Errors will be printed to standard error, and cause the program's exit code to be non-zero. If data-structures are requested, these will be returned as pretty-printed JSON, to be useful as input to other tools. -Everything else about the *Cloud Machine Learning* API can be found at the +Everything else about the *Cloud Machine Learning Engine* API can be found at the [official documentation site](https://cloud.google.com/ml/). # Installation and Source Code @@ -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* API at revision *20161212*. The CLI is at version *1.0.4*. +This documentation was generated from the *Cloud Machine Learning Engine* API at revision *20170515*. The CLI is at version *1.0.4*. ```bash ml1-beta1 [options] diff --git a/gen/ml1_beta1-cli/mkdocs.yml b/gen/ml1_beta1-cli/mkdocs.yml index 919de4156c..f19b088b8a 100644 --- a/gen/ml1_beta1-cli/mkdocs.yml +++ b/gen/ml1_beta1-cli/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: Cloud Machine Learning v1.0.4+20161212 +site_name: Cloud Machine Learning Engine v1.0.4+20170515 site_url: http://byron.github.io/google-apis-rs/google-ml1_beta1-cli -site_description: A complete library to interact with Cloud Machine Learning (protocol v1beta1) +site_description: A complete library to interact with Cloud Machine Learning Engine (protocol v1beta1) repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/ml1_beta1-cli diff --git a/gen/ml1_beta1-cli/src/main.rs b/gen/ml1_beta1-cli/src/main.rs index de57576019..c75d6997d1 100644 --- a/gen/ml1_beta1-cli/src/main.rs +++ b/gen/ml1_beta1-cli/src/main.rs @@ -39,7 +39,7 @@ enum DoitError { struct Engine<'n> { opt: ArgMatches<'n>, - hub: api::CloudMachineLearning>, + hub: api::CloudMachineLearningEngine>, gp: Vec<&'static str>, gpm: Vec<(&'static str, &'static str)>, } @@ -205,39 +205,46 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "training-output.consumed-ml-units" => Some(("trainingOutput.consumedMlUnits", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "training-output.completed-trial-count" => Some(("trainingOutput.completedTrialCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), - "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "job-id" => Some(("jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "prediction-input.model-name" => Some(("predictionInput.modelName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "prediction-input.input-paths" => Some(("predictionInput.inputPaths", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), - "prediction-input.max-worker-count" => Some(("predictionInput.maxWorkerCount", JsonTypeInfo { jtype: JsonType::Int, 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 })), + "training-output.is-hyperparameter-tuning-job" => Some(("trainingOutput.isHyperparameterTuningJob", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "training-output.consumed-ml-units" => Some(("trainingOutput.consumedMLUnits", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "training-input.worker-type" => Some(("trainingInput.workerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.runtime-version" => Some(("trainingInput.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.scale-tier" => Some(("trainingInput.scaleTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.master-type" => Some(("trainingInput.masterType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.hyperparameters.max-trials" => Some(("trainingInput.hyperparameters.maxTrials", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "training-input.hyperparameters.hyperparameter-metric-tag" => Some(("trainingInput.hyperparameters.hyperparameterMetricTag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.hyperparameters.max-parallel-trials" => Some(("trainingInput.hyperparameters.maxParallelTrials", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "training-input.hyperparameters.goal" => Some(("trainingInput.hyperparameters.goal", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.region" => Some(("trainingInput.region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.args" => Some(("trainingInput.args", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "training-input.python-module" => Some(("trainingInput.pythonModule", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "training-input.job-dir" => Some(("trainingInput.jobDir", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.package-uris" => Some(("trainingInput.packageUris", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "training-input.worker-count" => Some(("trainingInput.workerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "training-input.parameter-server-type" => Some(("trainingInput.parameterServerType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "training-input.parameter-server-count" => Some(("trainingInput.parameterServerCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "prediction-input.model-name" => Some(("predictionInput.modelName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-input.runtime-version" => Some(("predictionInput.runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "prediction-input.region" => Some(("predictionInput.region", 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.input-paths" => Some(("predictionInput.inputPaths", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "error-message" => Some(("errorMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-id" => Some(("jobId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "start-time" => Some(("startTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "end-time" => Some(("endTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "prediction-output.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", "completed-trial-count", "consumed-ml-units", "create-time", "data-format", "end-time", "error-count", "error-message", "goal", "hyperparameters", "input-paths", "job-id", "master-type", "max-parallel-trials", "max-trials", "max-worker-count", "model-name", "output-path", "package-uris", "parameter-server-count", "parameter-server-type", "prediction-count", "prediction-input", "prediction-output", "python-module", "region", "scale-tier", "start-time", "state", "training-input", "training-output", "version-name", "worker-count", "worker-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["args", "completed-trial-count", "consumed-ml-units", "create-time", "data-format", "end-time", "error-count", "error-message", "goal", "hyperparameter-metric-tag", "hyperparameters", "input-paths", "is-hyperparameter-tuning-job", "job-dir", "job-id", "master-type", "max-parallel-trials", "max-trials", "max-worker-count", "model-name", "node-hours", "output-path", "package-uris", "parameter-server-count", "parameter-server-type", "prediction-count", "prediction-input", "prediction-output", "python-module", "region", "runtime-version", "scale-tier", "start-time", "state", "training-input", "training-output", "uri", "version-name", "worker-count", "worker-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -434,16 +441,20 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "regions" => Some(("regions", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "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.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 })), - "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "online-prediction-logging" => Some(("onlinePredictionLogging", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "description" => Some(("description", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "default-version", "deployment-uri", "description", "is-default", "last-use-time", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "default-version", "deployment-uri", "description", "is-default", "last-use-time", "manual-scaling", "name", "nodes", "online-prediction-logging", "regions", "runtime-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -690,13 +701,15 @@ 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 })), + "runtime-version" => Some(("runtimeVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "manual-scaling.nodes" => Some(("manualScaling.nodes", JsonTypeInfo { jtype: JsonType::Int, 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!["create-time", "deployment-uri", "description", "is-default", "last-use-time", "name"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["create-time", "deployment-uri", "description", "is-default", "last-use-time", "manual-scaling", "name", "nodes", "runtime-version"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1431,7 +1444,7 @@ impl<'n> Engine<'n> { }; let engine = Engine { opt: opt, - hub: api::CloudMachineLearning::new(client, auth), + hub: api::CloudMachineLearningEngine::new(client, auth), gp: vec!["$-xgafv", "access-token", "alt", "bearer-token", "callback", "fields", "key", "oauth-token", "pp", "pretty-print", "quota-user", "upload-type", "upload-protocol"], gpm: vec![ ("$-xgafv", "$.xgafv"), @@ -1604,7 +1617,7 @@ fn main() { You must add at least one version before you can request predictions from the model. Add versions by calling - [projects.models.versions.create](/ml/reference/rest/v1beta1/projects.models.versions/create)."##), + [projects.models.versions.create](/ml-engine/reference/rest/v1beta1/projects.models.versions/create)."##), "Details at http://byron.github.io/google-apis-rs/google_ml1_beta1_cli/projects_models-create", vec![ (Some(r##"parent"##), @@ -1638,7 +1651,7 @@ fn main() { You can only delete a model if there are no versions in it. You can delete versions by calling - [projects.models.versions.delete](/ml/reference/rest/v1beta1/projects.models.versions/delete)."##), + [projects.models.versions.delete](/ml-engine/reference/rest/v1beta1/projects.models.versions/delete)."##), "Details at http://byron.github.io/google-apis-rs/google_ml1_beta1_cli/projects_models-delete", vec![ (Some(r##"name"##), @@ -1722,7 +1735,7 @@ fn main() { model. When you add a version to a model that already has one or more versions, the default version does not automatically change. If you want a new version to be the default, you must call - [projects.models.versions.setDefault](/ml/reference/rest/v1beta1/projects.models.versions/setDefault)."##), + [projects.models.versions.setDefault](/ml-engine/reference/rest/v1beta1/projects.models.versions/setDefault)."##), "Details at http://byron.github.io/google-apis-rs/google_ml1_beta1_cli/projects_models-versions-create", vec![ (Some(r##"parent"##), @@ -1765,7 +1778,7 @@ fn main() { None, Some(r##"Required. The name of the version. You can get the names of all the versions of a model by calling - [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list). + [projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list). Authorization: requires `Editor` role on the parent project."##), Some(true), @@ -1787,7 +1800,7 @@ fn main() { Some(r##"Gets information about a model version. Models can have multiple versions. You can call - [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list) + [projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list) to get the same information that this method returns for all of the versions of a model."##), "Details at http://byron.github.io/google-apis-rs/google_ml1_beta1_cli/projects_models-versions-get", @@ -1855,7 +1868,7 @@ fn main() { None, Some(r##"Required. The name of the version to make the default for the model. You can get the names of all the versions of a model by calling - [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list). + [projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list). Authorization: requires `Editor` role on the parent project."##), Some(true), @@ -1988,51 +2001,7 @@ fn main() { ("predict", Some(r##"Performs prediction on the data in the request. - Responses are very similar to requests. There are two top-level fields, - each of which are JSON lists: - -
-
predictions
-
The list of predictions, one per instance in the request.
-
error
-
An error message returned instead of a prediction list if any - instance produced an error.
-
- - 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. - - Even though there is one prediction per instance, the format of a - prediction is not directly related to the format of an instance. - Predictions take whatever format is specified in the outputs collection - defined in the model. The collection of predictions is returned in a JSON - list. Each member of the list can be a simple value, a list, or a JSON - object of any complexity. If your model has more than one output tensor, - each prediction will be a JSON object containing a name/value pair for each - output. The names identify the output aliases in the graph. - - The following examples show some possible responses: - - A simple set of predictions for three input instances, where each - prediction is an integer value: -
-        {"predictions": [5, 4, 3]}
-        
- A more complex set of predictions, each containing two named values that - correspond to output tensors, named **label** and **scores** respectively. - The value of **label** is the predicted category ("car" or "beach") and - **scores** contains a list of probabilities for that instance across the - possible categories. -
-        {"predictions": [{"label": "beach", "scores": [0.1, 0.9]},
-                         {"label": "car", "scores": [0.75, 0.25]}]}
-        
- A response when there is an error processing an input instance: -
-        {"error": "Divide by zero"}
-        
"##), + **** REMOVE FROM GENERATED DOCUMENTATION"##), "Details at http://byron.github.io/google-apis-rs/google_ml1_beta1_cli/projects_predict", vec![ (Some(r##"name"##), @@ -2067,7 +2036,7 @@ fn main() { let mut app = App::new("ml1-beta1") .author("Sebastian Thiel ") - .version("1.0.4+20161212") + .version("1.0.4+20170515") .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_beta1_cli") .arg(Arg::with_name("url") diff --git a/gen/ml1_beta1/Cargo.toml b/gen/ml1_beta1/Cargo.toml index c142f25a3f..0168293b31 100644 --- a/gen/ml1_beta1/Cargo.toml +++ b/gen/ml1_beta1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-ml1_beta1" -version = "1.0.4+20161212" +version = "1.0.4+20170515" authors = ["Sebastian Thiel "] -description = "A complete library to interact with Cloud Machine Learning (protocol v1beta1)" +description = "A complete library to interact with Cloud Machine Learning Engine (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/ml1_beta1" homepage = "https://cloud.google.com/ml/" -documentation = "https://docs.rs/google-ml1_beta1/1.0.4+20161212" +documentation = "https://docs.rs/google-ml1_beta1/1.0.4+20170515" license = "MIT" keywords = ["ml", "google", "protocol", "web", "api"] diff --git a/gen/ml1_beta1/README.md b/gen/ml1_beta1/README.md index 28434fb3c8..46d6c436b0 100644 --- a/gen/ml1_beta1/README.md +++ b/gen/ml1_beta1/README.md @@ -3,18 +3,18 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-ml1_beta1` library allows access to all features of the *Google Cloud Machine Learning* service. +The `google-ml1_beta1` library allows access to all features of the *Google Cloud Machine Learning Engine* service. -This documentation was generated from *Cloud Machine Learning* crate version *1.0.4+20161212*, where *20161212* is the exact revision of the *ml:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Cloud Machine Learning Engine* crate version *1.0.4+20170515*, where *20170515* is the exact revision of the *ml:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. -Everything else about the *Cloud Machine Learning* *v1_beta1* API can be found at the +Everything else about the *Cloud Machine Learning Engine* *v1_beta1* 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_beta1/1.0.4+20161212/google_ml1_beta1/struct.CloudMachineLearning.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.CloudMachineLearningEngine.html) ... * projects - * [*get config*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectGetConfigCall.html), [*jobs cancel*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectJobCancelCall.html), [*jobs create*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectJobCreateCall.html), [*jobs get*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectJobGetCall.html), [*jobs list*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectJobListCall.html), [*models create*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectModelCreateCall.html), [*models delete*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectModelDeleteCall.html), [*models get*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectModelGetCall.html), [*models list*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectModelListCall.html), [*models versions create*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectModelVersionCreateCall.html), [*models versions delete*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectModelVersionDeleteCall.html), [*models versions get*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectModelVersionGetCall.html), [*models versions list*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectModelVersionListCall.html), [*models versions set default*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectModelVersionSetDefaultCall.html), [*operations cancel*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectOperationCancelCall.html), [*operations delete*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectOperationDeleteCall.html), [*operations get*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectOperationGetCall.html), [*operations list*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectOperationListCall.html) and [*predict*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/struct.ProjectPredictCall.html) + * [*get config*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectGetConfigCall.html), [*jobs cancel*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectJobCancelCall.html), [*jobs create*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectJobCreateCall.html), [*jobs get*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectJobGetCall.html), [*jobs list*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectJobListCall.html), [*models create*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectModelCreateCall.html), [*models delete*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectModelDeleteCall.html), [*models get*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectModelGetCall.html), [*models list*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectModelListCall.html), [*models versions create*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectModelVersionCreateCall.html), [*models versions delete*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectModelVersionDeleteCall.html), [*models versions get*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectModelVersionGetCall.html), [*models versions list*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectModelVersionListCall.html), [*models versions set default*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectModelVersionSetDefaultCall.html), [*operations cancel*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectOperationCancelCall.html), [*operations delete*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectOperationDeleteCall.html), [*operations get*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectOperationGetCall.html), [*operations list*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.ProjectOperationListCall.html) and [*predict*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/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_beta1/1.0.4+20161212/google_ml1_beta1/struct.CloudMachineLearning.html)** +* **[Hub](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/struct.CloudMachineLearningEngine.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_beta1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -48,9 +48,9 @@ Or specifically ... ```ignore let r = hub.projects().models_versions_delete(...).doit() -let r = hub.projects().operations_get(...).doit() -let r = hub.projects().models_versions_create(...).doit() let r = hub.projects().models_delete(...).doit() +let r = hub.projects().models_versions_create(...).doit() +let r = hub.projects().operations_get(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -79,7 +79,7 @@ use ml1_beta1::GoogleCloudMlV1beta1__Version; use ml1_beta1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -use ml1_beta1::CloudMachineLearning; +use ml1_beta1::CloudMachineLearningEngine; // Get an ApplicationSecret instance by some means. It contains the `client_id` and // `client_secret`, among other things. @@ -92,7 +92,7 @@ let secret: ApplicationSecret = Default::default(); let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::new(), ::default(), None); -let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); // As the method needs a request, you would usually fill it with the desired information // into the respective structure. Some of the parts shown here might not be applicable ! // Values shown here are possibly random and not representative ! @@ -124,17 +124,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_beta1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_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-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_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-ml1_beta1/1.0.4+20161212/google_ml1_beta1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_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-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_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")`. @@ -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-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_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-ml1_beta1/1.0.4+20170515/google_ml1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_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-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_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-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-ml1_beta1/1.0.4+20161212/google_ml1_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-ml1_beta1/1.0.4+20170515/google_ml1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_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-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_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-ml1_beta1/1.0.4+20161212/google_ml1_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-ml1_beta1/1.0.4+20170515/google_ml1_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-ml1_beta1/1.0.4+20161212/google_ml1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-ml1_beta1/1.0.4+20170515/google_ml1_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/ml1_beta1/src/lib.rs b/gen/ml1_beta1/src/lib.rs index 3b8ae91492..88b888395c 100644 --- a/gen/ml1_beta1/src/lib.rs +++ b/gen/ml1_beta1/src/lib.rs @@ -2,14 +2,14 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Cloud Machine Learning* crate version *1.0.4+20161212*, where *20161212* is the exact revision of the *ml:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Cloud Machine Learning Engine* crate version *1.0.4+20170515*, where *20170515* is the exact revision of the *ml:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! -//! Everything else about the *Cloud Machine Learning* *v1_beta1* API can be found at the +//! Everything else about the *Cloud Machine Learning Engine* *v1_beta1* API can be found at the //! [official documentation site](https://cloud.google.com/ml/). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/ml1_beta1). //! # Features //! -//! Handle the following *Resources* with ease from the central [hub](struct.CloudMachineLearning.html) ... +//! 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 list*](struct.ProjectJobListCall.html), [*models create*](struct.ProjectModelCreateCall.html), [*models delete*](struct.ProjectModelDeleteCall.html), [*models get*](struct.ProjectModelGetCall.html), [*models list*](struct.ProjectModelListCall.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) @@ -23,7 +23,7 @@ //! //! The API is structured into the following primary items: //! -//! * **[Hub](struct.CloudMachineLearning.html)** +//! * **[Hub](struct.CloudMachineLearningEngine.html)** //! * a central object to maintain state and allow accessing all *Activities* //! * creates [*Method Builders*](trait.MethodsBuilder.html) which in turn //! allow access to individual [*Call Builders*](trait.CallBuilder.html) @@ -48,9 +48,9 @@ //! //! ```ignore //! let r = hub.projects().models_versions_delete(...).doit() -//! let r = hub.projects().operations_get(...).doit() -//! let r = hub.projects().models_versions_create(...).doit() //! let r = hub.projects().models_delete(...).doit() +//! let r = hub.projects().models_versions_create(...).doit() +//! let r = hub.projects().operations_get(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -80,7 +80,7 @@ //! # #[test] fn egal() { //! use std::default::Default; //! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -//! use ml1_beta1::CloudMachineLearning; +//! use ml1_beta1::CloudMachineLearningEngine; //! //! // Get an ApplicationSecret instance by some means. It contains the `client_id` and //! // `client_secret`, among other things. @@ -93,7 +93,7 @@ //! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, //! hyper::Client::new(), //! ::default(), None); -//! let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +//! let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); //! // As the method needs a request, you would usually fill it with the desired information //! // into the respective structure. Some of the parts shown here might not be applicable ! //! // Values shown here are possibly random and not representative ! @@ -179,7 +179,7 @@ // 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 +// 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)] @@ -248,7 +248,7 @@ impl Default for Scope { // HUB ### // ###### -/// Central instance to access all CloudMachineLearning related resource activities +/// Central instance to access all CloudMachineLearningEngine related resource activities /// /// # Examples /// @@ -263,7 +263,7 @@ impl Default for Scope { /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use ml1_beta1::CloudMachineLearning; +/// use ml1_beta1::CloudMachineLearningEngine; /// /// // Get an ApplicationSecret instance by some means. It contains the `client_id` and /// // `client_secret`, among other things. @@ -276,7 +276,7 @@ impl Default for Scope { /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// hyper::Client::new(), /// ::default(), None); -/// let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // As the method needs a request, you would usually fill it with the desired information /// // into the respective structure. Some of the parts shown here might not be applicable ! /// // Values shown here are possibly random and not representative ! @@ -306,26 +306,22 @@ impl Default for Scope { /// } /// # } /// ``` -pub struct CloudMachineLearning { +pub struct CloudMachineLearningEngine { client: RefCell, auth: RefCell
, _user_agent: String, - _base_url: String, - _root_url: String, } -impl<'a, C, A> Hub for CloudMachineLearning {} +impl<'a, C, A> Hub for CloudMachineLearningEngine {} -impl<'a, C, A> CloudMachineLearning +impl<'a, C, A> CloudMachineLearningEngine where C: BorrowMut, A: oauth2::GetToken { - pub fn new(client: C, authenticator: A) -> CloudMachineLearning { - CloudMachineLearning { + pub fn new(client: C, authenticator: A) -> CloudMachineLearningEngine { + CloudMachineLearningEngine { client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://ml.googleapis.com/".to_string(), - _root_url: "https://ml.googleapis.com/".to_string(), } } @@ -342,26 +338,6 @@ impl<'a, C, A> CloudMachineLearning self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://ml.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://ml.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -420,6 +396,9 @@ pub struct GoogleCloudMlV1beta1__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, @@ -456,41 +435,6 @@ pub struct GoogleCloudMlV1beta1__HyperparameterOutput { impl Part for GoogleCloudMlV1beta1__HyperparameterOutput {} -/// 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. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [models get projects](struct.ProjectModelGetCall.html) (response) -/// * [models create projects](struct.ProjectModelCreateCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1beta1__Model { - /// 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/reference/rest/v1beta1/projects.models.versions/setDefault). - #[serde(rename="defaultVersion")] - pub default_version: Option, - /// Optional. The description specified for the model when it was created. - pub description: 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, -} - -impl RequestValue for GoogleCloudMlV1beta1__Model {} -impl ResponseResult for GoogleCloudMlV1beta1__Model {} - - /// An observed value of a metric. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -557,6 +501,13 @@ pub struct GoogleCloudMlV1beta1__HyperparameterSpec { /// 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. @@ -581,6 +532,78 @@ pub struct GoogleCloudMlV1beta1__HyperparameterSpec { impl Part for GoogleCloudMlV1beta1__HyperparameterSpec {} +/// Response message for the ListModels method. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [models list projects](struct.ProjectModelListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1beta1__ListModelsResponse { + /// The list of models. + pub models: Option>, + /// Optional. Pass this token as the `page_token` field of the request for a + /// subsequent call. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, +} + +impl ResponseResult for GoogleCloudMlV1beta1__ListModelsResponse {} + + +/// Represents input parameters for a prediction job. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1beta1__PredictionInput { + /// Use this field if you want to use the default version for the specified + /// model. The string must use the following format: + /// + /// `"projects/[YOUR_PROJECT]/models/[YOUR_MODEL]"` + #[serde(rename="modelName")] + pub model_name: Option, + /// Optional. The Google Cloud ML runtime version to use for this batch + /// prediction. If not set, Google Cloud ML will pick the runtime version used + /// during the CreateVersion request for this model version, or choose the + /// latest stable version when model version information is not available + /// such as when the model is specified by uri. + #[serde(rename="runtimeVersion")] + pub runtime_version: Option, + /// Required. The Google Compute Engine region to run the prediction job in. + pub region: Option, + /// Optional. The maximum number of workers to be used for parallel processing. + /// Defaults to 10 if not specified. + #[serde(rename="maxWorkerCount")] + pub max_worker_count: Option, + /// Use this field if you want to specify a Google Cloud Storage path for + /// the model to use. + pub uri: Option, + /// Required. The output Google Cloud Storage location. + #[serde(rename="outputPath")] + pub output_path: Option, + /// Required. The format of the input data files. + #[serde(rename="dataFormat")] + pub data_format: Option, + /// Use this field if you want to specify a version of the model to use. The + /// string is formatted the same way as `model_version`, with the addition + /// of the version information: + /// + /// `"projects/[YOUR_PROJECT]/models/YOUR_MODEL/versions/[YOUR_VERSION]"` + #[serde(rename="versionName")] + pub version_name: Option, + /// Required. The Google Cloud Storage location of the input data files. + /// May contain wildcards. + #[serde(rename="inputPaths")] + pub input_paths: Option>, +} + +impl Part for GoogleCloudMlV1beta1__PredictionInput {} + + /// 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. @@ -639,68 +662,6 @@ pub struct GoogleApi__HttpBody { impl ResponseResult for GoogleApi__HttpBody {} -/// Represents input parameters for a prediction job. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1beta1__PredictionInput { - /// Required. The output Google Cloud Storage location. - #[serde(rename="outputPath")] - pub output_path: Option, - /// Use this field if you want to use the default version for the specified - /// model. The string must use the following format: - /// - /// `"projects/[YOUR_PROJECT]/models/[YOUR_MODEL]"` - #[serde(rename="modelName")] - pub model_name: Option, - /// Required. The format of the input data files. - #[serde(rename="dataFormat")] - pub data_format: Option, - /// Use this field if you want to specify a version of the model to use. The - /// string is formatted the same way as `model_version`, with the addition - /// of the version information: - /// - /// `"projects/[YOUR_PROJECT]/models/YOUR_MODEL/versions/[YOUR_VERSION]"` - #[serde(rename="versionName")] - pub version_name: Option, - /// Required. The Google Cloud Storage location of the input data files. - /// May contain wildcards. - #[serde(rename="inputPaths")] - pub input_paths: Option>, - /// Optional. The maximum number of workers to be used for parallel processing. - /// Defaults to 10 if not specified. - #[serde(rename="maxWorkerCount")] - pub max_worker_count: Option, - /// Required. The Google Compute Engine region to run the prediction job in. - pub region: Option, -} - -impl Part for GoogleCloudMlV1beta1__PredictionInput {} - - -/// Response message for the ListModels method. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [models list projects](struct.ProjectModelListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GoogleCloudMlV1beta1__ListModelsResponse { - /// The list of models. - pub models: Option>, - /// Optional. Pass this token as the `page_token` field of the request for a - /// subsequent call. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, -} - -impl ResponseResult for GoogleCloudMlV1beta1__ListModelsResponse {} - - /// 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: @@ -726,19 +687,24 @@ pub struct GoogleProtobuf__Empty { _never_set: Option } impl ResponseResult for GoogleProtobuf__Empty {} -/// Represents results of a training job. +/// Represents results of a training job. Output only. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudMlV1beta1__TrainingOutput { - /// The amount of ML units consumed by the job. - #[serde(rename="consumedMlUnits")] - pub consumed_ml_units: 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>, } @@ -754,14 +720,17 @@ impl Part for GoogleCloudMlV1beta1__TrainingOutput {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [models versions delete projects](struct.ProjectModelVersionDeleteCall.html) (response) -/// * [operations get projects](struct.ProjectOperationGetCall.html) (response) -/// * [models versions create projects](struct.ProjectModelVersionCreateCall.html) (response) /// * [models delete projects](struct.ProjectModelDeleteCall.html) (response) +/// * [models versions create projects](struct.ProjectModelVersionCreateCall.html) (response) +/// * [operations get projects](struct.ProjectOperationGetCall.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, + /// 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. @@ -779,16 +748,29 @@ pub struct GoogleLongrunning__Operation { /// 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>, + /// The error result of the operation in case of failure or cancellation. + pub error: Option, } impl ResponseResult for GoogleLongrunning__Operation {} +/// Options for manually scaling a model. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1beta1__ManualScaling { + /// The number of nodes to allocate for this model. These nodes are always up, + /// starting from the time the model is deployed, so the cost of operating + /// this model will be proportional to nodes * number of hours since + /// deployment. + pub nodes: Option, +} + +impl Part for GoogleCloudMlV1beta1__ManualScaling {} + + /// Response message for the ListVersions method. /// /// # Activities @@ -811,12 +793,61 @@ pub struct GoogleCloudMlV1beta1__ListVersionsResponse { impl ResponseResult for GoogleCloudMlV1beta1__ListVersionsResponse {} +/// 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. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [models get projects](struct.ProjectModelGetCall.html) (response) +/// * [models create projects](struct.ProjectModelCreateCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GoogleCloudMlV1beta1__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/v1beta1/projects.models.versions/setDefault). + #[serde(rename="defaultVersion")] + pub default_version: Option, + /// Required. The name specified for the model when it was created. + /// + /// The model name must be unique within the project it is created in. + pub name: Option, + /// Optional. If true, enables StackDriver Logging for online prediction. + /// Default is false. + #[serde(rename="onlinePredictionLogging")] + pub online_prediction_logging: Option, + /// Optional. The description specified for the model when it was created. + pub description: Option, +} + +impl RequestValue for GoogleCloudMlV1beta1__Model {} +impl ResponseResult for GoogleCloudMlV1beta1__Model {} + + /// Represents a version of the model. /// /// Each version is a trained model deployed in the cloud, ready to handle /// prediction requests. A model can have multiple versions. You can get /// information about all of the versions of a given model by calling -/// [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list). +/// [projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list). /// /// # Activities /// @@ -831,20 +862,33 @@ impl ResponseResult for GoogleCloudMlV1beta1__ListVersionsResponse {} pub struct GoogleCloudMlV1beta1__Version { /// 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, + /// Optional. The Google Cloud ML runtime version to use for this deployment. + /// If not set, Google Cloud ML will choose a version. + #[serde(rename="runtimeVersion")] + pub runtime_version: Option, + /// Optional. Manually select the number of nodes to use for serving the + /// model. If unset (i.e., by default), the number of nodes used to serve + /// the model automatically scales with traffic. However, care should be + /// taken to ramp up traffic according to the model's ability to scale. If + /// your model needs to handle bursts of traffic beyond it's ability to + /// scale, it is recommended you set this field appropriately. + #[serde(rename="manualScaling")] + pub manual_scaling: Option, + /// Output only. The time the version was last used for prediction. + #[serde(rename="lastUseTime")] + pub last_use_time: Option, /// Required. The Google Cloud Storage location of the trained model used to /// create the version. See the - /// [overview of model deployment](/ml/docs/concepts/deployment-overview) for - /// more informaiton. + /// [overview of model + /// deployment](/ml-engine/docs/concepts/deployment-overview) for more + /// informaiton. /// /// When passing Version to - /// [projects.models.versions.create](/ml/reference/rest/v1beta1/projects.models.versions/create) + /// [projects.models.versions.create](/ml-engine/reference/rest/v1beta1/projects.models.versions/create) /// the model service uses the specified location as the source of the model. /// Once deployed, the model version is hosted by the prediction service, so /// this location is useful only as a historical record. + /// The total number of model files can't exceed 1000. #[serde(rename="deploymentUri")] pub deployment_uri: Option, /// Output only. The time the version was created. @@ -854,12 +898,13 @@ pub struct GoogleCloudMlV1beta1__Version { /// requests that do not specify a version. /// /// You can change the default version by calling - /// [projects.methods.versions.setDefault](/ml/reference/rest/v1beta1/projects.models.versions/setDefault). + /// [projects.methods.versions.setDefault](/ml-engine/reference/rest/v1beta1/projects.models.versions/setDefault). #[serde(rename="isDefault")] pub is_default: Option, - /// Output only. The time the version was last used for prediction. - #[serde(rename="lastUseTime")] - pub last_use_time: 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 GoogleCloudMlV1beta1__Version {} @@ -881,7 +926,7 @@ impl ResponseResult for GoogleCloudMlV1beta1__Version {} /// model's input definition. Instances can include named inputs or can contain /// only unlabeled values. /// -/// Most data does not include named inputs. Some instances will be simple +/// 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: @@ -896,7 +941,13 @@ impl ResponseResult for GoogleCloudMlV1beta1__Version {} /// /// Sentences encoded as lists of words (vectors of strings): ///
-/// {"instances": [["the","quick","brown"], ["la","bruja","le"]]}
+/// {
+///   "instances": [
+///     ["the","quick","brown"],
+///     ["la","bruja","le"],
+///     ...
+///   ]
+/// }
 /// 
/// Floating point scalar values: ///
@@ -904,22 +955,53 @@ impl ResponseResult for GoogleCloudMlV1beta1__Version {}
 /// 
/// Vectors of integers: ///
-/// {"instances": [[0, 1, 2], [3, 4, 5],...]}
+/// {
+///   "instances": [
+///     [0, 1, 2],
+///     [3, 4, 5],
+///     ...
+///   ]
+/// }
 /// 
/// Tensors (in this case, two-dimensional tensors): ///
-/// {"instances": [[[0, 1, 2], [3, 4, 5]], ...]}
+/// {
+///   "instances": [
+///     [
+///       [0, 1, 2],
+///       [3, 4, 5]
+///     ],
+///     ...
+///   ]
+/// }
 /// 
-/// Images represented as a three-dimensional list. In this encoding scheme the -/// first two dimensions represent the rows and columns of the image, and the -/// third contains the R, G, and B values for each pixel. +/// 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], ...]]]]}
+/// {
+///   "instances": [
+///     [
+///       [
+///         [138, 30, 66],
+///         [130, 20, 56],
+///         ...
+///       ],
+///       [
+///         [126, 38, 61],
+///         [122, 24, 57],
+///         ...
+///       ],
+///       ...
+///     ],
+///     ...
+///   ]
+/// }
 /// 
-/// Data must be encoded as UTF-8. If your data uses another character encoding, -/// you must base64 encode the data and mark it as binary. To mark a JSON string -/// as binary, replace it with an object with a single attribute named `b`: -///
{"b": "..."} 
+/// 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): @@ -935,8 +1017,20 @@ impl ResponseResult for GoogleCloudMlV1beta1__Version {} /// /// JSON input data to be preprocessed: ///
-/// {"instances": [{"a": 1.0,  "b": true,  "c": "x"},
-///                {"a": -2.0, "b": false, "c": "y"}]}
+/// {
+///   "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 @@ -945,14 +1039,59 @@ impl ResponseResult for GoogleCloudMlV1beta1__Version {} /// 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"}}]}
+/// {
+///   "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": [[[263, 1, 10], [262, 2, 11], ...]]},
-///                {"tag": "car", "image": [[[10, 11, 24], [23, 10, 15], ...]]}]}
+/// {
+///   "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 @@ -1000,11 +1139,9 @@ pub struct GoogleCloudMlV1beta1__ParameterSpec { /// a HyperparameterSpec message. E.g., "learning_rate". #[serde(rename="parameterName")] pub parameter_name: 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>, /// Required. The type of the parameter. #[serde(rename="type")] pub type_: Option, @@ -1013,9 +1150,11 @@ pub struct GoogleCloudMlV1beta1__ParameterSpec { /// type is `INTEGER`. #[serde(rename="maxValue")] pub max_value: 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, } impl Part for GoogleCloudMlV1beta1__ParameterSpec {} @@ -1033,15 +1172,18 @@ impl Part for GoogleCloudMlV1beta1__ParameterSpec {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GoogleCloudMlV1beta1__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, - /// Output only. The details of a failure or a cancellation. - #[serde(rename="errorMessage")] - pub error_message: 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, @@ -1050,9 +1192,6 @@ pub struct GoogleCloudMlV1beta1__Job { /// Input parameters to create a prediction job. #[serde(rename="predictionInput")] pub prediction_input: Option, - /// Input parameters to create a training job. - #[serde(rename="trainingInput")] - pub training_input: Option, /// Output only. When the job processing was completed. #[serde(rename="endTime")] pub end_time: Option, @@ -1099,6 +1238,10 @@ pub struct GoogleCloudMlV1beta1__TrainingInput { /// `workerCount` is greater than zero. #[serde(rename="workerType")] pub worker_type: Option, + /// Optional. The Google Cloud ML runtime version to use for training. If not + /// set, Google Cloud ML will choose the latest stable version. + #[serde(rename="runtimeVersion")] + pub runtime_version: Option, /// Required. Specifies the machine types, the number of replicas for workers /// and parameter servers. #[serde(rename="scaleTier")] @@ -1136,6 +1279,19 @@ pub struct GoogleCloudMlV1beta1__TrainingInput { /// A machine with roughly twice the number of cores and roughly double the /// memory of complex_model_m. /// + ///
standard_gpu
+ ///
+ /// A machine equivalent to standard that + /// also includes a + /// + /// GPU that you can use in your trainer. + ///
+ ///
complex_model_m_gpu
+ ///
+ /// A machine equivalent to + /// complex_model_m that also includes + /// four GPUs. + ///
/// /// /// You must set this value when `scaleTier` is set to `CUSTOM`. @@ -1150,8 +1306,15 @@ pub struct GoogleCloudMlV1beta1__TrainingInput { /// Required. The Python module name to run after installing the packages. #[serde(rename="pythonModule")] pub python_module: Option, + /// Optional. A Google Cloud Storage path in which to store training outputs + /// and other data needed for training. This path is passed to your TensorFlow + /// program as the 'job_dir' command-line argument. The benefit of specifying + /// this field is that Cloud ML validates the path for use in training. + #[serde(rename="jobDir")] + pub job_dir: Option, /// Required. The Google Cloud Storage location of the packages with /// the training program and any additional dependencies. + /// The maximum number of package URIs is 100. #[serde(rename="packageUris")] pub package_uris: Option>, /// Optional. The number of worker replicas to use for the training job. Each @@ -1201,7 +1364,7 @@ impl Part for GoogleCloudMlV1beta1__TrainingInput {} /// 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` which can be used for common error conditions. +/// in the package `google.rpc` that can be used for common error conditions. /// /// # Language mapping /// @@ -1224,7 +1387,7 @@ impl Part for GoogleCloudMlV1beta1__TrainingInput {} /// errors. /// /// - Workflow errors. A typical workflow has multiple steps. Each step may -/// have a `Status` message for error reporting purpose. +/// 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 @@ -1261,7 +1424,7 @@ impl Part for GoogleRpc__Status {} // ################# /// A builder providing access to all methods supported on *project* resources. -/// It is not used directly, but through the `CloudMachineLearning` hub. +/// It is not used directly, but through the `CloudMachineLearningEngine` hub. /// /// # Example /// @@ -1275,13 +1438,13 @@ impl Part for GoogleRpc__Status {} /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use ml1_beta1::CloudMachineLearning; +/// use ml1_beta1::CloudMachineLearningEngine; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// hyper::Client::new(), /// ::default(), None); -/// let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// let mut hub = CloudMachineLearningEngine::new(hyper::Client::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_list(...)`, `models_create(...)`, `models_delete(...)`, `models_get(...)`, `models_list(...)`, `models_versions_create(...)`, `models_versions_delete(...)`, `models_versions_get(...)`, `models_versions_list(...)`, `models_versions_set_default(...)`, `operations_cancel(...)`, `operations_delete(...)`, `operations_get(...)`, `operations_list(...)` and `predict(...)` /// // to build up your call. @@ -1291,7 +1454,7 @@ impl Part for GoogleRpc__Status {} pub struct ProjectMethods<'a, C, A> where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, } impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} @@ -1351,7 +1514,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// model. When you add a version to a model that already has one or more /// versions, the default version does not automatically change. If you want a /// new version to be the default, you must call - /// [projects.models.versions.setDefault](/ml/reference/rest/v1beta1/projects.models.versions/setDefault). + /// [projects.models.versions.setDefault](/ml-engine/reference/rest/v1beta1/projects.models.versions/setDefault). /// /// # Arguments /// @@ -1426,7 +1589,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `name` - Required. The name of the version. You can get the names of all the /// versions of a model by calling - /// [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list). + /// [projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list). /// Authorization: requires `Editor` role on the parent project. pub fn models_versions_delete(&self, name: &str) -> ProjectModelVersionDeleteCall<'a, C, A> { ProjectModelVersionDeleteCall { @@ -1460,26 +1623,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Designates a version to be the default for the model. + /// Deletes a model. /// - /// The default version is used for prediction requests made against the model - /// that don't specify a version. - /// - /// The first version to be created for a model is automatically set as the - /// default. You must make any subsequent changes to the default version - /// setting manually using this method. + /// You can only delete a model if there are no versions in it. You can delete + /// versions by calling + /// [projects.models.versions.delete](/ml-engine/reference/rest/v1beta1/projects.models.versions/delete). /// /// # Arguments /// - /// * `request` - No description provided. - /// * `name` - Required. The name of the version to make the default for the model. You - /// can get the names of all the versions of a model by calling - /// [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list). + /// * `name` - Required. The name of the model. /// Authorization: requires `Editor` role on the parent project. - pub fn models_versions_set_default(&self, request: GoogleCloudMlV1beta1__SetDefaultVersionRequest, name: &str) -> ProjectModelVersionSetDefaultCall<'a, C, A> { - ProjectModelVersionSetDefaultCall { + pub fn models_delete(&self, name: &str) -> ProjectModelDeleteCall<'a, C, A> { + ProjectModelDeleteCall { hub: self.hub, - _request: request, _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -1491,51 +1647,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// Performs prediction on the data in the request. /// - /// Responses are very similar to requests. There are two top-level fields, - /// each of which are JSON lists: - /// - ///
- ///
predictions
- ///
The list of predictions, one per instance in the request.
- ///
error
- ///
An error message returned instead of a prediction list if any - /// instance produced an error.
- ///
- /// - /// 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. - /// - /// Even though there is one prediction per instance, the format of a - /// prediction is not directly related to the format of an instance. - /// Predictions take whatever format is specified in the outputs collection - /// defined in the model. The collection of predictions is returned in a JSON - /// list. Each member of the list can be a simple value, a list, or a JSON - /// object of any complexity. If your model has more than one output tensor, - /// each prediction will be a JSON object containing a name/value pair for each - /// output. The names identify the output aliases in the graph. - /// - /// The following examples show some possible responses: - /// - /// A simple set of predictions for three input instances, where each - /// prediction is an integer value: - ///
-    /// {"predictions": [5, 4, 3]}
-    /// 
- /// A more complex set of predictions, each containing two named values that - /// correspond to output tensors, named **label** and **scores** respectively. - /// The value of **label** is the predicted category ("car" or "beach") and - /// **scores** contains a list of probabilities for that instance across the - /// possible categories. - ///
-    /// {"predictions": [{"label": "beach", "scores": [0.1, 0.9]},
-    ///                  {"label": "car", "scores": [0.75, 0.25]}]}
-    /// 
- /// A response when there is an error processing an input instance: - ///
-    /// {"error": "Divide by zero"}
-    /// 
+ /// **** REMOVE FROM GENERATED DOCUMENTATION /// /// # Arguments /// @@ -1555,18 +1667,19 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a model. + /// Gets information about a model version. /// - /// You can only delete a model if there are no versions in it. You can delete - /// versions by calling - /// [projects.models.versions.delete](/ml/reference/rest/v1beta1/projects.models.versions/delete). + /// Models can have multiple versions. You can call + /// [projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list) + /// to get the same information that this method returns for all of the + /// versions of a model. /// /// # Arguments /// - /// * `name` - Required. The name of the model. - /// Authorization: requires `Editor` role on the parent project. - pub fn models_delete(&self, name: &str) -> ProjectModelDeleteCall<'a, C, A> { - ProjectModelDeleteCall { + /// * `name` - Required. The name of the version. + /// Authorization: requires `Viewer` role on the parent project. + pub fn models_versions_get(&self, name: &str) -> ProjectModelVersionGetCall<'a, C, A> { + ProjectModelVersionGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -1646,7 +1759,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// You must add at least one version before you can request predictions from /// the model. Add versions by calling - /// [projects.models.versions.create](/ml/reference/rest/v1beta1/projects.models.versions/create). + /// [projects.models.versions.create](/ml-engine/reference/rest/v1beta1/projects.models.versions/create). /// /// # Arguments /// @@ -1666,20 +1779,26 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets information about a model version. + /// Designates a version to be the default for the model. /// - /// Models can have multiple versions. You can call - /// [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list) - /// to get the same information that this method returns for all of the - /// versions of a model. + /// The default version is used for prediction requests made against the model + /// that don't specify a version. + /// + /// The first version to be created for a model is automatically set as the + /// default. You must make any subsequent changes to the default version + /// setting manually using this method. /// /// # Arguments /// - /// * `name` - Required. The name of the version. - /// Authorization: requires `Viewer` role on the parent project. - pub fn models_versions_get(&self, name: &str) -> ProjectModelVersionGetCall<'a, C, A> { - ProjectModelVersionGetCall { + /// * `request` - No description provided. + /// * `name` - Required. The name of the version to make the default for the model. You + /// can get the names of all the versions of a model by calling + /// [projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list). + /// Authorization: requires `Editor` role on the parent project. + pub fn models_versions_set_default(&self, request: GoogleCloudMlV1beta1__SetDefaultVersionRequest, name: &str) -> ProjectModelVersionSetDefaultCall<'a, C, A> { + ProjectModelVersionSetDefaultCall { hub: self.hub, + _request: request, _name: name.to_string(), _delegate: Default::default(), _scopes: Default::default(), @@ -1800,13 +1919,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use ml1_beta1::CloudMachineLearning; +/// # use ml1_beta1::CloudMachineLearningEngine; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::new(), /// # ::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -1820,7 +1939,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { pub struct ProjectOperationListCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _name: String, _page_token: Option, _page_size: Option, @@ -1870,7 +1989,7 @@ impl<'a, C, A> ProjectOperationListCall<'a, C, A> where C: BorrowMut ProjectOperationListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -2101,7 +2220,7 @@ impl<'a, C, A> ProjectOperationListCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -2139,7 +2258,7 @@ impl<'a, C, A> ProjectOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectOperationDeleteCall<'a, C, A> where C: BorrowMut ProjectOperationDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // As the method needs a request, you would usually fill it with the desired information /// // into the respective structure. Some of the parts shown here might not be applicable ! /// // Values shown here are possibly random and not representative ! @@ -2359,7 +2478,7 @@ impl<'a, C, A> ProjectOperationDeleteCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _request: GoogleCloudMlV1beta1__Version, _parent: String, _delegate: Option<&'a mut Delegate>, @@ -2398,7 +2517,7 @@ impl<'a, C, A> ProjectModelVersionCreateCall<'a, C, A> where C: BorrowMut ProjectModelVersionCreateCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -2637,7 +2756,7 @@ impl<'a, C, A> ProjectModelVersionCreateCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _parent: String, _page_token: Option, _page_size: Option, @@ -2683,7 +2802,7 @@ impl<'a, C, A> ProjectModelVersionListCall<'a, C, A> where C: BorrowMut ProjectModelVersionListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -2915,7 +3034,7 @@ impl<'a, C, A> ProjectModelVersionListCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -2953,7 +3072,7 @@ impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut ProjectOperationGetCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -3166,7 +3285,7 @@ impl<'a, C, A> ProjectOperationGetCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -3204,7 +3323,7 @@ impl<'a, C, A> ProjectModelVersionDeleteCall<'a, C, A> where C: BorrowMut ProjectModelVersionDeleteCall<'a, C, A> where C: BorrowMut ProjectModelVersionDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // As the method needs a request, you would usually fill it with the desired information /// // into the respective structure. Some of the parts shown here might not be applicable ! /// // Values shown here are possibly random and not representative ! @@ -3421,7 +3540,7 @@ impl<'a, C, A> ProjectModelVersionDeleteCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _request: GoogleCloudMlV1beta1__Job, _parent: String, _delegate: Option<&'a mut Delegate>, @@ -3460,7 +3579,7 @@ impl<'a, C, A> ProjectJobCreateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/jobs"; + let mut url = "https://ml.googleapis.com/v1beta1/{+parent}/jobs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3660,16 +3779,13 @@ impl<'a, C, A> ProjectJobCreateCall<'a, C, A> where C: BorrowMut, } -/// Designates a version to be the default for the model. +/// Deletes a model. /// -/// The default version is used for prediction requests made against the model -/// that don't specify a version. -/// -/// The first version to be created for a model is automatically set as the -/// default. You must make any subsequent changes to the default version -/// setting manually using this method. +/// You can only delete a model if there are no versions in it. You can delete +/// versions by calling +/// [projects.models.versions.delete](/ml-engine/reference/rest/v1beta1/projects.models.versions/delete). /// -/// A builder for the *models.versions.setDefault* method supported by a *project* resource. +/// A builder for the *models.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -3680,47 +3796,40 @@ impl<'a, C, A> ProjectJobCreateCall<'a, C, A> where C: BorrowMut, /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_ml1_beta1 as ml1_beta1; -/// use ml1_beta1::GoogleCloudMlV1beta1__SetDefaultVersionRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use ml1_beta1::CloudMachineLearning; +/// # use ml1_beta1::CloudMachineLearningEngine; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::new(), /// # ::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = GoogleCloudMlV1beta1__SetDefaultVersionRequest::default(); -/// +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().models_versions_set_default(req, "name") +/// let result = hub.projects().models_delete("name") /// .doit(); /// # } /// ``` -pub struct ProjectModelVersionSetDefaultCall<'a, C, A> +pub struct ProjectModelDeleteCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, - _request: GoogleCloudMlV1beta1__SetDefaultVersionRequest, + hub: &'a CloudMachineLearningEngine, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectModelVersionSetDefaultCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectModelDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1beta1__Version)> { + 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}; @@ -3729,9 +3838,9 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "ml.projects.models.versions.setDefault", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "ml.projects.models.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("name", self._name.to_string())); for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { @@ -3745,7 +3854,7 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut ProjectModelVersionSetDefaultCall<'a, C, A> { - self._request = new_value; - self - } - /// Required. The name of the version to make the default for the model. You - /// can get the names of all the versions of a model by calling - /// [projects.models.versions.list](/ml/reference/rest/v1beta1/projects.models.versions/list). + /// Required. The name of the model. /// /// Authorization: requires `Editor` role on the parent project. /// @@ -3885,7 +3968,7 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut ProjectModelVersionSetDefaultCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectModelDeleteCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -3895,7 +3978,7 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut ProjectModelVersionSetDefaultCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectModelDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -3922,7 +4005,7 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelVersionSetDefaultCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectModelDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -3939,7 +4022,7 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectModelVersionSetDefaultCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectModelDeleteCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -3949,51 +4032,7 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut -///
predictions
-///
The list of predictions, one per instance in the request.
-///
error
-///
An error message returned instead of a prediction list if any -/// instance produced an error.
-/// -/// -/// 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. -/// -/// Even though there is one prediction per instance, the format of a -/// prediction is not directly related to the format of an instance. -/// Predictions take whatever format is specified in the outputs collection -/// defined in the model. The collection of predictions is returned in a JSON -/// list. Each member of the list can be a simple value, a list, or a JSON -/// object of any complexity. If your model has more than one output tensor, -/// each prediction will be a JSON object containing a name/value pair for each -/// output. The names identify the output aliases in the graph. -/// -/// The following examples show some possible responses: -/// -/// A simple set of predictions for three input instances, where each -/// prediction is an integer value: -///
-/// {"predictions": [5, 4, 3]}
-/// 
-/// A more complex set of predictions, each containing two named values that -/// correspond to output tensors, named **label** and **scores** respectively. -/// The value of **label** is the predicted category ("car" or "beach") and -/// **scores** contains a list of probabilities for that instance across the -/// possible categories. -///
-/// {"predictions": [{"label": "beach", "scores": [0.1, 0.9]},
-///                  {"label": "car", "scores": [0.75, 0.25]}]}
-/// 
-/// A response when there is an error processing an input instance: -///
-/// {"error": "Divide by zero"}
-/// 
+/// **** REMOVE FROM GENERATED DOCUMENTATION /// /// A builder for the *predict* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -4010,13 +4049,13 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // As the method needs a request, you would usually fill it with the desired information /// // into the respective structure. Some of the parts shown here might not be applicable ! /// // Values shown here are possibly random and not representative ! @@ -4032,7 +4071,7 @@ impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _request: GoogleCloudMlV1beta1__PredictRequest, _name: String, _delegate: Option<&'a mut Delegate>, @@ -4071,7 +4110,7 @@ impl<'a, C, A> ProjectPredictCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:predict"; + let mut url = "https://ml.googleapis.com/v1beta1/{+name}:predict".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4271,13 +4310,14 @@ impl<'a, C, A> ProjectPredictCall<'a, C, A> where C: BorrowMut, A } -/// Deletes a model. +/// Gets information about a model version. /// -/// You can only delete a model if there are no versions in it. You can delete -/// versions by calling -/// [projects.models.versions.delete](/ml/reference/rest/v1beta1/projects.models.versions/delete). +/// Models can have multiple versions. You can call +/// [projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list) +/// to get the same information that this method returns for all of the +/// versions of a model. /// -/// A builder for the *models.delete* method supported by a *project* resource. +/// A builder for the *models.versions.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -4291,37 +4331,37 @@ impl<'a, C, A> ProjectPredictCall<'a, C, A> where C: BorrowMut, A /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use ml1_beta1::CloudMachineLearning; +/// # use ml1_beta1::CloudMachineLearningEngine; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::new(), /// # ::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().models_delete("name") +/// let result = hub.projects().models_versions_get("name") /// .doit(); /// # } /// ``` -pub struct ProjectModelDeleteCall<'a, C, A> +pub struct ProjectModelVersionGetCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectModelDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectModelVersionGetCall<'a, C, A> {} -impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleLongrunning__Operation)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleCloudMlV1beta1__Version)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -4330,8 +4370,8 @@ impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "ml.projects.models.delete", - http_method: hyper::method::Method::Delete }); + dlg.begin(MethodInfo { id: "ml.projects.models.versions.get", + http_method: hyper::method::Method::Get }); let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); params.push(("name", self._name.to_string())); for &field in ["alt", "name"].iter() { @@ -4346,7 +4386,7 @@ impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut ProjectModelDeleteCall<'a, C, A> where C: BorrowMut ProjectModelDeleteCall<'a, C, A> where C: BorrowMut ProjectModelDeleteCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectModelVersionGetCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -4470,7 +4510,7 @@ impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut ProjectModelDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectModelVersionGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -4497,7 +4537,7 @@ impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectModelVersionGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -4514,7 +4554,7 @@ impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectModelDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectModelVersionGetCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -4541,13 +4581,13 @@ impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -4558,7 +4598,7 @@ impl<'a, C, A> ProjectModelDeleteCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -4596,7 +4636,7 @@ impl<'a, C, A> ProjectGetConfigCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:getConfig"; + let mut url = "https://ml.googleapis.com/v1beta1/{+name}:getConfig".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4788,13 +4828,13 @@ impl<'a, C, A> ProjectGetConfigCall<'a, C, A> where C: BorrowMut, /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use ml1_beta1::CloudMachineLearning; +/// # use ml1_beta1::CloudMachineLearningEngine; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::new(), /// # ::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -4805,7 +4845,7 @@ impl<'a, C, A> ProjectGetConfigCall<'a, C, A> where C: BorrowMut, pub struct ProjectJobGetCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -4843,7 +4883,7 @@ impl<'a, C, A> ProjectJobGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + let mut url = "https://ml.googleapis.com/v1beta1/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5044,13 +5084,13 @@ impl<'a, C, A> ProjectJobGetCall<'a, C, A> where C: BorrowMut, A: /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use ml1_beta1::CloudMachineLearning; +/// # use ml1_beta1::CloudMachineLearningEngine; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::new(), /// # ::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -5061,7 +5101,7 @@ impl<'a, C, A> ProjectJobGetCall<'a, C, A> where C: BorrowMut, A: pub struct ProjectOperationCancelCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -5099,7 +5139,7 @@ impl<'a, C, A> ProjectOperationCancelCall<'a, C, A> where C: BorrowMut ProjectOperationCancelCall<'a, C, A> where C: BorrowMut ProjectOperationCancelCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // As the method needs a request, you would usually fill it with the desired information /// // into the respective structure. Some of the parts shown here might not be applicable ! /// // Values shown here are possibly random and not representative ! @@ -5316,7 +5356,7 @@ impl<'a, C, A> ProjectOperationCancelCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _request: GoogleCloudMlV1beta1__Model, _parent: String, _delegate: Option<&'a mut Delegate>, @@ -5355,7 +5395,7 @@ impl<'a, C, A> ProjectModelCreateCall<'a, C, A> where C: BorrowMut ProjectModelCreateCall<'a, C, A> where C: BorrowMut ProjectModelCreateCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = GoogleCloudMlV1beta1__SetDefaultVersionRequest::default(); +/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().models_versions_get("name") +/// let result = hub.projects().models_versions_set_default(req, "name") /// .doit(); /// # } /// ``` -pub struct ProjectModelVersionGetCall<'a, C, A> +pub struct ProjectModelVersionSetDefaultCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, + _request: GoogleCloudMlV1beta1__SetDefaultVersionRequest, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectModelVersionGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectModelVersionSetDefaultCall<'a, C, A> {} -impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectModelVersionSetDefaultCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -5615,9 +5664,9 @@ impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "ml.projects.models.versions.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "ml.projects.models.versions.setDefault", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("name", self._name.to_string())); for &field in ["alt", "name"].iter() { if self._additional_params.contains_key(field) { @@ -5631,7 +5680,7 @@ impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut ProjectModelVersionSetDefaultCall<'a, C, A> { + self._request = new_value; + self + } + /// Required. The name of the version to make the default for the model. You + /// can get the names of all the versions of a model by calling + /// [projects.models.versions.list](/ml-engine/reference/rest/v1beta1/projects.models.versions/list). /// - /// Authorization: requires `Viewer` role on the parent project. + /// Authorization: requires `Editor` role on the parent 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) -> ProjectModelVersionGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectModelVersionSetDefaultCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -5755,7 +5830,7 @@ impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut ProjectModelVersionGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectModelVersionSetDefaultCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -5782,7 +5857,7 @@ impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectModelVersionGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectModelVersionSetDefaultCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -5799,7 +5874,7 @@ impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectModelVersionGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectModelVersionSetDefaultCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -5823,13 +5898,13 @@ impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -5843,7 +5918,7 @@ impl<'a, C, A> ProjectModelVersionGetCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _parent: String, _page_token: Option, _page_size: Option, @@ -5893,7 +5968,7 @@ impl<'a, C, A> ProjectJobListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/jobs"; + let mut url = "https://ml.googleapis.com/v1beta1/{+parent}/jobs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6114,13 +6189,13 @@ impl<'a, C, A> ProjectJobListCall<'a, C, A> where C: BorrowMut, A /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use ml1_beta1::CloudMachineLearning; +/// # use ml1_beta1::CloudMachineLearningEngine; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::new(), /// # ::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // As the method needs a request, you would usually fill it with the desired information /// // into the respective structure. Some of the parts shown here might not be applicable ! /// // Values shown here are possibly random and not representative ! @@ -6136,7 +6211,7 @@ impl<'a, C, A> ProjectJobListCall<'a, C, A> where C: BorrowMut, A pub struct ProjectJobCancelCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _request: GoogleCloudMlV1beta1__CancelJobRequest, _name: String, _delegate: Option<&'a mut Delegate>, @@ -6175,7 +6250,7 @@ impl<'a, C, A> ProjectJobCancelCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}:cancel"; + let mut url = "https://ml.googleapis.com/v1beta1/{+name}:cancel".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6393,13 +6468,13 @@ impl<'a, C, A> ProjectJobCancelCall<'a, C, A> where C: BorrowMut, /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use ml1_beta1::CloudMachineLearning; +/// # use ml1_beta1::CloudMachineLearningEngine; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::new(), /// # ::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -6410,7 +6485,7 @@ impl<'a, C, A> ProjectJobCancelCall<'a, C, A> where C: BorrowMut, pub struct ProjectModelGetCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _name: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -6448,7 +6523,7 @@ impl<'a, C, A> ProjectModelGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+name}"; + let mut url = "https://ml.googleapis.com/v1beta1/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6643,13 +6718,13 @@ impl<'a, C, A> ProjectModelGetCall<'a, C, A> where C: BorrowMut, /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use ml1_beta1::CloudMachineLearning; +/// # use ml1_beta1::CloudMachineLearningEngine; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::new(), /// # ::default(), None); -/// # let mut hub = CloudMachineLearning::new(hyper::Client::new(), auth); +/// # let mut hub = CloudMachineLearningEngine::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -6662,7 +6737,7 @@ impl<'a, C, A> ProjectModelGetCall<'a, C, A> where C: BorrowMut, pub struct ProjectModelListCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a CloudMachineLearning, + hub: &'a CloudMachineLearningEngine, _parent: String, _page_token: Option, _page_size: Option, @@ -6708,7 +6783,7 @@ impl<'a, C, A> ProjectModelListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+parent}/models"; + let mut url = "https://ml.googleapis.com/v1beta1/{+parent}/models".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6905,3 +6980,4 @@ impl<'a, C, A> ProjectModelListCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/monitoring3-cli/Cargo.toml b/gen/monitoring3-cli/Cargo.toml index 54ea28d546..1fb2504591 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.4+20161212" +version = "1.0.4+20170519" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-monitoring3] path = "../monitoring3" -version = "1.0.4+20161212" +version = "1.0.4+20170519" diff --git a/gen/monitoring3-cli/README.md b/gen/monitoring3-cli/README.md index f5b3237fce..b2793d5338 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 *20161212*. The CLI is at version *1.0.4*. +This documentation was generated from the *Monitoring* API at revision *20170519*. The CLI is at version *1.0.4*. ```bash monitoring3 [options] diff --git a/gen/monitoring3-cli/mkdocs.yml b/gen/monitoring3-cli/mkdocs.yml index eb1b4aa32a..26c9acb414 100644 --- a/gen/monitoring3-cli/mkdocs.yml +++ b/gen/monitoring3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Monitoring v1.0.4+20161212 +site_name: Monitoring v1.0.4+20170519 site_url: http://byron.github.io/google-apis-rs/google-monitoring3-cli site_description: A complete library to interact with Monitoring (protocol v3) diff --git a/gen/monitoring3-cli/src/main.rs b/gen/monitoring3-cli/src/main.rs index 442c48c80d..ad08c366f5 100644 --- a/gen/monitoring3-cli/src/main.rs +++ b/gen/monitoring3-cli/src/main.rs @@ -1611,7 +1611,7 @@ fn main() { let mut app = App::new("monitoring3") .author("Sebastian Thiel ") - .version("1.0.4+20161212") + .version("1.0.4+20170519") .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 7b2ad9a095..a704895ebc 100644 --- a/gen/monitoring3/Cargo.toml +++ b/gen/monitoring3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-monitoring3" -version = "1.0.4+20161212" +version = "1.0.4+20170519" 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.4+20161212" +documentation = "https://docs.rs/google-monitoring3/1.0.4+20170519" license = "MIT" keywords = ["monitoring", "google", "protocol", "web", "api"] diff --git a/gen/monitoring3/README.md b/gen/monitoring3/README.md index d158be7bfa..349cc4659b 100644 --- a/gen/monitoring3/README.md +++ b/gen/monitoring3/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-monitoring3` library allows access to all features of the *Google Monitoring* service. -This documentation was generated from *Monitoring* crate version *1.0.4+20161212*, where *20161212* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Monitoring* crate version *1.0.4+20170519*, where *20170519* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161212/google_monitoring3/struct.Monitoring.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.Monitoring.html) ... * projects - * [*collectd time series create*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectGroupCreateCall.html), [*groups delete*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectGroupDeleteCall.html), [*groups get*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectGroupGetCall.html), [*groups list*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectGroupListCall.html), [*groups members list*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectGroupMemberListCall.html), [*groups update*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectMonitoredResourceDescriptorListCall.html), [*time series create*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectTimeSeryCreateCall.html) and [*time series list*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.ProjectTimeSeryListCall.html) + * [*collectd time series create*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectCollectdTimeSeryCreateCall.html), [*groups create*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectGroupCreateCall.html), [*groups delete*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectGroupDeleteCall.html), [*groups get*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectGroupGetCall.html), [*groups list*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectGroupListCall.html), [*groups members list*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectGroupMemberListCall.html), [*groups update*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectGroupUpdateCall.html), [*metric descriptors create*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectMetricDescriptorCreateCall.html), [*metric descriptors delete*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectMetricDescriptorDeleteCall.html), [*metric descriptors get*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectMetricDescriptorGetCall.html), [*metric descriptors list*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectMetricDescriptorListCall.html), [*monitored resource descriptors get*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectMonitoredResourceDescriptorGetCall.html), [*monitored resource descriptors list*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectMonitoredResourceDescriptorListCall.html), [*time series create*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectTimeSeryCreateCall.html) and [*time series list*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/struct.ProjectTimeSeryListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/struct.Monitoring.html)** +* **[Hub](https://docs.rs/google-monitoring3/1.0.4+20170519/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.4+20161212/google_monitoring3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-monitoring3/1.0.4+20170519/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.4+20161212/google_monitoring3/trait.Part.html)** + * **[Parts](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-monitoring3/1.0.4+20161212/google_monitoring3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-monitoring3/1.0.4+20170519/google_monitoring3/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-monitoring3/1.0.4+20161212/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.4+20170519/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.4+20161212/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.4+20170519/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.4+20161212/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.4+20170519/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.4+20161212/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.4+20170519/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")`. @@ -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-monitoring3/1.0.4+20161212/google_monitoring3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-monitoring3/1.0.4+20161212/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.4+20170519/google_monitoring3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-monitoring3/1.0.4+20170519/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.4+20161212/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.4+20170519/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.4+20161212/google_monitoring3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-monitoring3/1.0.4+20161212/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.4+20170519/google_monitoring3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-monitoring3/1.0.4+20170519/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.4+20161212/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.4+20170519/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.4+20161212/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.4+20170519/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.4+20161212/google_monitoring3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-monitoring3/1.0.4+20170519/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 273b61a0cb..6ed85cf5c7 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.4+20161212*, where *20161212* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Monitoring* crate version *1.0.4+20170519*, where *20170519* is the exact revision of the *monitoring:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Monitoring* *v3* API can be found at the //! [official documentation site](https://cloud.google.com/monitoring/api/). @@ -179,7 +179,7 @@ // 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 +// 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)] @@ -224,14 +224,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 { - /// View monitoring data for all of your Google Cloud and third-party projects - Read, + /// Publish metric data to your Google Cloud projects + Write, /// View and manage your data across Google Cloud Platform services CloudPlatform, - /// Publish metric data to your Google Cloud projects - Write, + /// View monitoring data for all of your Google Cloud and third-party projects + Read, /// View and write monitoring data for all of your Google and third-party Cloud and API projects Full, @@ -240,9 +240,9 @@ pub enum Scope { impl AsRef for Scope { fn as_ref(&self) -> &str { match *self { - Scope::Read => "https://www.googleapis.com/auth/monitoring.read", - Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", Scope::Write => "https://www.googleapis.com/auth/monitoring.write", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", + Scope::Read => "https://www.googleapis.com/auth/monitoring.read", Scope::Full => "https://www.googleapis.com/auth/monitoring", } } @@ -322,8 +322,6 @@ pub struct Monitoring { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Monitoring {} @@ -336,8 +334,6 @@ impl<'a, C, A> Monitoring client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://monitoring.googleapis.com/".to_string(), - _root_url: "https://monitoring.googleapis.com/".to_string(), } } @@ -354,26 +350,6 @@ impl<'a, C, A> Monitoring self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://monitoring.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://monitoring.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -490,18 +466,18 @@ pub struct TypedValue { /// A Boolean value: true or false. #[serde(rename="boolValue")] pub bool_value: Option, - /// A 64-bit integer. Its range is approximately ±9.2x1018. - #[serde(rename="int64Value")] - pub int64_value: Option, /// A 64-bit double-precision floating-point number. Its magnitude is approximately ±10±300 and it has 16 significant digits of precision. #[serde(rename="doubleValue")] pub double_value: Option, + /// A 64-bit integer. Its range is approximately ±9.2x1018. + #[serde(rename="int64Value")] + pub int64_value: Option, } impl Part for TypedValue {} -/// Specify a 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.Defines num_finite_buckets + 2 (= N) buckets with these boundaries for bucket i:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). +/// Specifies an exponential sequence of buckets that have a width that is proportional to the value of the lower bound. Each bucket represents a constant relative uncertainty on a specific value in the bucket.There are num_finite_buckets + 2 (= N) buckets. Bucket i has the following boundaries:Upper bound (0 <= i < N-1): scale * (growth_factor ^ i). Lower bound (1 <= i < N): scale * (growth_factor ^ (i - 1)). /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -552,7 +528,7 @@ pub struct CollectdPayload { impl Part for CollectdPayload {} -/// A set of buckets with arbitrary widths.Defines size(bounds) + 1 (= N) buckets with these boundaries for bucket i:Upper bound (0 <= i < N-1): boundsi Lower bound (1 <= i < N); boundsi - 1There must be at least one element in bounds. If bounds has only one element, there are no finite buckets, and that single element is the common boundary of the overflow and underflow buckets. +/// 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. /// @@ -575,9 +551,9 @@ impl Part for Explicit {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MonitoredResource { - /// Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Cloud SQL databases use the labels "database_id" and "zone". + /// 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". pub labels: Option>, - /// Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Cloud SQL database is "cloudsql_database". + /// 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. #[serde(rename="type")] pub type_: Option, } @@ -632,7 +608,7 @@ pub struct TimeSeries { pub metric: Option, /// The data points of this time series. When listing time series, the order of the points is specified by the list method.When creating a time series, this field must contain exactly one point and the point's type must be the same as the value type of the associated metric. If the associated metric's descriptor must be auto-created, then the value type of the descriptor is determined by the point's type, which must be BOOL, INT64, DOUBLE, or DISTRIBUTION. pub points: Option>, - /// The associated resource. A fully-specified monitored resource used to identify the time series. + /// 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")] @@ -642,15 +618,15 @@ pub struct TimeSeries { impl Part for TimeSeries {} -/// Distribution contains summary statistics for a population of values and, optionally, a histogram representing the distribution of those values across a specified set of histogram 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 specifying parameters for a method of computing them (buckets of fixed width or buckets of exponentially increasing width).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. +/// Distribution contains summary statistics for a population of values. It optionally contains a histogram representing the distribution of those values across a set of buckets.The summary statistics are the count, mean, sum of the squared deviation from the mean, the minimum, and the maximum of the set of population of values. The histogram is based on a sequence of buckets and gives a count of values that fall into each bucket. The boundaries of the buckets are given either explicitly or by formulas for buckets of fixed or exponentially increasing widths.Although it is not forbidden, it is generally a bad idea to include non-finite values (infinities or NaNs) in the population of values, as this will render the mean and sum_of_squared_deviation fields meaningless. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Distribution { - /// The number of values in the population. Must be non-negative. + /// The number of values in the population. Must be non-negative. This value must equal the sum of the values in bucket_counts if a histogram is provided. pub count: Option, - /// If bucket_options is given, then the sum of the values in bucket_counts must equal the value in count. If bucket_options is not given, no bucket_counts fields may be given.Bucket counts are given in order under the numbering scheme described above (the underflow bucket has number 0; the finite buckets, if any, have numbers 1 through N-2; the overflow bucket has number N-1).The size of bucket_counts must be no greater than N as defined in bucket_options.Any suffix of trailing zero bucket_count fields may be omitted. + /// Required in the Stackdriver Monitoring API v3. The values for each bucket specified in bucket_options. The sum of the values in bucketCounts must equal the value in the count field of the Distribution object. The order of the bucket counts follows the numbering schemes described for the three bucket types. The underflow bucket has number 0; the finite buckets, if any, have numbers 1 through N-2; and the overflow bucket has number N-1. The size of bucket_counts must not be greater than N. If the size is less than N, then the remaining buckets are assigned values of zero. #[serde(rename="bucketCounts")] pub bucket_counts: Option>, /// The sum of squared deviations from the mean of the values in the population. For values x_i this is: @@ -660,7 +636,7 @@ pub struct Distribution { pub sum_of_squared_deviation: Option, /// If specified, contains the range of the population values. The field must not be present if the count is zero. This field is presently ignored by the Stackdriver Monitoring API v3. pub range: Option, - /// Defines the histogram bucket boundaries. + /// Required in the Stackdriver Monitoring API v3. Defines the histogram bucket boundaries. #[serde(rename="bucketOptions")] pub bucket_options: Option, /// The arithmetic mean of the values in the population. If count is zero then this field must be zero. @@ -714,7 +690,7 @@ pub struct ListTimeSeriesResponse { impl ResponseResult for ListTimeSeriesResponse {} -/// Specify a 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.Defines num_finite_buckets + 2 (= N) buckets with these boundaries for bucket i:Upper bound (0 <= i < N-1): offset + (width * i). Lower bound (1 <= i < N): offset + (width * (i - 1)). +/// 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. /// @@ -757,7 +733,7 @@ pub struct MetricDescriptor { 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 metric types have the DNS name custom.googleapis.com. Metric types should use a natural hierarchical grouping. For example: + /// 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" /// @@ -804,8 +780,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 123456789: - /// "projects/123456789/metricDescriptors/custom.googleapis.com%2Finvoice%2Fpaid%2Famount" + /// 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, } @@ -845,7 +821,7 @@ pub struct Point { impl Part for Point {} -/// A Distribution may optionally contain a histogram of the values in the population. The histogram is given in bucket_counts as counts of values that fall into one of a sequence of non-overlapping buckets. The sequence of buckets is described by bucket_options.A bucket specifies an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket is strictly greater than the lower bound.The sequence of N buckets for a Distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite.BucketOptions describes bucket boundaries in one of three ways. Two describe the boundaries by giving parameters for a formula to generate boundaries and one gives the bucket boundaries explicitly.If bucket_options is not given, then no bucket_counts may be given. +/// BucketOptions describes the bucket boundaries used to create a histogram for the distribution. The buckets can be in a linear sequence, an exponential sequence, or each bucket can be specified explicitly. BucketOptions does not include the number of values in each bucket.A bucket has an inclusive lower bound and exclusive upper bound for the values that are counted for that bucket. The upper bound of a bucket must be strictly greater than the lower bound. The sequence of N buckets for a distribution consists of an underflow bucket (number 0), zero or more finite buckets (number 1 through N - 2) and an overflow bucket (number N - 1). The buckets are contiguous: the lower bound of bucket i (i > 0) is the same as the upper bound of bucket i - 1. The buckets span the whole range of finite values: lower bound of the underflow bucket is -infinity and the upper bound of the overflow bucket is +infinity. The finite buckets are so-called because both bounds are finite. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -886,7 +862,7 @@ pub struct ListGroupsResponse { impl ResponseResult for ListGroupsResponse {} -/// The ListMonitoredResourcDescriptors response. +/// The ListMonitoredResourceDescriptors response. /// /// # Activities /// @@ -988,10 +964,10 @@ pub struct MonitoredResourceDescriptor { /// Required. The monitored resource type. For example, the type "cloudsql_database" represents databases in Google Cloud SQL. The maximum length of this value is 256 characters. #[serde(rename="type")] pub type_: Option, - /// Optional. A detailed description of the monitored resource type that might be used in documentation. - pub description: Option, /// Optional. The resource name of the monitored resource descriptor: "projects/{project_id}/monitoredResourceDescriptors/{type}" where {type} is the value of the type field in this object and {project_id} is a project ID that provides API-specific context for accessing the type. APIs that do not use project information can use the resource name format "monitoredResourceDescriptors/{type}". pub name: Option, + /// Optional. A detailed description of the monitored resource type that might be used in documentation. + pub description: Option, } impl ResponseResult for MonitoredResourceDescriptor {} @@ -1042,13 +1018,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets a single metric descriptor. This method does not require a Stackdriver account. + /// Deletes a metric descriptor. Only user-created custom metrics can be deleted. /// /// # Arguments /// - /// * `name` - 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". - pub fn metric_descriptors_get(&self, name: &str) -> ProjectMetricDescriptorGetCall<'a, C, A> { - ProjectMetricDescriptorGetCall { + /// * `name` - 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". + pub fn metric_descriptors_delete(&self, name: &str) -> ProjectMetricDescriptorDeleteCall<'a, C, A> { + ProjectMetricDescriptorDeleteCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -1096,13 +1072,13 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes a metric descriptor. Only user-created custom metrics can be deleted. + /// Gets a single metric descriptor. This method does not require a Stackdriver account. /// /// # Arguments /// - /// * `name` - 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". - pub fn metric_descriptors_delete(&self, name: &str) -> ProjectMetricDescriptorDeleteCall<'a, C, A> { - ProjectMetricDescriptorDeleteCall { + /// * `name` - 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". + pub fn metric_descriptors_get(&self, name: &str) -> ProjectMetricDescriptorGetCall<'a, C, A> { + ProjectMetricDescriptorGetCall { hub: self.hub, _name: name.to_string(), _delegate: Default::default(), @@ -1343,9 +1319,9 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { // CallBuilders ### // ################# -/// Gets a single metric descriptor. This method does not require a Stackdriver account. +/// Deletes a metric descriptor. Only user-created custom metrics can be deleted. /// -/// A builder for the *metricDescriptors.get* method supported by a *project* resource. +/// A builder for the *metricDescriptors.delete* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -1369,11 +1345,11 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.projects().metric_descriptors_get("name") +/// let result = hub.projects().metric_descriptors_delete("name") /// .doit(); /// # } /// ``` -pub struct ProjectMetricDescriptorGetCall<'a, C, A> +pub struct ProjectMetricDescriptorDeleteCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Monitoring, @@ -1383,13 +1359,13 @@ pub struct ProjectMetricDescriptorGetCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectMetricDescriptorGetCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectMetricDescriptorDeleteCall<'a, C, A> {} -impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectMetricDescriptorDeleteCall<'a, C, 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)> { + 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}; @@ -1398,8 +1374,8 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "monitoring.projects.metricDescriptors.get", - http_method: hyper::method::Method::Get }); + dlg.begin(MethodInfo { id: "monitoring.projects.metricDescriptors.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() { @@ -1414,7 +1390,7 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorGetCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectMetricDescriptorDeleteCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -1536,7 +1512,7 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorGetCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectMetricDescriptorDeleteCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -1563,7 +1539,7 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricDescriptorGetCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectMetricDescriptorDeleteCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -1580,7 +1556,7 @@ impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectMetricDescriptorGetCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectMetricDescriptorDeleteCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -1671,7 +1647,7 @@ impl<'a, C, A> ProjectGroupCreateCall<'a, C, A> where C: BorrowMut ProjectGroupGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v3/{+name}"; + let mut url = "https://monitoring.googleapis.com/v3/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2121,9 +2097,9 @@ impl<'a, C, A> ProjectGroupGetCall<'a, C, A> where C: BorrowMut, } -/// Deletes a metric descriptor. Only user-created custom metrics can be deleted. +/// Gets a single metric descriptor. This method does not require a Stackdriver account. /// -/// A builder for the *metricDescriptors.delete* method supported by a *project* resource. +/// A builder for the *metricDescriptors.get* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. /// /// # Example @@ -2147,11 +2123,11 @@ impl<'a, C, A> ProjectGroupGetCall<'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.projects().metric_descriptors_delete("name") +/// let result = hub.projects().metric_descriptors_get("name") /// .doit(); /// # } /// ``` -pub struct ProjectMetricDescriptorDeleteCall<'a, C, A> +pub struct ProjectMetricDescriptorGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Monitoring, @@ -2161,13 +2137,13 @@ pub struct ProjectMetricDescriptorDeleteCall<'a, C, A> _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ProjectMetricDescriptorDeleteCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ProjectMetricDescriptorGetCall<'a, C, A> {} -impl<'a, C, A> ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ProjectMetricDescriptorGetCall<'a, C, 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, MetricDescriptor)> { use url::percent_encoding::{percent_encode, DEFAULT_ENCODE_SET}; use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; @@ -2176,8 +2152,8 @@ impl<'a, C, A> ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "monitoring.projects.metricDescriptors.delete", - http_method: hyper::method::Method::Delete }); + dlg.begin(MethodInfo { id: "monitoring.projects.metricDescriptors.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() { @@ -2192,7 +2168,7 @@ impl<'a, C, A> ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorDeleteCall<'a, C, A> { + pub fn name(mut self, new_value: &str) -> ProjectMetricDescriptorGetCall<'a, C, A> { self._name = new_value.to_string(); self } @@ -2314,7 +2290,7 @@ impl<'a, C, A> ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorDeleteCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectMetricDescriptorGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -2341,7 +2317,7 @@ impl<'a, C, A> ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectMetricDescriptorDeleteCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ProjectMetricDescriptorGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -2358,7 +2334,7 @@ impl<'a, C, A> ProjectMetricDescriptorDeleteCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ProjectMetricDescriptorDeleteCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ProjectMetricDescriptorGetCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -2444,7 +2420,7 @@ impl<'a, C, A> ProjectCollectdTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectGroupMemberListCall<'a, C, A> where C: BorrowMut ProjectMonitoredResourceDescriptorListCall<'a, C, A> where C: Bor params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v3/{+name}/monitoredResourceDescriptors"; + let mut url = "https://monitoring.googleapis.com/v3/{+name}/monitoredResourceDescriptors".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3310,7 +3286,7 @@ impl<'a, C, A> ProjectTimeSeryCreateCall<'a, C, A> where C: BorrowMut ProjectMetricDescriptorCreateCall<'a, C, A> where C: BorrowMut ProjectGroupListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v3/{+name}/groups"; + let mut url = "https://monitoring.googleapis.com/v3/{+name}/groups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4175,7 +4151,7 @@ impl<'a, C, A> ProjectMetricDescriptorListCall<'a, C, A> where C: BorrowMut 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 = "https://monitoring.googleapis.com/v3/{+name}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4700,7 +4676,7 @@ impl<'a, C, A> ProjectGroupUpdateCall<'a, C, A> where C: BorrowMut ProjectGroupDeleteCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut ProjectTimeSeryListCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Pagespeedonline {} @@ -297,8 +295,6 @@ impl<'a, C, A> Pagespeedonline client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/pagespeedonline/v2/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -315,26 +311,6 @@ impl<'a, C, A> Pagespeedonline self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/pagespeedonline/v2/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -827,7 +803,7 @@ impl<'a, C, A> PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut PagespeedapiRunpagespeedCall<'a, C, A> where C: BorrowMut"] -description = "A complete library to interact with partners (protocol v2)" +description = "A complete library to interact with Partners (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/partners2-cli" homepage = "https://developers.google.com/partners/" documentation = "http://byron.github.io/google-apis-rs/google_partners2_cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-partners2] path = "../partners2" -version = "1.0.4+20151009" +version = "1.0.4+20170503" diff --git a/gen/partners2-cli/README.md b/gen/partners2-cli/README.md index 32c0be0404..7ca956176d 100644 --- a/gen/partners2-cli/README.md +++ b/gen/partners2-cli/README.md @@ -3,14 +3,14 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `partners2` command-line interface *(CLI)* allows to use most features of the *Google partners* service from the comfort of your terminal. +The `partners2` command-line interface *(CLI)* allows to use most features of the *Google Partners* 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 *partners* API can be found at the +Everything else about the *Partners* API can be found at the [official documentation site](https://developers.google.com/partners/). # Installation and Source Code @@ -25,20 +25,38 @@ 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 *20151009*. The CLI is at version *1.0.4*. +This documentation was generated from the *Partners* API at revision *20170503*. The CLI is at version *1.0.4*. ```bash partners2 [options] + analytics + list [-p ]... [-o ] client-messages log (-r )... [-p ]... [-o ] companies get [-p ]... [-o ] leads-create (-r )... [-p ]... [-o ] list [-p ]... [-o ] + exams + get-token [-p ]... [-o ] + leads + list [-p ]... [-o ] + methods + get-partnersstatus [-p ]... [-o ] + update-companies (-r )... [-p ]... [-o ] + update-leads (-r )... [-p ]... [-o ] + offers + history-list [-p ]... [-o ] + list [-p ]... [-o ] user-events log (-r )... [-p ]... [-o ] user-states list [-p ]... [-o ] + users + create-company-relation (-r )... [-p ]... [-o ] + delete-company-relation [-p ]... [-o ] + get [-p ]... [-o ] + update-profile (-r )... [-p ]... [-o ] partners2 --help Configuration: diff --git a/gen/partners2-cli/mkdocs.yml b/gen/partners2-cli/mkdocs.yml index 61ec40f526..fc686304eb 100644 --- a/gen/partners2-cli/mkdocs.yml +++ b/gen/partners2-cli/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: partners v1.0.4+20151009 +site_name: Partners v1.0.4+20170503 site_url: http://byron.github.io/google-apis-rs/google-partners2-cli -site_description: A complete library to interact with partners (protocol v2) +site_description: A complete library to interact with Partners (protocol v2) repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/partners2-cli @@ -9,12 +9,24 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['analytics_list.md', 'Analytics', 'List'] - ['client-messages_log.md', 'Client Messages', 'Log'] - ['companies_get.md', 'Companies', 'Get'] - ['companies_leads-create.md', 'Companies', 'Leads Create'] - ['companies_list.md', 'Companies', 'List'] +- ['exams_get-token.md', 'Exams', 'Get Token'] +- ['leads_list.md', 'Leads', 'List'] +- ['methods_get-partnersstatus.md', 'Methods', 'Get Partnersstatus'] +- ['methods_update-companies.md', 'Methods', 'Update Companies'] +- ['methods_update-leads.md', 'Methods', 'Update Leads'] +- ['offers_history-list.md', 'Offers', 'History List'] +- ['offers_list.md', 'Offers', 'List'] - ['user-events_log.md', 'User Events', 'Log'] - ['user-states_list.md', 'User States', 'List'] +- ['users_create-company-relation.md', 'Users', 'Create Company Relation'] +- ['users_delete-company-relation.md', 'Users', 'Delete Company Relation'] +- ['users_get.md', 'Users', 'Get'] +- ['users_update-profile.md', 'Users', 'Update Profile'] theme: readthedocs diff --git a/gen/partners2-cli/src/main.rs b/gen/partners2-cli/src/main.rs index 6c9c76e61e..5573fff9ca 100644 --- a/gen/partners2-cli/src/main.rs +++ b/gen/partners2-cli/src/main.rs @@ -46,6 +46,83 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _analytics_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.analytics().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 { + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_ids(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(["request-metadata-user-overrides-user-id", "page-size", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "page-token", "request-metadata-traffic-source-traffic-sub-id", "request-metadata-locale", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-source-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _client_messages_log(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -69,7 +146,6 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { - "client-info" => Some(("clientInfo", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "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 })), @@ -77,6 +153,7 @@ impl<'n> Engine<'n> { "request-metadata.user-overrides.user-id" => Some(("requestMetadata.userOverrides.userId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "request-metadata.user-overrides.ip-address" => Some(("requestMetadata.userOverrides.ipAddress", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "request-metadata.experiment-ids" => Some(("requestMetadata.experimentIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "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 })), _ => { @@ -252,20 +329,25 @@ impl<'n> Engine<'n> { "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 })), + "lead.create-time" => Some(("lead.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.family-name" => Some(("lead.familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "lead.min-monthly-budget.units" => Some(("lead.minMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.min-monthly-budget.nanos" => Some(("lead.minMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "lead.min-monthly-budget.units" => Some(("lead.minMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.min-monthly-budget.currency-code" => Some(("lead.minMonthlyBudget.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.comments" => Some(("lead.comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.email" => Some(("lead.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.website-url" => Some(("lead.websiteUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lead.state" => Some(("lead.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.phone-number" => Some(("lead.phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "lead.given-name" => Some(("lead.givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.type" => Some(("lead.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lead.given-name" => Some(("lead.givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["comments", "currency-code", "email", "experiment-ids", "family-name", "given-name", "gps-motivations", "id", "ip-address", "lead", "locale", "min-monthly-budget", "nanos", "partners-session-id", "phone-number", "recaptcha-challenge", "request-metadata", "response", "traffic-source", "traffic-source-id", "traffic-sub-id", "type", "units", "user-id", "user-overrides", "website-url"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["adwords-customer-id", "comments", "create-time", "currency-code", "email", "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", "recaptcha-challenge", "request-metadata", "response", "state", "traffic-source", "traffic-source-id", "traffic-sub-id", "type", "units", "user-id", "user-overrides", "website-url"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -334,6 +416,9 @@ impl<'n> Engine<'n> { "view" => { call = call.view(value.unwrap_or("")); }, + "specializations" => { + call = call.add_specializations(value.unwrap_or("")); + }, "services" => { call = call.add_services(value.unwrap_or("")); }, @@ -413,7 +498,646 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["order-by", "page-size", "request-metadata-partners-session-id", "max-monthly-budget-currency-code", "max-monthly-budget-nanos", "language-codes", "min-monthly-budget-nanos", "request-metadata-traffic-source-traffic-sub-id", "industries", "min-monthly-budget-currency-code", "min-monthly-budget-units", "page-token", "request-metadata-locale", "request-metadata-traffic-source-traffic-source-id", "company-name", "address", "services", "request-metadata-experiment-ids", "gps-motivations", "request-metadata-user-overrides-ip-address", "website-url", "request-metadata-user-overrides-user-id", "view", "max-monthly-budget-units"].iter().map(|v|*v)); + v.extend(["order-by", "page-size", "request-metadata-partners-session-id", "max-monthly-budget-currency-code", "max-monthly-budget-nanos", "language-codes", "min-monthly-budget-units", "request-metadata-traffic-source-traffic-sub-id", "industries", "min-monthly-budget-currency-code", "min-monthly-budget-nanos", "page-token", "request-metadata-locale", "specializations", "request-metadata-traffic-source-traffic-source-id", "company-name", "address", "services", "request-metadata-experiment-ids", "gps-motivations", "request-metadata-user-overrides-ip-address", "website-url", "request-metadata-user-overrides-user-id", "view", "max-monthly-budget-units"].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 _exams_get_token(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.exams().get_token(opt.value_of("exam-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 { + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_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(["request-metadata-user-overrides-user-id", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "request-metadata-traffic-source-traffic-sub-id", "request-metadata-locale", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-source-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _leads_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.leads().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 { + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_ids(value.unwrap_or("")); + }, + "page-token" => { + call = call.page_token(value.unwrap_or("")); + }, + "page-size" => { + call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); + }, + "order-by" => { + call = call.order_by(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["order-by", "request-metadata-user-overrides-user-id", "page-size", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "page-token", "request-metadata-traffic-source-traffic-sub-id", "request-metadata-locale", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-source-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _methods_get_partnersstatus(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.methods().get_partnersstatus(); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_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(["request-metadata-user-overrides-user-id", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "request-metadata-traffic-source-traffic-sub-id", "request-metadata-locale", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-source-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _methods_update_companies(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "company-types" => Some(("companyTypes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "original-min-monthly-budget.nanos" => Some(("originalMinMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "original-min-monthly-budget.units" => Some(("originalMinMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "original-min-monthly-budget.currency-code" => Some(("originalMinMonthlyBudget.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "auto-approval-email-domains" => Some(("autoApprovalEmailDomains", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "badge-tier" => Some(("badgeTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "profile-status" => Some(("profileStatus", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-adwords-manager-account-id" => Some(("primaryAdwordsManagerAccountId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "website-url" => Some(("websiteUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "services" => Some(("services", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "additional-websites" => Some(("additionalWebsites", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "industries" => Some(("industries", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "primary-location.language-code" => Some(("primaryLocation.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-location.address-line" => Some(("primaryLocation.addressLine", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "primary-location.dependent-locality" => Some(("primaryLocation.dependentLocality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-location.sorting-code" => Some(("primaryLocation.sortingCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-location.lat-lng.latitude" => Some(("primaryLocation.latLng.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "primary-location.lat-lng.longitude" => Some(("primaryLocation.latLng.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "primary-location.locality" => Some(("primaryLocation.locality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-location.region-code" => Some(("primaryLocation.regionCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-location.administrative-area" => Some(("primaryLocation.administrativeArea", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-location.address" => Some(("primaryLocation.address", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-location.postal-code" => Some(("primaryLocation.postalCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "public-profile.url" => Some(("publicProfile.url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "public-profile.profile-image" => Some(("publicProfile.profileImage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "public-profile.display-image-url" => Some(("publicProfile.displayImageUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "public-profile.display-name" => Some(("publicProfile.displayName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "public-profile.id" => Some(("publicProfile.id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "converted-min-monthly-budget.nanos" => Some(("convertedMinMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "converted-min-monthly-budget.units" => Some(("convertedMinMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "converted-min-monthly-budget.currency-code" => Some(("convertedMinMonthlyBudget.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "primary-language-code" => Some(("primaryLanguageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["additional-websites", "address", "address-line", "administrative-area", "auto-approval-email-domains", "badge-tier", "company-types", "converted-min-monthly-budget", "currency-code", "dependent-locality", "display-image-url", "display-name", "id", "industries", "language-code", "lat-lng", "latitude", "locality", "longitude", "name", "nanos", "original-min-monthly-budget", "postal-code", "primary-adwords-manager-account-id", "primary-language-code", "primary-location", "profile-image", "profile-status", "public-profile", "region-code", "services", "sorting-code", "units", "url", "website-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::Company = json::value::from_value(object).unwrap(); + let mut call = self.hub.methods().update_companies(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 { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_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(["request-metadata-locale", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "request-metadata-traffic-source-traffic-source-id", "request-metadata-user-overrides-user-id", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-sub-id", "update-mask"].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 _methods_update_leads(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "marketing-opt-in" => Some(("marketingOptIn", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "language-code" => Some(("languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "gps-motivations" => Some(("gpsMotivations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "create-time" => Some(("createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "family-name" => Some(("familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "min-monthly-budget.nanos" => Some(("minMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "min-monthly-budget.units" => Some(("minMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "min-monthly-budget.currency-code" => Some(("minMonthlyBudget.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "comments" => Some(("comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "email" => Some(("email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "website-url" => Some(("websiteUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "phone-number" => Some(("phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "type" => Some(("type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "given-name" => Some(("givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "adwords-customer-id" => Some(("adwordsCustomerId", 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!["adwords-customer-id", "comments", "create-time", "currency-code", "email", "family-name", "given-name", "gps-motivations", "id", "language-code", "marketing-opt-in", "min-monthly-budget", "nanos", "phone-number", "state", "type", "units", "website-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::Lead = json::value::from_value(object).unwrap(); + let mut call = self.hub.methods().update_leads(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 { + "update-mask" => { + call = call.update_mask(value.unwrap_or("")); + }, + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_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(["request-metadata-locale", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "request-metadata-traffic-source-traffic-source-id", "request-metadata-user-overrides-user-id", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-sub-id", "update-mask"].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 _offers_history_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.offers().history_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 { + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_ids(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("")); + }, + "entire-company" => { + call = call.entire_company(arg_from_str(value.unwrap_or("false"), err, "entire-company", "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-by", "request-metadata-user-overrides-user-id", "page-size", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "page-token", "request-metadata-traffic-source-traffic-sub-id", "request-metadata-locale", "entire-company", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-source-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _offers_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.offers().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 { + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_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(["request-metadata-user-overrides-user-id", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "request-metadata-traffic-source-traffic-sub-id", "request-metadata-locale", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-source-id"].iter().map(|v|*v)); v } )); } } @@ -467,21 +1191,26 @@ impl<'n> Engine<'n> { let type_info: Option<(&'static str, JsonTypeInfo)> = match &temp_cursor.to_string()[..] { + "lead.marketing-opt-in" => Some(("lead.marketingOptIn", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "lead.language-code" => Some(("lead.languageCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.gps-motivations" => Some(("lead.gpsMotivations", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "lead.create-time" => Some(("lead.createTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.family-name" => Some(("lead.familyName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "lead.min-monthly-budget.units" => Some(("lead.minMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.min-monthly-budget.nanos" => Some(("lead.minMonthlyBudget.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "lead.min-monthly-budget.units" => Some(("lead.minMonthlyBudget.units", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.min-monthly-budget.currency-code" => Some(("lead.minMonthlyBudget.currencyCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.comments" => Some(("lead.comments", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.email" => Some(("lead.email", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.website-url" => Some(("lead.websiteUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lead.state" => Some(("lead.state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.phone-number" => Some(("lead.phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "lead.given-name" => Some(("lead.givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "lead.type" => Some(("lead.type", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "lead.given-name" => Some(("lead.givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), + "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 })), @@ -491,7 +1220,7 @@ impl<'n> Engine<'n> { "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!["comments", "currency-code", "email", "event-action", "event-category", "event-scope", "experiment-ids", "family-name", "given-name", "gps-motivations", "id", "ip-address", "lead", "locale", "min-monthly-budget", "nanos", "partners-session-id", "phone-number", "request-metadata", "traffic-source", "traffic-source-id", "traffic-sub-id", "type", "units", "url", "user-id", "user-overrides", "website-url"]); + 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"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -619,11 +1348,415 @@ impl<'n> Engine<'n> { } } + fn _users_create_company_relation(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "manager-account" => Some(("managerAccount", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "website" => Some(("website", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "company-id" => Some(("companyId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "is-pending" => Some(("isPending", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "logo-url" => Some(("logoUrl", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "creation-time" => Some(("creationTime", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "company-admin" => Some(("companyAdmin", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "badge-tier" => Some(("badgeTier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "state" => Some(("state", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "phone-number" => Some(("phoneNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "address" => Some(("address", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "resolved-timestamp" => Some(("resolvedTimestamp", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "segment" => Some(("segment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["address", "badge-tier", "company-admin", "company-id", "creation-time", "is-pending", "logo-url", "manager-account", "name", "phone-number", "resolved-timestamp", "segment", "state", "website"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::CompanyRelation = json::value::from_value(object).unwrap(); + let mut call = self.hub.users().create_company_relation(request, 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 { + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_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(["request-metadata-user-overrides-user-id", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "request-metadata-traffic-source-traffic-sub-id", "request-metadata-locale", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-source-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _users_delete_company_relation(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().delete_company_relation(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 { + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_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(["request-metadata-user-overrides-user-id", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "request-metadata-traffic-source-traffic-sub-id", "request-metadata-locale", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-source-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _users_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.users().get(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 { + "user-view" => { + call = call.user_view(value.unwrap_or("")); + }, + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_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(["request-metadata-locale", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "request-metadata-traffic-source-traffic-source-id", "request-metadata-user-overrides-user-id", "user-view", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-sub-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _users_update_profile(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "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 })), + "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 })), + "languages" => Some(("languages", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "email-address" => Some(("emailAddress", 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 })), + "address.sorting-code" => Some(("address.sortingCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "address.lat-lng.latitude" => Some(("address.latLng.latitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "address.lat-lng.longitude" => Some(("address.latLng.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), + "address.locality" => Some(("address.locality", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "address.region-code" => Some(("address.regionCode", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), + "given-name" => Some(("givenName", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "job-functions" => Some(("jobFunctions", 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"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::UserProfile = json::value::from_value(object).unwrap(); + let mut call = self.hub.users().update_profile(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 { + "request-metadata-user-overrides-user-id" => { + call = call.request_metadata_user_overrides_user_id(value.unwrap_or("")); + }, + "request-metadata-user-overrides-ip-address" => { + call = call.request_metadata_user_overrides_ip_address(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-sub-id" => { + call = call.request_metadata_traffic_source_traffic_sub_id(value.unwrap_or("")); + }, + "request-metadata-traffic-source-traffic-source-id" => { + call = call.request_metadata_traffic_source_traffic_source_id(value.unwrap_or("")); + }, + "request-metadata-partners-session-id" => { + call = call.request_metadata_partners_session_id(value.unwrap_or("")); + }, + "request-metadata-locale" => { + call = call.request_metadata_locale(value.unwrap_or("")); + }, + "request-metadata-experiment-ids" => { + call = call.add_request_metadata_experiment_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(["request-metadata-user-overrides-user-id", "request-metadata-user-overrides-ip-address", "request-metadata-partners-session-id", "request-metadata-traffic-source-traffic-sub-id", "request-metadata-locale", "request-metadata-experiment-ids", "request-metadata-traffic-source-traffic-source-id"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).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() { + ("analytics", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._analytics_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("analytics".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("client-messages", Some(opt)) => { match opt.subcommand() { ("log", Some(opt)) => { @@ -652,6 +1785,59 @@ impl<'n> Engine<'n> { } } }, + ("exams", Some(opt)) => { + match opt.subcommand() { + ("get-token", Some(opt)) => { + call_result = self._exams_get_token(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("exams".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("leads", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._leads_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("leads".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("methods", Some(opt)) => { + match opt.subcommand() { + ("get-partnersstatus", Some(opt)) => { + call_result = self._methods_get_partnersstatus(opt, dry_run, &mut err); + }, + ("update-companies", Some(opt)) => { + call_result = self._methods_update_companies(opt, dry_run, &mut err); + }, + ("update-leads", Some(opt)) => { + call_result = self._methods_update_leads(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("methods".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("offers", Some(opt)) => { + match opt.subcommand() { + ("history-list", Some(opt)) => { + call_result = self._offers_history_list(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._offers_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("offers".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("user-events", Some(opt)) => { match opt.subcommand() { ("log", Some(opt)) => { @@ -674,6 +1860,26 @@ impl<'n> Engine<'n> { } } }, + ("users", Some(opt)) => { + match opt.subcommand() { + ("create-company-relation", Some(opt)) => { + call_result = self._users_create_company_relation(opt, dry_run, &mut err); + }, + ("delete-company-relation", Some(opt)) => { + call_result = self._users_delete_company_relation(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._users_get(opt, dry_run, &mut err); + }, + ("update-profile", Some(opt)) => { + call_result = self._users_update_profile(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(); @@ -760,9 +1966,31 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ + ("analytics", "methods: 'list'", vec![ + ("list", + Some(r##"Lists analytics data for a user's associated company. + Should only be called within the context of an authorized logged in user."##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/analytics_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)), + ]), + ]), + ("client-messages", "methods: 'log'", vec![ ("log", - Some(r##"Logs a generic message from the client, such as `Failed to render component`, `Profile page is running slow`, `More than 500 users have accessed this result.`, etc."##), + Some(r##"Logs a generic message from the client, such as + `Failed to render component`, `Profile page is running slow`, + `More than 500 users have accessed this result.`, etc."##), "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/client-messages_log", vec![ (Some(r##"kv"##), @@ -854,6 +2082,151 @@ fn main() { ]), ]), + ("exams", "methods: 'get-token'", vec![ + ("get-token", + Some(r##"Gets an Exam Token for a Partner's user to take an exam in the Exams System"##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/exams_get-token", + vec![ + (Some(r##"exam-type"##), + None, + Some(r##"The exam type we are requesting a token for."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("leads", "methods: 'list'", vec![ + ("list", + Some(r##"Lists advertiser leads for a user's associated company. + Should only be called within the context of an authorized logged in user."##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/leads_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)), + ]), + ]), + + ("methods", "methods: 'get-partnersstatus', 'update-companies' and 'update-leads'", vec![ + ("get-partnersstatus", + Some(r##"Gets Partners Status of the logged in user's agency. + Should only be called if the logged in user is the admin of the agency."##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/methods_get-partnersstatus", + vec![ + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update-companies", + Some(r##"Update company. + Should only be called within the context of an authorized logged in user."##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/methods_update-companies", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update-leads", + Some(r##"Updates the specified lead."##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/methods_update-leads", + 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)), + ]), + ]), + + ("offers", "methods: 'history-list' and 'list'", vec![ + ("history-list", + Some(r##"Lists the Historical Offers for the current user (or user's entire company)"##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/offers_history-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)), + ]), + ("list", + Some(r##"Lists the Offers available for the current user"##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/offers_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-events", "methods: 'log'", vec![ ("log", Some(r##"Logs a user event."##), @@ -898,12 +2271,113 @@ fn main() { ]), ]), + ("users", "methods: 'create-company-relation', 'delete-company-relation', 'get' and 'update-profile'", vec![ + ("create-company-relation", + Some(r##"Creates a user's company relation. Affiliates the user to a company."##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/users_create-company-relation", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"The ID of the user. Can be set to me to mean + the currently authenticated user."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete-company-relation", + Some(r##"Deletes a user's company relation. Unaffiliaites the user from a company."##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/users_delete-company-relation", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"The ID of the user. Can be set to me to mean + the currently authenticated user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (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 user."##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/users_get", + vec![ + (Some(r##"user-id"##), + None, + Some(r##"Identifier of the user. Can be set to me to mean the currently + authenticated user."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("update-profile", + Some(r##"Updates a user's profile. A user can only update their own profile and + should only be called within the context of a logged in user."##), + "Details at http://byron.github.io/google-apis-rs/google_partners2_cli/users_update-profile", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ]; let mut app = App::new("partners2") .author("Sebastian Thiel ") - .version("1.0.4+20151009") - .about("Lets advertisers search certified companies and create contact leads with them, and also audits the usage of clients.") + .version("1.0.4+20170503") + .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") .long("config-dir") diff --git a/gen/partners2/Cargo.toml b/gen/partners2/Cargo.toml index ab0a331856..27bb6804b3 100644 --- a/gen/partners2/Cargo.toml +++ b/gen/partners2/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-partners2" -version = "1.0.4+20151009" +version = "1.0.4+20170503" authors = ["Sebastian Thiel "] -description = "A complete library to interact with partners (protocol v2)" +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.4+20151009" +documentation = "https://docs.rs/google-partners2/1.0.4+20170503" license = "MIT" keywords = ["partners", "google", "protocol", "web", "api"] diff --git a/gen/partners2/README.md b/gen/partners2/README.md index 3f1a40b6e8..c0e82034ff 100644 --- a/gen/partners2/README.md +++ b/gen/partners2/README.md @@ -3,25 +3,40 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-partners2` library allows access to all features of the *Google partners* service. +The `google-partners2` library allows access to all features of the *Google Partners* service. -This documentation was generated from *partners* crate version *1.0.4+20151009*, where *20151009* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Partners* crate version *1.0.4+20170503*, where *20170503* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. -Everything else about the *partners* *v2* API can be found at the +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.4+20151009/google_partners2/struct.Partners.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.Partners.html) ... +* analytics + * [*list*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.AnalyticListCall.html) * client messages - * [*log*](https://docs.rs/google-partners2/1.0.4+20151009/google_partners2/struct.ClientMessageLogCall.html) -* [companies](https://docs.rs/google-partners2/1.0.4+20151009/google_partners2/struct.Company.html) - * [*get*](https://docs.rs/google-partners2/1.0.4+20151009/google_partners2/struct.CompanyGetCall.html), [*leads create*](https://docs.rs/google-partners2/1.0.4+20151009/google_partners2/struct.CompanyLeadCreateCall.html) and [*list*](https://docs.rs/google-partners2/1.0.4+20151009/google_partners2/struct.CompanyListCall.html) + * [*log*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.ClientMessageLogCall.html) +* [companies](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.Company.html) + * [*get*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.CompanyGetCall.html), [*leads create*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.CompanyLeadCreateCall.html) and [*list*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.CompanyListCall.html) +* exams + * [*get token*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.ExamGetTokenCall.html) +* [leads](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.Lead.html) + * [*list*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.LeadListCall.html) +* offers + * [*history list*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.OfferHistoryListCall.html) and [*list*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.OfferListCall.html) * user events - * [*log*](https://docs.rs/google-partners2/1.0.4+20151009/google_partners2/struct.UserEventLogCall.html) + * [*log*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.UserEventLogCall.html) * user states - * [*list*](https://docs.rs/google-partners2/1.0.4+20151009/google_partners2/struct.UserStateListCall.html) + * [*list*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.UserStateListCall.html) +* [users](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.User.html) + * [*create company relation*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.UserCreateCompanyRelationCall.html), [*delete company relation*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.UserDeleteCompanyRelationCall.html), [*get*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.UserGetCall.html) and [*update profile*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.UserUpdateProfileCall.html) +Other activities are ... + +* [get partnersstatus](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.MethodGetPartnersstatuCall.html) +* [update companies](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.MethodUpdateCompanyCall.html) +* [update leads](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/struct.MethodUpdateLeadCall.html) @@ -29,17 +44,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-partners2/1.0.4+20151009/google_partners2/struct.Partners.html)** +* **[Hub](https://docs.rs/google-partners2/1.0.4+20170503/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.4+20151009/google_partners2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-partners2/1.0.4+20151009/google_partners2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-partners2/1.0.4+20151009/google_partners2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-partners2/1.0.4+20170503/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.4+20151009/google_partners2/trait.Part.html)** + * **[Parts](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-partners2/1.0.4+20151009/google_partners2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-partners2/1.0.4+20170503/google_partners2/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -53,7 +68,10 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore -let r = hub.user_events().log(...).doit() +let r = hub.users().create_company_relation(...).doit() +let r = hub.users().get(...).doit() +let r = hub.users().update_profile(...).doit() +let r = hub.users().delete_company_relation(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -78,7 +96,7 @@ google-partners2 = "*" extern crate hyper; extern crate yup_oauth2 as oauth2; extern crate google_partners2 as partners2; -use partners2::LogUserEventRequest; +use partners2::CompanyRelation; use partners2::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -99,12 +117,19 @@ let mut hub = Partners::new(hyper::Client::new(), auth); // As the method needs a request, you would usually fill it with the desired information // into the respective structure. Some of the parts shown here might not be applicable ! // Values shown here are possibly random and not representative ! -let mut req = LogUserEventRequest::default(); +let mut req = CompanyRelation::default(); // You can configure optional parameters by calling 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_events().log(req) +let result = hub.users().create_company_relation(req, "userId") + .request_metadata_user_overrides_user_id("sit") + .request_metadata_user_overrides_ip_address("Stet") + .request_metadata_traffic_source_traffic_sub_id("sed") + .request_metadata_traffic_source_traffic_source_id("et") + .request_metadata_partners_session_id("dolores") + .request_metadata_locale("kasd") + .add_request_metadata_experiment_ids("accusam") .doit(); match result { @@ -127,17 +152,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-partners2/1.0.4+20151009/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.4+20170503/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.4+20151009/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.4+20170503/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.4+20151009/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.4+20170503/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.4+20151009/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.4+20170503/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")`. @@ -147,29 +172,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.4+20151009/google_partners2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-partners2/1.0.4+20151009/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.4+20170503/google_partners2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-partners2/1.0.4+20170503/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.4+20151009/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.4+20170503/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.4+20151009/google_partners2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-partners2/1.0.4+20151009/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.4+20170503/google_partners2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-partners2/1.0.4+20170503/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.4+20151009/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.4+20170503/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.4+20151009/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.4+20170503/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.4+20151009/google_partners2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-partners2/1.0.4+20170503/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 20de1c7ca6..4f4635fb3f 100644 --- a/gen/partners2/src/lib.rs +++ b/gen/partners2/src/lib.rs @@ -2,24 +2,39 @@ // 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.4+20151009*, where *20151009* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Partners* crate version *1.0.4+20170503*, where *20170503* is the exact revision of the *partners:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! -//! Everything else about the *partners* *v2* API can be found at the +//! Everything else about the *Partners* *v2* API can be found at the //! [official documentation site](https://developers.google.com/partners/). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/partners2). //! # Features //! //! Handle the following *Resources* with ease from the central [hub](struct.Partners.html) ... //! +//! * analytics +//! * [*list*](struct.AnalyticListCall.html) //! * client messages //! * [*log*](struct.ClientMessageLogCall.html) //! * [companies](struct.Company.html) //! * [*get*](struct.CompanyGetCall.html), [*leads create*](struct.CompanyLeadCreateCall.html) and [*list*](struct.CompanyListCall.html) +//! * exams +//! * [*get token*](struct.ExamGetTokenCall.html) +//! * [leads](struct.Lead.html) +//! * [*list*](struct.LeadListCall.html) +//! * offers +//! * [*history list*](struct.OfferHistoryListCall.html) and [*list*](struct.OfferListCall.html) //! * user events //! * [*log*](struct.UserEventLogCall.html) //! * user states //! * [*list*](struct.UserStateListCall.html) +//! * [users](struct.User.html) +//! * [*create company relation*](struct.UserCreateCompanyRelationCall.html), [*delete company relation*](struct.UserDeleteCompanyRelationCall.html), [*get*](struct.UserGetCall.html) and [*update profile*](struct.UserUpdateProfileCall.html) //! +//! Other activities are ... +//! +//! * [get partnersstatus](struct.MethodGetPartnersstatuCall.html) +//! * [update companies](struct.MethodUpdateCompanyCall.html) +//! * [update leads](struct.MethodUpdateLeadCall.html) //! //! //! @@ -53,7 +68,10 @@ //! Or specifically ... //! //! ```ignore -//! let r = hub.user_events().log(...).doit() +//! let r = hub.users().create_company_relation(...).doit() +//! let r = hub.users().get(...).doit() +//! let r = hub.users().update_profile(...).doit() +//! let r = hub.users().delete_company_relation(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -78,7 +96,7 @@ //! extern crate hyper; //! extern crate yup_oauth2 as oauth2; //! extern crate google_partners2 as partners2; -//! use partners2::LogUserEventRequest; +//! use partners2::CompanyRelation; //! use partners2::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -100,12 +118,19 @@ //! // As the method needs a request, you would usually fill it with the desired information //! // into the respective structure. Some of the parts shown here might not be applicable ! //! // Values shown here are possibly random and not representative ! -//! let mut req = LogUserEventRequest::default(); +//! let mut req = CompanyRelation::default(); //! //! // You can configure optional parameters by calling 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_events().log(req) +//! let result = hub.users().create_company_relation(req, "userId") +//! .request_metadata_user_overrides_user_id("justo") +//! .request_metadata_user_overrides_ip_address("amet.") +//! .request_metadata_traffic_source_traffic_sub_id("erat") +//! .request_metadata_traffic_source_traffic_source_id("labore") +//! .request_metadata_partners_session_id("sea") +//! .request_metadata_locale("nonumy") +//! .add_request_metadata_experiment_ids("dolores") //! .doit(); //! //! match result { @@ -182,7 +207,7 @@ // 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 +// 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)] @@ -239,7 +264,7 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// extern crate hyper; /// extern crate yup_oauth2 as oauth2; /// extern crate google_partners2 as partners2; -/// use partners2::LogUserEventRequest; +/// use partners2::CompanyRelation; /// use partners2::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -261,12 +286,19 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// // As the method needs a request, you would usually fill it with the desired information /// // into the respective structure. Some of the parts shown here might not be applicable ! /// // Values shown here are possibly random and not representative ! -/// let mut req = LogUserEventRequest::default(); +/// let mut req = CompanyRelation::default(); /// /// // You can configure optional parameters by calling 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_events().log(req) +/// let result = hub.users().create_company_relation(req, "userId") +/// .request_metadata_user_overrides_user_id("sadipscing") +/// .request_metadata_user_overrides_ip_address("aliquyam") +/// .request_metadata_traffic_source_traffic_sub_id("ea") +/// .request_metadata_traffic_source_traffic_source_id("no") +/// .request_metadata_partners_session_id("justo") +/// .request_metadata_locale("justo") +/// .add_request_metadata_experiment_ids("et") /// .doit(); /// /// match result { @@ -291,8 +323,6 @@ pub struct Partners { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Partners {} @@ -305,23 +335,39 @@ impl<'a, C, A> Partners client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://partners.googleapis.com/".to_string(), - _root_url: "https://partners.googleapis.com/".to_string(), } } + pub fn analytics(&'a self) -> AnalyticMethods<'a, C, A> { + AnalyticMethods { hub: &self } + } pub fn client_messages(&'a self) -> ClientMessageMethods<'a, C, A> { ClientMessageMethods { hub: &self } } pub fn companies(&'a self) -> CompanyMethods<'a, C, A> { CompanyMethods { hub: &self } } + pub fn exams(&'a self) -> ExamMethods<'a, C, A> { + ExamMethods { hub: &self } + } + pub fn leads(&'a self) -> LeadMethods<'a, C, A> { + LeadMethods { hub: &self } + } + pub fn methods(&'a self) -> MethodMethods<'a, C, A> { + MethodMethods { hub: &self } + } + pub fn offers(&'a self) -> OfferMethods<'a, C, A> { + OfferMethods { hub: &self } + } pub fn user_events(&'a self) -> UserEventMethods<'a, C, A> { UserEventMethods { hub: &self } } pub fn user_states(&'a self) -> UserStateMethods<'a, C, A> { UserStateMethods { 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.4`. @@ -332,33 +378,812 @@ impl<'a, C, A> Partners self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://partners.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://partners.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// Response message for LogUserEvent. +/// Response message for +/// ListUserStates. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 states](struct.UserStateListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListUserStatesResponse { + /// User's states. + #[serde(rename="userStates")] + pub user_states: Option>, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, +} + +impl ResponseResult for ListUserStatesResponse {} + + +/// Values to use instead of the user's respective defaults. These are only +/// honored by whitelisted products. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UserOverrides { + /// IP address to use instead of the user's geo-located IP address. + #[serde(rename="ipAddress")] + pub ip_address: Option, + /// Logged-in user ID to impersonate instead of the user's ID. + #[serde(rename="userId")] + pub user_id: Option, +} + +impl Part for UserOverrides {} + + +/// A lead resource that represents an advertiser contact for a `Company`. These +/// are usually generated via Google Partner Search (the advertiser portal). +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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) (none) +/// * [update leads](struct.MethodUpdateLeadCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Lead { + /// Whether or not the lead signed up for marketing emails + #[serde(rename="marketingOptIn")] + pub marketing_opt_in: Option, + /// Language code of the lead's language preference, as defined by + /// BCP 47 + /// (IETF BCP 47, "Tags for Identifying Languages"). + #[serde(rename="languageCode")] + pub language_code: Option, + /// List of reasons for using Google Partner Search and creating a lead. + #[serde(rename="gpsMotivations")] + pub gps_motivations: Option>, + /// ID of the lead. + pub id: Option, + /// Last name of lead source. + #[serde(rename="familyName")] + pub family_name: Option, + /// The minimum monthly budget lead source is willing to spend. + #[serde(rename="minMonthlyBudget")] + pub min_monthly_budget: Option, + /// Comments lead source gave. + pub comments: Option, + /// Email address of lead source. + pub email: Option, + /// Website URL of lead source. + #[serde(rename="websiteUrl")] + pub website_url: Option, + /// The lead's state in relation to the company. + pub state: Option, + /// Phone number of lead source. + #[serde(rename="phoneNumber")] + pub phone_number: Option, + /// The AdWords Customer ID of the lead. + #[serde(rename="adwordsCustomerId")] + pub adwords_customer_id: Option, + /// First name of lead source. + #[serde(rename="givenName")] + pub given_name: Option, + /// Type of lead. + #[serde(rename="type")] + pub type_: Option, + /// Timestamp of when this lead was created. + #[serde(rename="createTime")] + pub create_time: Option, +} + +impl RequestValue for Lead {} +impl Resource for Lead {} +impl ResponseResult for Lead {} + + +/// Debug information about this 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 DebugInfo { + /// Server-side debug stack trace. + #[serde(rename="serverTraceInfo")] + pub server_trace_info: Option, + /// URL of the service that handled this request. + #[serde(rename="serviceUrl")] + pub service_url: Option, + /// Info about the server that serviced this request. + #[serde(rename="serverInfo")] + pub server_info: Option, +} + +impl Part for DebugInfo {} + + +/// Response message for +/// LogClientMessage. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [log client messages](struct.ClientMessageLogCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogMessageResponse { + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, +} + +impl ResponseResult for LogMessageResponse {} + + +/// Available Offers to be distributed. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AvailableOffer { + /// The number of codes for this offer that are available for distribution. + pub available: Option, + /// Offer info by country. + #[serde(rename="countryOfferInfos")] + pub country_offer_infos: Option>, + /// Customers who qualify for this offer. + #[serde(rename="qualifiedCustomer")] + pub qualified_customer: Option>, + /// Terms of the offer. + pub terms: Option, + /// Description of the offer. + pub description: Option, + /// The maximum age of an account [in days] to be eligible. + #[serde(rename="maxAccountAge")] + pub max_account_age: Option, + /// Level of this offer. + #[serde(rename="offerLevel")] + pub offer_level: Option, + /// Should special text be shown on the offers page. + #[serde(rename="showSpecialOfferCopy")] + pub show_special_offer_copy: Option, + /// Type of offer. + #[serde(rename="offerType")] + pub offer_type: Option, + /// ID of this offer. + pub id: Option, + /// 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, +} + +impl Part for AvailableOffer {} + + +/// Response for ListOffer. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 offers](struct.OfferListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOffersResponse { + /// Reason why no Offers are available. + #[serde(rename="noOfferReason")] + pub no_offer_reason: Option, + /// Available Offers to be distributed. + #[serde(rename="availableOffers")] + pub available_offers: Option>, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, +} + +impl ResponseResult for ListOffersResponse {} + + +/// The localized company 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 LocalizedCompanyInfo { + /// List of country codes for the localized company info. + #[serde(rename="countryCodes")] + pub country_codes: 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 {} + + +/// A location with address and geographic coordinates. May optionally contain a +/// detailed (multi-field) version of the address. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Location { + /// Language code of the address. Should be in BCP 47 format. + #[serde(rename="languageCode")] + pub language_code: Option, + /// The following address lines represent the most specific part of any + /// address. + #[serde(rename="addressLine")] + pub address_line: Option>, + /// Generally refers to the city/town portion of an address. + pub locality: Option, + /// Use of this code is very country-specific, but will refer to a secondary + /// classification code for sorting mail. + #[serde(rename="sortingCode")] + pub sorting_code: Option, + /// The latitude and longitude of the location, in degrees. + #[serde(rename="latLng")] + pub lat_lng: Option, + /// Dependent locality or sublocality. Used for UK dependent localities, or + /// neighborhoods or boroughs in other locations. + #[serde(rename="dependentLocality")] + pub dependent_locality: Option, + /// CLDR (Common Locale Data Repository) region code . + #[serde(rename="regionCode")] + pub region_code: Option, + /// Top-level administrative subdivision of this country. + #[serde(rename="administrativeArea")] + pub administrative_area: Option, + /// The single string version of the address. + pub address: Option, + /// Values are frequently alphanumeric. + #[serde(rename="postalCode")] + pub postal_code: Option, +} + +impl Part for Location {} + + +/// Response message for +/// ListCompanies. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 companies](struct.CompanyListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListCompaniesResponse { + /// A token to retrieve next page of results. + /// Pass this value in the `ListCompaniesRequest.page_token` field in the + /// subsequent call to + /// ListCompanies to retrieve the + /// next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of companies. + pub companies: Option>, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, +} + +impl ResponseResult for ListCompaniesResponse {} + + +/// 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 company relation users](struct.UserDeleteCompanyRelationCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Empty { _never_set: Option } + +impl ResponseResult for Empty {} + + +/// A set of opt-ins for 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 OptIns { + /// An opt-in about receiving email regarding new features and products. + #[serde(rename="specialOffers")] + pub special_offers: Option, + /// An opt-in about receiving email from Partners marketing teams. Includes + /// member-only events and special promotional offers for Google products. + #[serde(rename="marketComm")] + pub market_comm: Option, + /// An opt-in to allow recieivng phone calls about their Partners account. + #[serde(rename="phoneContact")] + pub phone_contact: Option, + /// An opt-in to receive special promotional gifts and material in the mail. + #[serde(rename="physicalMail")] + pub physical_mail: Option, + /// An opt-in about receiving email with customized AdWords campaign management + /// tips. + #[serde(rename="performanceSuggestions")] + pub performance_suggestions: Option, +} + +impl Part for OptIns {} + + +/// Details of the analytics events for a `Company` within a single day. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AnalyticsDataPoint { + /// Location information of where these events occurred. + #[serde(rename="eventLocations")] + pub event_locations: Option>, + /// Number of times the type of event occurred. + /// Meaning depends on context (e.g. profile views, contacts, etc.). + #[serde(rename="eventCount")] + pub event_count: Option, +} + +impl Part for AnalyticsDataPoint {} + + +/// Offer info by country. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CountryOfferInfo { + /// (localized) Spend X amount for that country's offer. + #[serde(rename="spendXAmount")] + pub spend_x_amount: Option, + /// Country code for which offer codes may be requested. + #[serde(rename="offerCountryCode")] + pub offer_country_code: Option, + /// Type of offer country is eligible for. + #[serde(rename="offerType")] + pub offer_type: Option, + /// (localized) Get Y amount for that country's offer. + #[serde(rename="getYAmount")] + pub get_y_amount: Option, +} + +impl Part for CountryOfferInfo {} + + +/// Response message for CreateLead. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [leads create companies](struct.CompanyLeadCreateCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct CreateLeadResponse { + /// 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 ResponseResult for CreateLeadResponse {} + + +/// A company resource in the Google Partners API. Once certified, it qualifies +/// for being searched by 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*). +/// +/// * [update companies](struct.MethodUpdateCompanyCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Company { + /// Company type labels listed on the company's profile. + #[serde(rename="companyTypes")] + pub company_types: Option>, + /// The unconverted minimum monthly budget that the company accepts for partner + /// business. + #[serde(rename="originalMinMonthlyBudget")] + pub original_min_monthly_budget: Option, + /// The list of Google Partners specialization statuses for the company. + #[serde(rename="specializationStatus")] + pub specialization_status: Option>, + /// The public viewability status of the company's profile. + #[serde(rename="profileStatus")] + pub profile_status: Option, + /// The list of all company locations. + /// If set, must include the + /// primary_location + /// in the list. + pub locations: Option>, + /// The primary location of the company. + #[serde(rename="primaryLocation")] + pub primary_location: Option, + /// URL of the company's additional websites used to verify the dynamic badges. + /// These are stored as full URLs as entered by the user, but only the TLD will + /// be used for the actual verification. + #[serde(rename="additionalWebsites")] + pub additional_websites: Option>, + /// Services the company can help with. + pub services: Option>, + /// Basic information from the company's public profile. + #[serde(rename="publicProfile")] + pub public_profile: Option, + /// The ID of the company. + pub id: Option, + /// Industries the company can help with. + pub industries: Option>, + /// URL of the company's website. + #[serde(rename="websiteUrl")] + pub website_url: Option, + /// Email domains that allow users with a matching email address to get + /// auto-approved for associating with this company. + #[serde(rename="autoApprovalEmailDomains")] + pub auto_approval_email_domains: Option>, + /// The name of the company. + pub name: Option, + /// Information related to the ranking of the company within the list of + /// companies. + pub ranks: Option>, + /// Partner badge tier + #[serde(rename="badgeTier")] + pub badge_tier: Option, + /// The list of localized info for the company. + #[serde(rename="localizedInfos")] + pub localized_infos: Option>, + /// The Primary AdWords Manager Account id. + #[serde(rename="primaryAdwordsManagerAccountId")] + pub primary_adwords_manager_account_id: Option, + /// The primary language code of the company, as defined by + /// BCP 47 + /// (IETF BCP 47, "Tags for Identifying Languages"). + #[serde(rename="primaryLanguageCode")] + pub primary_language_code: Option, + /// The list of Google Partners certification statuses for the company. + #[serde(rename="certificationStatuses")] + pub certification_statuses: Option>, + /// The minimum monthly budget that the company accepts for partner business, + /// converted to the requested currency code. + #[serde(rename="convertedMinMonthlyBudget")] + pub converted_min_monthly_budget: Option, +} + +impl RequestValue for Company {} +impl ResponseResult for Company {} + + +/// Request message for +/// LogClientMessage. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [log client messages](struct.ClientMessageLogCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LogMessageRequest { + /// Map of client info, such as URL, browser navigator, browser platform, etc. + #[serde(rename="clientInfo")] + pub client_info: Option>, + /// Current request metadata. + #[serde(rename="requestMetadata")] + pub request_metadata: Option, + /// Details about the client message. + pub details: Option, + /// Message level of client message. + pub level: Option, +} + +impl RequestValue for LogMessageRequest {} + + +/// Information about a particular AdWords Manager Account. +/// Read more at https://support.google.com/adwords/answer/6139186 +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AdWordsManagerAccountInfo { + /// The AdWords Manager Account id. + pub id: Option, + /// Name of the customer this account represents. + #[serde(rename="customerName")] + pub customer_name: Option, +} + +impl Part for AdWordsManagerAccountInfo {} + + +/// Response for ListOfferHistory. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [history list offers](struct.OfferHistoryListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListOffersHistoryResponse { + /// Supply this token in a ListOffersHistoryRequest to retrieve the next page. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// True if this response is showing entire company history. + #[serde(rename="showingEntireCompany")] + pub showing_entire_company: Option, + /// True if the user has the option to show entire company history. + #[serde(rename="canShowEntireCompany")] + pub can_show_entire_company: Option, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, + /// Historical offers meeting request. + pub offers: Option>, + /// Number of results across all pages. + #[serde(rename="totalResults")] + pub total_results: Option, +} + +impl ResponseResult for ListOffersHistoryResponse {} + + +/// Response message for +/// ListAnalytics. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list analytics](struct.AnalyticListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListAnalyticsResponse { + /// A token to retrieve next page of results. + /// Pass this value in the `ListAnalyticsRequest.page_token` field in the + /// subsequent call to + /// ListAnalytics to retrieve the + /// next page of results. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The list of analytics. + /// Sorted in ascending order of + /// Analytics.event_date. + pub analytics: Option>, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, + /// Aggregated information across the response's + /// analytics. + #[serde(rename="analyticsSummary")] + pub analytics_summary: Option, +} + +impl ResponseResult for ListAnalyticsResponse {} + + +/// Response message for GetCompany. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 companies](struct.CompanyGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetCompanyResponse { + /// The company. + pub company: Option, + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, +} + +impl ResponseResult for GetCompanyResponse {} + + +/// Common data that is in each API 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 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>, + /// Values to use instead of the user's respective defaults for the current + /// request. These are only honored by whitelisted products. + #[serde(rename="userOverrides")] + pub user_overrides: Option, + /// Source of traffic for the current request. + #[serde(rename="trafficSource")] + pub traffic_source: Option, +} + +impl Part for RequestMetadata {} + + +/// A resource representing a user of the Partners platform. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [create company relation users](struct.UserCreateCompanyRelationCall.html) (none) +/// * [get users](struct.UserGetCall.html) (response) +/// * [update profile users](struct.UserUpdateProfileCall.html) (none) +/// * [delete company relation users](struct.UserDeleteCompanyRelationCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct User { + /// 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 + #[serde(rename="certificationStatus")] + pub certification_status: Option>, + /// This is the list of AdWords Manager Accounts the user has edit access to. + /// If the user has edit access to multiple accounts, the user can choose the + /// preferred account and we use this when a personal account is needed. Can + /// be empty meaning the user has access to no accounts. + /// @OutputOnly + #[serde(rename="availableAdwordsManagerAccounts")] + pub available_adwords_manager_accounts: Option>, + /// The company that the user is associated with. + /// If not present, the user is not associated with any company. + pub company: Option, + /// The most recent time the user interacted with the Partners site. + /// @OutputOnly + #[serde(rename="lastAccessTime")] + pub last_access_time: Option, + /// The list of exams the user ever taken. For each type of exam, only one + /// entry is listed. + #[serde(rename="examStatus")] + pub exam_status: Option>, + /// The list of emails the user has access to/can select as primary. + /// @OutputOnly + #[serde(rename="primaryEmails")] + pub primary_emails: Option>, + /// Information about a user's external public profile outside Google Partners. + #[serde(rename="publicProfile")] + pub public_profile: Option, + /// The ID of the user. + pub id: Option, +} + +impl Resource for User {} +impl ResponseResult for User {} + + +/// Represents a whole calendar date, e.g. date of birth. The time of day and +/// time zone are either specified elsewhere or are not significant. The date +/// is relative to the Proleptic Gregorian Calendar. The day may be 0 to +/// represent a year and month where the day is not significant, e.g. credit card +/// expiration date. The year may be 0 to represent a month and day independent +/// of year, e.g. anniversary date. Related types are google.type.TimeOfDay +/// and `google.protobuf.Timestamp`. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Date { + /// 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 {} + + +/// Basic information from a public profile. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct PublicProfile { + /// The URL of the public profile. + pub url: Option, + /// The URL to the main profile image of the public profile. + #[serde(rename="profileImage")] + pub profile_image: Option, + /// The URL to the main display image of the public profile. Being deprecated. + #[serde(rename="displayImageUrl")] + pub display_image_url: Option, + /// The display name of the public profile. + #[serde(rename="displayName")] + pub display_name: Option, + /// The ID which can be used to retrieve more details about the public profile. + pub id: Option, +} + +impl Part for PublicProfile {} + + +/// Response message for +/// GetPartnersStatus. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 partnersstatus](struct.MethodGetPartnersstatuCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct GetPartnersStatusResponse { + /// Current response metadata. + #[serde(rename="responseMetadata")] + pub response_metadata: Option, +} + +impl ResponseResult for GetPartnersStatusResponse {} + + +/// Response message for +/// LogUserEvent. /// /// # Activities /// @@ -383,10 +1208,14 @@ impl ResponseResult for LogUserEventResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TrafficSource { - /// Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. #[serde(rename="trafficSubId")] pub traffic_sub_id: Option, - /// Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. #[serde(rename="trafficSourceId")] pub traffic_source_id: Option, } @@ -400,115 +1229,165 @@ impl Part for TrafficSource {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CertificationStatus { - /// The type of the certification. - #[serde(rename="type")] - pub type_: Option, /// Whether certification is passing. #[serde(rename="isCertified")] pub is_certified: Option, /// List of certification exam statuses. #[serde(rename="examStatuses")] pub exam_statuses: Option>, + /// The type of the certification. + #[serde(rename="type")] + pub type_: Option, + /// Number of people who are certified, + #[serde(rename="userCount")] + pub user_count: Option, } impl Part for CertificationStatus {} -/// Response message for LogClientMessage. +/// Historical information about a Google Partners Offer. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct HistoricalOffer { + /// Status of the offer. + pub status: Option, + /// Offer code. + #[serde(rename="offerCode")] + pub offer_code: Option, + /// Country Code for the offer country. + #[serde(rename="offerCountryCode")] + pub offer_country_code: Option, + /// Client's AdWords page URL. + #[serde(rename="adwordsUrl")] + pub adwords_url: Option, + /// Time offer was first created. + #[serde(rename="creationTime")] + pub creation_time: Option, + /// ID of client. + #[serde(rename="clientId")] + pub client_id: Option, + /// Email address for client. + #[serde(rename="clientEmail")] + pub client_email: Option, + /// Time last action was taken. + #[serde(rename="lastModifiedTime")] + pub last_modified_time: Option, + /// Type of offer. + #[serde(rename="offerType")] + pub offer_type: Option, + /// Name (First + Last) of the partners user to whom the incentive is allocated. + #[serde(rename="senderName")] + pub sender_name: Option, + /// Time this offer expires. + #[serde(rename="expirationTime")] + pub expiration_time: Option, + /// Name of the client. + #[serde(rename="clientName")] + pub client_name: Option, +} + +impl Part for HistoricalOffer {} + + +/// Common data that is in each API response. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResponseMetadata { + /// Debug information about this request. + #[serde(rename="debugInfo")] + pub debug_info: Option, +} + +impl Part for ResponseMetadata {} + + +/// A token that allows a user to take an exam. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [log client messages](struct.ClientMessageLogCall.html) (response) +/// * [get token exams](struct.ExamGetTokenCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogMessageResponse { - /// Current response metadata. - #[serde(rename="responseMetadata")] - pub response_metadata: Option, +pub struct ExamToken { + /// The type of the exam the token belongs to. + #[serde(rename="examType")] + pub exam_type: Option, + /// The token, only present if the user has access to the exam. + pub token: Option, + /// The id of the exam the token is for. + #[serde(rename="examId")] + pub exam_id: Option, } -impl ResponseResult for LogMessageResponse {} +impl ResponseResult for ExamToken {} -/// Values to use instead of the user's respective defaults. These are only honored by whitelisted products. +/// The profile information of a Partners user. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [update profile users](struct.UserUpdateProfileCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UserOverrides { - /// IP address to use instead of the user's geo-located IP address. - #[serde(rename="ipAddress")] - pub ip_address: Option, - /// Logged-in user ID to impersonate instead of the user's ID. - #[serde(rename="userId")] - pub user_id: Option, -} - -impl Part for UserOverrides {} - - -/// A lead resource that represents an advertiser contact for a `Company`. These are usually generated via Google Partner Search (the advertiser portal). -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Lead { - /// List of reasons for using Google Partner Search and creating a lead. - #[serde(rename="gpsMotivations")] - pub gps_motivations: Option>, - /// Last name of lead source. +pub struct UserProfile { + /// A list of ids representing which industries the user selected. + pub industries: Option>, + /// The user's primary country, an ISO 2-character code. + #[serde(rename="primaryCountryCode")] + pub primary_country_code: Option, + /// If the user has edit access to multiple accounts, the user can choose the + /// preferred account and it is used when a personal account is needed. Can + /// be empty. + #[serde(rename="adwordsManagerAccount")] + pub adwords_manager_account: Option, + /// A list of ids represnting which job categories the user selected. + #[serde(rename="jobFunctions")] + pub job_functions: Option>, + /// The list of opt-ins for the user, related to communication preferences. + #[serde(rename="emailOptIns")] + pub email_opt_ins: Option, + /// The user's family name. #[serde(rename="familyName")] pub family_name: Option, - /// The minimum monthly budget lead source is willing to spend. - #[serde(rename="minMonthlyBudget")] - pub min_monthly_budget: Option, - /// Comments lead source gave. - pub comments: Option, - /// ID of the lead. - pub id: Option, - /// Website URL of lead source. - #[serde(rename="websiteUrl")] - pub website_url: Option, - /// Phone number of lead source. + /// 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, - /// First name of lead source. + /// The user's given name. #[serde(rename="givenName")] pub given_name: Option, - /// Type of lead. - #[serde(rename="type")] - pub type_: Option, - /// Email address of lead source. - pub email: Option, + /// A list of ids representing which markets the user was interested in. + pub markets: Option>, + /// Whether the user's public profile is visible to anyone with the URL. + #[serde(rename="profilePublic")] + pub profile_public: Option, + /// A list of ids representing which channels the user selected they were in. + pub channels: Option>, } -impl Part for Lead {} +impl RequestValue for UserProfile {} +impl ResponseResult for UserProfile {} -/// Debug information about this 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 DebugInfo { - /// Server-side debug stack trace. - #[serde(rename="serverTraceInfo")] - pub server_trace_info: Option, - /// URL of the service that handled this request. - #[serde(rename="serviceUrl")] - pub service_url: Option, - /// Info about the server that serviced this request. - #[serde(rename="serverInfo")] - pub server_info: Option, -} - -impl Part for DebugInfo {} - - -/// Request message for LogUserEvent. +/// Request message for +/// LogUserEvent. /// /// # Activities /// @@ -529,83 +1408,83 @@ 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 {} -/// The localized company information. +/// 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 LocalizedCompanyInfo { - /// List of country codes for the localized company info. - #[serde(rename="countryCodes")] - pub country_codes: 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, +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 LocalizedCompanyInfo {} +impl Part for ExamStatus {} -/// A location with address and geographic coordinates. +/// Customers qualified for an 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 Location { - /// The latitude and longitude of the location, in degrees. - #[serde(rename="latLng")] - pub lat_lng: Option, - /// The complete address of the location. - pub address: Option, +pub struct OfferCustomer { + /// Name of the customer. + pub name: Option, + /// Country code of the customer. + #[serde(rename="countryCode")] + pub country_code: Option, + /// Formatted Spend X amount with currency code. + #[serde(rename="spendXAmount")] + pub spend_x_amount: Option, + /// URL to the customer's AdWords page. + #[serde(rename="adwordsUrl")] + pub adwords_url: Option, + /// Time the customer was created. + #[serde(rename="creationTime")] + pub creation_time: Option, + /// External CID for the customer. + #[serde(rename="externalCid")] + pub external_cid: Option, + /// Days the customer is still eligible. + #[serde(rename="eligibilityDaysLeft")] + pub eligibility_days_left: Option, + /// Formatted Get Y amount with currency code. + #[serde(rename="getYAmount")] + pub get_y_amount: Option, + /// Type of the offer + #[serde(rename="offerType")] + pub offer_type: Option, } -impl Part for Location {} +impl Part for OfferCustomer {} -/// Response message for ListCompanies. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 companies](struct.CompanyListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListCompaniesResponse { - /// A token to retrieve next page of results. Pass this value in the `ListCompaniesRequest.page_token` field in the subsequent call to ListCompanies to retrieve the next page of results. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The list of companies. - pub companies: Option>, - /// Current response metadata. - #[serde(rename="responseMetadata")] - pub response_metadata: Option, -} - -impl ResponseResult for ListCompaniesResponse {} - - -/// reCaptcha challenge info. +/// reCaptcha challenge info. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -620,6 +1499,37 @@ pub struct RecaptchaChallenge { impl Part for RecaptchaChallenge {} +/// 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 {} + + /// Status for a Google Partners certification exam. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -637,28 +1547,66 @@ pub struct CertificationExamStatus { impl Part for CertificationExamStatus {} -/// Response message for CreateLead. Debug information about this request. +/// 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 { - /// 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, +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 {} + + +/// Analytics aggregated data for a `Company` for a given date range. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct AnalyticsSummary { + /// Aggregated number of times users contacted the `Company` + /// for given date range. + #[serde(rename="contactsCount")] + pub contacts_count: Option, + /// Aggregated number of times users saw the `Company` + /// in Google Partners Search results for given date range. + #[serde(rename="searchViewsCount")] + pub search_views_count: Option, + /// Aggregated number of profile views for the `Company` for given date range. + #[serde(rename="profileViewsCount")] + pub profile_views_count: Option, +} + +impl Part for AnalyticsSummary {} + + +/// A user's information on a specific certification. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Certification { + /// Whether this certification has been achieved. + pub achieved: Option, + /// Whether this certification is in the state of warning. + pub warning: Option, + /// The date the user last achieved certification. + #[serde(rename="lastAchieved")] + pub last_achieved: Option, + /// Date this certification is due to expire. + pub expiration: Option, + /// The type of certification, the area of expertise. + #[serde(rename="certificationType")] + pub certification_type: Option, +} + +impl Part for Certification {} /// Represents an amount of money with its currency type. @@ -667,10 +1615,16 @@ impl ResponseResult for CreateLeadResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Money { - /// The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. - pub units: Option, - /// Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + /// Number of nano (10^-9) units of the amount. + /// The value must be between -999,999,999 and +999,999,999 inclusive. + /// If `units` is positive, `nanos` must be positive or zero. + /// If `units` is zero, `nanos` can be positive, zero, or negative. + /// If `units` is negative, `nanos` must be negative or zero. + /// For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. pub nanos: Option, + /// The whole units of the amount. + /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + pub units: Option, /// The 3-letter currency code defined in ISO 4217. #[serde(rename="currencyCode")] pub currency_code: Option, @@ -679,92 +1633,60 @@ pub struct Money { impl Part for Money {} -/// A company resource in the Google Partners API. Once certified, it qualifies for being searched by advertisers. +/// An object representing a latitude/longitude pair. This is expressed as a pair +/// of doubles representing degrees latitude and degrees longitude. Unless +/// specified otherwise, this must conform to the +/// WGS84 +/// standard. Values must be within normalized ranges. +/// +/// Example of normalization code in Python: +/// +/// def NormalizeLongitude(longitude): +/// """Wraps decimal degrees longitude to [-180.0, 180.0].""" +/// q, r = divmod(longitude, 360.0) +/// if r > 180.0 or (r == 180.0 and q <= -1.0): +/// return r - 360.0 +/// return r +/// +/// def NormalizeLatLng(latitude, longitude): +/// """Wraps decimal degrees latitude and longitude to +/// [-90.0, 90.0] and [-180.0, 180.0], respectively.""" +/// r = latitude % 360.0 +/// if r <= 90.0: +/// return r, NormalizeLongitude(longitude) +/// elif r >= 270.0: +/// return r - 360, NormalizeLongitude(longitude) +/// else: +/// return 180 - r, NormalizeLongitude(longitude + 180.0) +/// +/// assert 180.0 == NormalizeLongitude(180.0) +/// assert -180.0 == NormalizeLongitude(-180.0) +/// assert -179.0 == NormalizeLongitude(181.0) +/// assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) +/// assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) +/// assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) +/// assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) +/// assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) +/// assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) +/// assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) +/// assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) +/// assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) +/// assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) +/// +/// The code in logs/storage/validator/logs_validator_traits.cc treats this type +/// as if it were annotated as ST_LOCATION. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Company { - /// Industries the company can help with. - pub industries: Option>, - /// The unconverted minimum monthly budget that the company accepts for partner business. - #[serde(rename="originalMinMonthlyBudget")] - pub original_min_monthly_budget: Option, - /// The minimum monthly budget that the company accepts for partner business, converted to the requested currency code. - #[serde(rename="convertedMinMonthlyBudget")] - pub converted_min_monthly_budget: Option, - /// The name of the company. - pub name: Option, - /// The list of localized info for the company. - #[serde(rename="localizedInfos")] - pub localized_infos: Option>, - /// The list of company locations. - pub locations: Option>, - /// URL of the company's website. - #[serde(rename="websiteUrl")] - pub website_url: Option, - /// Information related to the ranking of the company within the list of companies. - pub ranks: Option>, - /// Services the company can help with. - pub services: Option>, - /// The list of Google Partners certification statuses for the company. - #[serde(rename="certificationStatuses")] - pub certification_statuses: Option>, - /// Basic information from the company's public profile. - #[serde(rename="publicProfile")] - pub public_profile: Option, - /// The ID of the company. - pub id: Option, +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 Company {} - - -/// Request message for LogClientMessage. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [log client messages](struct.ClientMessageLogCall.html) (request) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LogMessageRequest { - /// Current request metadata. - #[serde(rename="requestMetadata")] - pub request_metadata: Option, - /// Map of client info, such as URL, browser navigator, browser platform, etc. - #[serde(rename="clientInfo")] - pub client_info: Option>, - /// Details about the client message. - pub details: Option, - /// Message level of client message. - pub level: Option, -} - -impl RequestValue for LogMessageRequest {} - - -/// Response message for GetCompany. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 companies](struct.CompanyGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct GetCompanyResponse { - /// The company. - pub company: Option, - /// Current response metadata. - #[serde(rename="responseMetadata")] - pub response_metadata: Option, -} - -impl ResponseResult for GetCompanyResponse {} +impl Part for LatLng {} /// Information related to ranking of results. @@ -783,6 +1705,31 @@ pub struct Rank { impl Part for Rank {} +/// Analytics data for a `Company` within a single day. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Analytics { + /// Date on which these events occurred. + #[serde(rename="eventDate")] + pub event_date: Option, + /// Instances of users viewing the `Company` profile + /// on the specified date. + #[serde(rename="profileViews")] + pub profile_views: Option, + /// Instances of users seeing the `Company` in Google Partners Search results + /// on the specified date. + #[serde(rename="searchViews")] + pub search_views: Option, + /// Instances of users contacting the `Company` + /// on the specified date. + pub contacts: Option, +} + +impl Part for Analytics {} + + /// Request message for CreateLead. /// /// # Activities @@ -797,75 +1744,76 @@ pub struct CreateLeadRequest { /// Current request metadata. #[serde(rename="requestMetadata")] pub request_metadata: Option, - /// reCaptcha challenge info. + /// reCaptcha challenge info. #[serde(rename="recaptchaChallenge")] pub recaptcha_challenge: Option, - /// The lead resource. The `LeadType` must not be `LEAD_TYPE_UNSPECIFIED` and either `email` or `phone_number` must be provided. + /// The lead resource. The `LeadType` must not be `LEAD_TYPE_UNSPECIFIED` + /// and either `email` or `phone_number` must be provided. pub lead: Option, } impl RequestValue for CreateLeadRequest {} -/// Common data that is in each API 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 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>, - /// Values to use instead of the user's respective defaults for the current request. These are only honored by whitelisted products. - #[serde(rename="userOverrides")] - pub user_overrides: Option, - /// Source of traffic for the current request. - #[serde(rename="trafficSource")] - pub traffic_source: Option, -} - -impl Part for RequestMetadata {} - - -/// Response message for ListUserStates. +/// A CompanyRelation resource representing information about a user's +/// affiliation and standing with a company in Partners. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where 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 states](struct.UserStateListCall.html) (response) +/// * [create company relation users](struct.UserCreateCompanyRelationCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListUserStatesResponse { - /// User's states. - #[serde(rename="userStates")] - pub user_states: Option>, - /// Current response metadata. - #[serde(rename="responseMetadata")] - pub response_metadata: Option, +pub struct CompanyRelation { + /// The AdWords manager account # associated this company. + #[serde(rename="managerAccount")] + pub manager_account: Option, + /// The website URL for this company. + pub website: Option, + /// The name (in the company's primary language) for the company. + pub name: Option, + /// The ID of the company. There may be no id if this is a + /// pending company.5 + #[serde(rename="companyId")] + pub company_id: Option, + /// The flag that indicates if the company is pending verification. + #[serde(rename="isPending")] + pub is_pending: Option, + /// The primary address for this company. + pub address: Option, + /// The timestamp of when affiliation was requested. + /// @OutputOnly + #[serde(rename="creationTime")] + pub creation_time: Option, + /// Indicates if the user is an admin for this company. + #[serde(rename="companyAdmin")] + pub company_admin: Option, + /// Whether the company is a Partner. + #[serde(rename="badgeTier")] + pub badge_tier: Option, + /// The state of relationship, in terms of approvals. + pub state: Option, + /// The phone number for the company's primary address. + #[serde(rename="phoneNumber")] + pub phone_number: Option, + /// A URL to a profile photo, e.g. a G+ profile photo. + #[serde(rename="logoUrl")] + pub logo_url: Option, + /// The timestamp when the user was approved. + /// @OutputOnly + #[serde(rename="resolvedTimestamp")] + pub resolved_timestamp: Option, + /// The segment the company is classified as. + pub segment: Option>, + /// The list of Google Partners specialization statuses for the company. + #[serde(rename="specializationStatus")] + pub specialization_status: Option>, } -impl ResponseResult for ListUserStatesResponse {} - - -/// Common data that is in each API 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 ResponseMetadata { - /// Debug information about this request. - #[serde(rename="debugInfo")] - pub debug_info: Option, -} - -impl Part for ResponseMetadata {} +impl RequestValue for CompanyRelation {} +impl ResponseResult for CompanyRelation {} /// Key value data pair for an event. @@ -883,47 +1831,120 @@ pub struct EventData { impl Part for EventData {} -/// Basic information from a public profile. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct PublicProfile { - /// The URL of the public profile. - pub url: Option, - /// The URL to the main display image of the public profile. - #[serde(rename="displayImageUrl")] - pub display_image_url: Option, - /// The display name of the public profile. - #[serde(rename="displayName")] - pub display_name: Option, - /// The ID which can be used to retrieve more details about the public profile. - pub id: Option, -} - -impl Part for PublicProfile {} - - -/// An object representing a latitude/longitude pair. This is expressed as a pair of doubles representing degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. Example of normalization code in Python: def NormalizeLongitude(longitude): """Wrapsdecimal 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 [-180.0, 180.0] and [-90.0, 90.0], respectively.""" r = latitude % 360.0 if r = 270.0: return r - 360, NormalizeLongitude(longitude) else: return 180 - r, NormalizeLongitude(longitude + 180.0) assert 180.0 == NormalizeLongitude(180.0) assert -180.0 == NormalizeLongitude(-180.0) assert -179.0 == NormalizeLongitude(181.0) assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LatLng { - /// The latitude in degrees. It must be in the range [-90.0, +90.0]. - pub latitude: Option, - /// The longitude in degrees. It must be in the range [-180.0, +180.0]. - pub longitude: Option, -} - -impl Part for LatLng {} - - // ################### // MethodBuilders ### // ################# +/// A builder providing access to all free methods, which are not associated with a particular resource. +/// It is not used directly, but through the `Partners` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_partners2 as partners2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use partners2::Partners; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Partners::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get_partnersstatus(...)`, `update_companies(...)` and `update_leads(...)` +/// // to build up your call. +/// let rb = hub.methods(); +/// # } +/// ``` +pub struct MethodMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, +} + +impl<'a, C, A> MethodsBuilder for MethodMethods<'a, C, A> {} + +impl<'a, C, A> MethodMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Update company. + /// Should only be called within the context of an authorized logged in user. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn update_companies(&self, request: Company) -> MethodUpdateCompanyCall<'a, C, A> { + MethodUpdateCompanyCall { + hub: self.hub, + _request: request, + _update_mask: Default::default(), + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets Partners Status of the logged in user's agency. + /// Should only be called if the logged in user is the admin of the agency. + pub fn get_partnersstatus(&self) -> MethodGetPartnersstatuCall<'a, C, A> { + MethodGetPartnersstatuCall { + hub: self.hub, + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates the specified lead. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn update_leads(&self, request: Lead) -> MethodUpdateLeadCall<'a, C, A> { + MethodUpdateLeadCall { + hub: self.hub, + _request: request, + _update_mask: Default::default(), + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *userEvent* resources. /// It is not used directly, but through the `Partners` hub. /// @@ -1021,7 +2042,9 @@ impl<'a, C, A> ClientMessageMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Logs a generic message from the client, such as `Failed to render component`, `Profile page is running slow`, `More than 500 users have accessed this result.`, etc. + /// Logs a generic message from the client, such as + /// `Failed to render component`, `Profile page is running slow`, + /// `More than 500 users have accessed this result.`, etc. /// /// # Arguments /// @@ -1129,6 +2152,7 @@ impl<'a, C, A> CompanyMethods<'a, C, A> { hub: self.hub, _website_url: Default::default(), _view: Default::default(), + _specializations: Default::default(), _services: Default::default(), _request_metadata_user_overrides_user_id: Default::default(), _request_metadata_user_overrides_ip_address: Default::default(), @@ -1159,6 +2183,276 @@ impl<'a, C, A> CompanyMethods<'a, C, A> { +/// A builder providing access to all methods supported on *lead* resources. +/// It is not used directly, but through the `Partners` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_partners2 as partners2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use partners2::Partners; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Partners::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.leads(); +/// # } +/// ``` +pub struct LeadMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, +} + +impl<'a, C, A> MethodsBuilder for LeadMethods<'a, C, A> {} + +impl<'a, C, A> LeadMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists advertiser leads for a user's associated company. + /// Should only be called within the context of an authorized logged in user. + pub fn list(&self) -> LeadListCall<'a, C, A> { + LeadListCall { + hub: self.hub, + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *analytic* resources. +/// It is not used directly, but through the `Partners` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_partners2 as partners2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use partners2::Partners; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Partners::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.analytics(); +/// # } +/// ``` +pub struct AnalyticMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, +} + +impl<'a, C, A> MethodsBuilder for AnalyticMethods<'a, C, A> {} + +impl<'a, C, A> AnalyticMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists analytics data for a user's associated company. + /// Should only be called within the context of an authorized logged in user. + pub fn list(&self) -> AnalyticListCall<'a, C, A> { + AnalyticListCall { + hub: self.hub, + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *offer* resources. +/// It is not used directly, but through the `Partners` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_partners2 as partners2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use partners2::Partners; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Partners::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `history_list(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.offers(); +/// # } +/// ``` +pub struct OfferMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, +} + +impl<'a, C, A> MethodsBuilder for OfferMethods<'a, C, A> {} + +impl<'a, C, A> OfferMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists the Historical Offers for the current user (or user's entire company) + pub fn history_list(&self) -> OfferHistoryListCall<'a, C, A> { + OfferHistoryListCall { + hub: self.hub, + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _page_token: Default::default(), + _page_size: Default::default(), + _order_by: Default::default(), + _entire_company: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Lists the Offers available for the current user + pub fn list(&self) -> OfferListCall<'a, C, A> { + OfferListCall { + hub: self.hub, + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *exam* resources. +/// It is not used directly, but through the `Partners` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_partners2 as partners2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use partners2::Partners; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Partners::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `get_token(...)` +/// // to build up your call. +/// let rb = hub.exams(); +/// # } +/// ``` +pub struct ExamMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, +} + +impl<'a, C, A> MethodsBuilder for ExamMethods<'a, C, A> {} + +impl<'a, C, A> ExamMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Gets an Exam Token for a Partner's user to take an exam in the Exams System + /// + /// # Arguments + /// + /// * `examType` - The exam type we are requesting a token for. + pub fn get_token(&self, exam_type: &str) -> ExamGetTokenCall<'a, C, A> { + ExamGetTokenCall { + hub: self.hub, + _exam_type: exam_type.to_string(), + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *userState* resources. /// It is not used directly, but through the `Partners` hub. /// @@ -1218,12 +2512,1074 @@ impl<'a, C, A> UserStateMethods<'a, C, A> { +/// A builder providing access to all methods supported on *user* resources. +/// It is not used directly, but through the `Partners` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_partners2 as partners2; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use partners2::Partners; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Partners::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `create_company_relation(...)`, `delete_company_relation(...)`, `get(...)` and `update_profile(...)` +/// // to build up your call. +/// let rb = hub.users(); +/// # } +/// ``` +pub struct UserMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, +} + +impl<'a, C, A> MethodsBuilder for UserMethods<'a, C, A> {} + +impl<'a, C, A> UserMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Updates a user's profile. A user can only update their own profile and + /// should only be called within the context of a logged in user. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn update_profile(&self, request: UserProfile) -> UserUpdateProfileCall<'a, C, A> { + UserUpdateProfileCall { + hub: self.hub, + _request: request, + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Creates a user's company relation. Affiliates the user to a company. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `userId` - The ID of the user. Can be set to me to mean + /// the currently authenticated user. + pub fn create_company_relation(&self, request: CompanyRelation, user_id: &str) -> UserCreateCompanyRelationCall<'a, C, A> { + UserCreateCompanyRelationCall { + hub: self.hub, + _request: request, + _user_id: user_id.to_string(), + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Gets a user. + /// + /// # Arguments + /// + /// * `userId` - Identifier of the user. Can be set to me to mean the currently + /// authenticated user. + pub fn get(&self, user_id: &str) -> UserGetCall<'a, C, A> { + UserGetCall { + hub: self.hub, + _user_id: user_id.to_string(), + _user_view: Default::default(), + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Deletes a user's company relation. Unaffiliaites the user from a company. + /// + /// # Arguments + /// + /// * `userId` - The ID of the user. Can be set to me to mean + /// the currently authenticated user. + pub fn delete_company_relation(&self, user_id: &str) -> UserDeleteCompanyRelationCall<'a, C, A> { + UserDeleteCompanyRelationCall { + hub: self.hub, + _user_id: user_id.to_string(), + _request_metadata_user_overrides_user_id: Default::default(), + _request_metadata_user_overrides_ip_address: Default::default(), + _request_metadata_traffic_source_traffic_sub_id: Default::default(), + _request_metadata_traffic_source_traffic_source_id: Default::default(), + _request_metadata_partners_session_id: Default::default(), + _request_metadata_locale: Default::default(), + _request_metadata_experiment_ids: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + // ################### // CallBuilders ### // ################# +/// Update company. +/// Should only be called within the context of an authorized logged in user. +/// +/// A builder for the *updateCompanies* method. +/// It is not used directly, but through a `MethodMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// use partners2::Company; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Company::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.methods().update_companies(req) +/// .update_mask("et") +/// .request_metadata_user_overrides_user_id("diam") +/// .request_metadata_user_overrides_ip_address("ipsum") +/// .request_metadata_traffic_source_traffic_sub_id("Lorem") +/// .request_metadata_traffic_source_traffic_source_id("et") +/// .request_metadata_partners_session_id("duo") +/// .request_metadata_locale("aliquyam") +/// .add_request_metadata_experiment_ids("sea") +/// .doit(); +/// # } +/// ``` +pub struct MethodUpdateCompanyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _request: Company, + _update_mask: Option, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for MethodUpdateCompanyCall<'a, C, A> {} + +impl<'a, C, A> MethodUpdateCompanyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Company)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "partners.updateCompanies", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + for &field in ["alt", "updateMask", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/companies".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).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::Patch, &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: Company) -> MethodUpdateCompanyCall<'a, C, A> { + self._request = new_value; + self + } + /// Standard field mask for the set of fields to be updated. + /// Required with at least 1 value in FieldMask's paths. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> MethodUpdateCompanyCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> MethodUpdateCompanyCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> MethodUpdateCompanyCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> MethodUpdateCompanyCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> MethodUpdateCompanyCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> MethodUpdateCompanyCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> MethodUpdateCompanyCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> MethodUpdateCompanyCall<'a, C, A> { + self._request_metadata_experiment_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) -> MethodUpdateCompanyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> MethodUpdateCompanyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Gets Partners Status of the logged in user's agency. +/// Should only be called if the logged in user is the admin of the agency. +/// +/// A builder for the *getPartnersstatus* method. +/// It is not used directly, but through a `MethodMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.methods().get_partnersstatus() +/// .request_metadata_user_overrides_user_id("Lorem") +/// .request_metadata_user_overrides_ip_address("eos") +/// .request_metadata_traffic_source_traffic_sub_id("erat") +/// .request_metadata_traffic_source_traffic_source_id("sadipscing") +/// .request_metadata_partners_session_id("dolor") +/// .request_metadata_locale("eirmod") +/// .add_request_metadata_experiment_ids("elitr") +/// .doit(); +/// # } +/// ``` +pub struct MethodGetPartnersstatuCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for MethodGetPartnersstatuCall<'a, C, A> {} + +impl<'a, C, A> MethodGetPartnersstatuCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, GetPartnersStatusResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "partners.getPartnersstatus", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + for &field in ["alt", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/partnersstatus".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + 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) + } + } + } + } + + + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> MethodGetPartnersstatuCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> MethodGetPartnersstatuCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> MethodGetPartnersstatuCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> MethodGetPartnersstatuCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> MethodGetPartnersstatuCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> MethodGetPartnersstatuCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> MethodGetPartnersstatuCall<'a, C, A> { + self._request_metadata_experiment_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) -> MethodGetPartnersstatuCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> MethodGetPartnersstatuCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Updates the specified lead. +/// +/// A builder for the *updateLeads* method. +/// It is not used directly, but through a `MethodMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// use partners2::Lead; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Lead::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.methods().update_leads(req) +/// .update_mask("amet") +/// .request_metadata_user_overrides_user_id("no") +/// .request_metadata_user_overrides_ip_address("labore") +/// .request_metadata_traffic_source_traffic_sub_id("eirmod") +/// .request_metadata_traffic_source_traffic_source_id("dolore") +/// .request_metadata_partners_session_id("invidunt") +/// .request_metadata_locale("aliquyam") +/// .add_request_metadata_experiment_ids("accusam") +/// .doit(); +/// # } +/// ``` +pub struct MethodUpdateLeadCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _request: Lead, + _update_mask: Option, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for MethodUpdateLeadCall<'a, C, A> {} + +impl<'a, C, A> MethodUpdateLeadCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Lead)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "partners.updateLeads", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + if let Some(value) = self._update_mask { + params.push(("updateMask", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + for &field in ["alt", "updateMask", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/leads".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).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::Patch, &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: Lead) -> MethodUpdateLeadCall<'a, C, A> { + self._request = new_value; + self + } + /// Standard field mask for the set of fields to be updated. + /// Required with at least 1 value in FieldMask's paths. + /// Only `state` and `adwords_customer_id` are currently supported. + /// + /// Sets the *update mask* query property to the given value. + pub fn update_mask(mut self, new_value: &str) -> MethodUpdateLeadCall<'a, C, A> { + self._update_mask = Some(new_value.to_string()); + self + } + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> MethodUpdateLeadCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> MethodUpdateLeadCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> MethodUpdateLeadCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> MethodUpdateLeadCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> MethodUpdateLeadCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> MethodUpdateLeadCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> MethodUpdateLeadCall<'a, C, A> { + self._request_metadata_experiment_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) -> MethodUpdateLeadCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> MethodUpdateLeadCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + /// Logs a user event. /// /// A builder for the *log* method supported by a *userEvent* resource. @@ -1298,7 +3654,7 @@ impl<'a, C, A> UserEventLogCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/userEvents:log"; + let mut url = "https://partners.googleapis.com/v2/userEvents:log".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1441,7 +3797,9 @@ impl<'a, C, A> UserEventLogCall<'a, C, A> where C: BorrowMut, A: } -/// Logs a generic message from the client, such as `Failed to render component`, `Profile page is running slow`, `More than 500 users have accessed this result.`, etc. +/// Logs a generic message from the client, such as +/// `Failed to render component`, `Profile page is running slow`, +/// `More than 500 users have accessed this result.`, etc. /// /// A builder for the *log* method supported by a *clientMessage* resource. /// It is not used directly, but through a `ClientMessageMethods` instance. @@ -1515,7 +3873,7 @@ impl<'a, C, A> ClientMessageLogCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/clientMessages:log"; + let mut url = "https://partners.googleapis.com/v2/clientMessages:log".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1685,17 +4043,17 @@ impl<'a, C, A> ClientMessageLogCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.companies().get("companyId") -/// .view("sit") -/// .request_metadata_user_overrides_user_id("Stet") -/// .request_metadata_user_overrides_ip_address("sed") +/// .view("sea") +/// .request_metadata_user_overrides_user_id("et") +/// .request_metadata_user_overrides_ip_address("duo") /// .request_metadata_traffic_source_traffic_sub_id("et") -/// .request_metadata_traffic_source_traffic_source_id("dolores") -/// .request_metadata_partners_session_id("kasd") -/// .request_metadata_locale("accusam") -/// .add_request_metadata_experiment_ids("takimata") -/// .order_by("justo") -/// .currency_code("amet.") -/// .address("erat") +/// .request_metadata_traffic_source_traffic_source_id("eirmod") +/// .request_metadata_partners_session_id("sanctus") +/// .request_metadata_locale("et") +/// .add_request_metadata_experiment_ids("amet") +/// .order_by("et") +/// .currency_code("consetetur") +/// .address("ut") /// .doit(); /// # } /// ``` @@ -1784,7 +4142,7 @@ impl<'a, C, A> CompanyGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/companies/{companyId}"; + let mut url = "https://partners.googleapis.com/v2/companies/{companyId}".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1892,7 +4250,8 @@ impl<'a, C, A> CompanyGetCall<'a, C, A> where C: BorrowMut, A: oa self._company_id = new_value.to_string(); self } - /// The view of `Company` resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`. + /// The view of `Company` resource to be returned. This must not be + /// `COMPANY_VIEW_UNSPECIFIED`. /// /// Sets the *view* query property to the given value. pub fn view(mut self, new_value: &str) -> CompanyGetCall<'a, C, A> { @@ -1913,14 +4272,18 @@ impl<'a, C, A> CompanyGetCall<'a, C, A> where C: BorrowMut, A: oa self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); self } - /// Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. /// /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> CompanyGetCall<'a, C, A> { self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); self } - /// Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. /// /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> CompanyGetCall<'a, C, A> { @@ -1949,21 +4312,27 @@ impl<'a, C, A> CompanyGetCall<'a, C, A> where C: BorrowMut, A: oa self._request_metadata_experiment_ids.push(new_value.to_string()); self } - /// How to order addresses within the returned company. Currently, only `address` and `address desc` is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively. + /// How to order addresses within the returned company. Currently, only + /// `address` and `address desc` is supported which will sorted by closest to + /// farthest in distance from given address and farthest to closest distance + /// from given address respectively. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> CompanyGetCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// If the company's budget is in a different currency code than this one, then the converted budget is converted to this currency code. + /// If the company's budget is in a different currency code than this one, then + /// the converted budget is converted to this currency code. /// /// Sets the *currency code* query property to the given value. pub fn currency_code(mut self, new_value: &str) -> CompanyGetCall<'a, C, A> { self._currency_code = Some(new_value.to_string()); self } - /// The address to use for sorting the company's addresses by proximity. If not given, the geo-located address of the request is used. Used when order_by is set. + /// The address to use for sorting the company's addresses by proximity. + /// If not given, the geo-located address of the request is used. + /// Used when order_by is set. /// /// Sets the *address* query property to the given value. pub fn address(mut self, new_value: &str) -> CompanyGetCall<'a, C, A> { @@ -2088,7 +4457,7 @@ impl<'a, C, A> CompanyLeadCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/companies/{companyId}/leads"; + let mut url = "https://partners.googleapis.com/v2/companies/{companyId}/leads".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2289,30 +4658,31 @@ impl<'a, C, A> CompanyLeadCreateCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.companies().list() -/// .website_url("sea") -/// .view("nonumy") -/// .add_services("dolores") -/// .request_metadata_user_overrides_user_id("gubergren") -/// .request_metadata_user_overrides_ip_address("sadipscing") -/// .request_metadata_traffic_source_traffic_sub_id("aliquyam") -/// .request_metadata_traffic_source_traffic_source_id("ea") -/// .request_metadata_partners_session_id("no") -/// .request_metadata_locale("justo") +/// .website_url("sed") +/// .view("dolor") +/// .add_specializations("dolor") +/// .add_services("dolor") +/// .request_metadata_user_overrides_user_id("et") +/// .request_metadata_user_overrides_ip_address("consetetur") +/// .request_metadata_traffic_source_traffic_sub_id("amet.") +/// .request_metadata_traffic_source_traffic_source_id("voluptua.") +/// .request_metadata_partners_session_id("Lorem") +/// .request_metadata_locale("gubergren") /// .add_request_metadata_experiment_ids("justo") -/// .page_token("et") -/// .page_size(-17) +/// .page_token("sit") +/// .page_size(-26) /// .order_by("diam") -/// .min_monthly_budget_units("ipsum") -/// .min_monthly_budget_nanos(-5) -/// .min_monthly_budget_currency_code("et") -/// .max_monthly_budget_units("duo") -/// .max_monthly_budget_nanos(-32) -/// .max_monthly_budget_currency_code("sea") -/// .add_language_codes("Lorem") -/// .add_industries("eos") -/// .add_gps_motivations("erat") -/// .company_name("sadipscing") -/// .address("dolor") +/// .min_monthly_budget_units("rebum.") +/// .min_monthly_budget_nanos(-45) +/// .min_monthly_budget_currency_code("sadipscing") +/// .max_monthly_budget_units("vero") +/// .max_monthly_budget_nanos(-95) +/// .max_monthly_budget_currency_code("invidunt") +/// .add_language_codes("consetetur") +/// .add_industries("dolore") +/// .add_gps_motivations("duo") +/// .company_name("aliquyam") +/// .address("Lorem") /// .doit(); /// # } /// ``` @@ -2322,6 +4692,7 @@ pub struct CompanyListCall<'a, C, A> hub: &'a Partners, _website_url: Option, _view: Option, + _specializations: Vec, _services: Vec, _request_metadata_user_overrides_user_id: Option, _request_metadata_user_overrides_ip_address: Option, @@ -2364,13 +4735,18 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "partners.companies.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((26 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((27 + self._additional_params.len())); if let Some(value) = self._website_url { params.push(("websiteUrl", value.to_string())); } if let Some(value) = self._view { params.push(("view", value.to_string())); } + if self._specializations.len() > 0 { + for f in self._specializations.iter() { + params.push(("specializations", f.to_string())); + } + } if self._services.len() > 0 { for f in self._services.iter() { params.push(("services", f.to_string())); @@ -2447,7 +4823,7 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o if let Some(value) = self._address { params.push(("address", value.to_string())); } - for &field in ["alt", "websiteUrl", "view", "services", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds", "pageToken", "pageSize", "orderBy", "minMonthlyBudget.units", "minMonthlyBudget.nanos", "minMonthlyBudget.currencyCode", "maxMonthlyBudget.units", "maxMonthlyBudget.nanos", "maxMonthlyBudget.currencyCode", "languageCodes", "industries", "gpsMotivations", "companyName", "address"].iter() { + for &field in ["alt", "websiteUrl", "view", "specializations", "services", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds", "pageToken", "pageSize", "orderBy", "minMonthlyBudget.units", "minMonthlyBudget.nanos", "minMonthlyBudget.currencyCode", "maxMonthlyBudget.units", "maxMonthlyBudget.nanos", "maxMonthlyBudget.currencyCode", "languageCodes", "industries", "gpsMotivations", "companyName", "address"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2459,7 +4835,7 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/companies"; + let mut url = "https://partners.googleapis.com/v2/companies".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2536,21 +4912,35 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o } - /// Website URL that will help to find a better matched company. . + /// Website URL that will help to find a better matched company. + /// . /// /// Sets the *website url* query property to the given value. pub fn website_url(mut self, new_value: &str) -> CompanyListCall<'a, C, A> { self._website_url = Some(new_value.to_string()); self } - /// The view of the `Company` resource to be returned. This must not be `COMPANY_VIEW_UNSPECIFIED`. + /// The view of the `Company` resource to be returned. This must not be + /// `COMPANY_VIEW_UNSPECIFIED`. /// /// Sets the *view* query property to the given value. pub fn view(mut self, new_value: &str) -> CompanyListCall<'a, C, A> { self._view = Some(new_value.to_string()); self } - /// List of services the company can help with. + /// List of specializations that the returned agencies should provide. If this + /// is not empty, any returned agency must have at least one of these + /// specializations, or one of the services in the "services" field. + /// + /// Append the given value to the *specializations* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_specializations(mut self, new_value: &str) -> CompanyListCall<'a, C, A> { + self._specializations.push(new_value.to_string()); + self + } + /// List of services that the returned agencies should provide. If this is + /// not empty, any returned agency must have at least one of these services, + /// or one of the specializations in the "specializations" field. /// /// Append the given value to the *services* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -2572,14 +4962,18 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); self } - /// Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. /// /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> CompanyListCall<'a, C, A> { self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); self } - /// Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. /// /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> CompanyListCall<'a, C, A> { @@ -2608,35 +5002,48 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o self._request_metadata_experiment_ids.push(new_value.to_string()); self } - /// A token identifying a page of results that the server returns. Typically, this is the value of `ListCompaniesResponse.next_page_token` returned from the previous call to ListCompanies. + /// A token identifying a page of results that the server returns. + /// Typically, this is the value of `ListCompaniesResponse.next_page_token` + /// returned from the previous call to + /// ListCompanies. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> CompanyListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Requested page size. Server may return fewer companies than requested. If unspecified, server picks an appropriate default. + /// Requested page size. Server may return fewer companies than requested. + /// If unspecified, server picks an appropriate default. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> CompanyListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// How to order addresses within the returned companies. Currently, only `address` and `address desc` is supported which will sorted by closest to farthest in distance from given address and farthest to closest distance from given address respectively. + /// How to order addresses within the returned companies. Currently, only + /// `address` and `address desc` is supported which will sorted by closest to + /// farthest in distance from given address and farthest to closest distance + /// from given address respectively. /// /// Sets the *order by* query property to the given value. pub fn order_by(mut self, new_value: &str) -> CompanyListCall<'a, C, A> { self._order_by = Some(new_value.to_string()); self } - /// The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + /// The whole units of the amount. + /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. /// /// Sets the *min monthly budget.units* query property to the given value. pub fn min_monthly_budget_units(mut self, new_value: &str) -> CompanyListCall<'a, C, A> { self._min_monthly_budget_units = Some(new_value.to_string()); self } - /// Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + /// Number of nano (10^-9) units of the amount. + /// The value must be between -999,999,999 and +999,999,999 inclusive. + /// If `units` is positive, `nanos` must be positive or zero. + /// If `units` is zero, `nanos` can be positive, zero, or negative. + /// If `units` is negative, `nanos` must be negative or zero. + /// For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. /// /// Sets the *min monthly budget.nanos* query property to the given value. pub fn min_monthly_budget_nanos(mut self, new_value: i32) -> CompanyListCall<'a, C, A> { @@ -2650,14 +5057,20 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o self._min_monthly_budget_currency_code = Some(new_value.to_string()); self } - /// The whole units of the amount. For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. + /// The whole units of the amount. + /// For example if `currencyCode` is `"USD"`, then 1 unit is one US dollar. /// /// Sets the *max monthly budget.units* query property to the given value. pub fn max_monthly_budget_units(mut self, new_value: &str) -> CompanyListCall<'a, C, A> { self._max_monthly_budget_units = Some(new_value.to_string()); self } - /// Number of nano (10^-9) units of the amount. The value must be between -999,999,999 and +999,999,999 inclusive. If `units` is positive, `nanos` must be positive or zero. If `units` is zero, `nanos` can be positive, zero, or negative. If `units` is negative, `nanos` must be negative or zero. For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. + /// Number of nano (10^-9) units of the amount. + /// The value must be between -999,999,999 and +999,999,999 inclusive. + /// If `units` is positive, `nanos` must be positive or zero. + /// If `units` is zero, `nanos` can be positive, zero, or negative. + /// If `units` is negative, `nanos` must be negative or zero. + /// For example $-1.75 is represented as `units`=-1 and `nanos`=-750,000,000. /// /// Sets the *max monthly budget.nanos* query property to the given value. pub fn max_monthly_budget_nanos(mut self, new_value: i32) -> CompanyListCall<'a, C, A> { @@ -2671,7 +5084,10 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o self._max_monthly_budget_currency_code = Some(new_value.to_string()); self } - /// List of language codes that company can support. Only primary language subtags are accepted as defined by BCP 47 (IETF BCP 47, "Tags for Identifying Languages"). + /// List of language codes that company can support. Only primary language + /// subtags are accepted as defined by + /// BCP 47 + /// (IETF BCP 47, "Tags for Identifying Languages"). /// /// Append the given value to the *language codes* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -2702,7 +5118,8 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o self._company_name = Some(new_value.to_string()); self } - /// The address to use when searching for companies. If not given, the geo-located address of the request is used. + /// The address to use when searching for companies. + /// If not given, the geo-located address of the request is used. /// /// Sets the *address* query property to the given value. pub fn address(mut self, new_value: &str) -> CompanyListCall<'a, C, A> { @@ -2751,6 +5168,1555 @@ impl<'a, C, A> CompanyListCall<'a, C, A> where C: BorrowMut, A: o } +/// Lists advertiser leads for a user's associated company. +/// Should only be called within the context of an authorized logged in user. +/// +/// A builder for the *list* method supported by a *lead* resource. +/// It is not used directly, but through a `LeadMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.leads().list() +/// .request_metadata_user_overrides_user_id("et") +/// .request_metadata_user_overrides_ip_address("clita") +/// .request_metadata_traffic_source_traffic_sub_id("consetetur") +/// .request_metadata_traffic_source_traffic_source_id("takimata") +/// .request_metadata_partners_session_id("nonumy") +/// .request_metadata_locale("kasd") +/// .add_request_metadata_experiment_ids("sanctus") +/// .page_token("takimata") +/// .page_size(-27) +/// .order_by("labore") +/// .doit(); +/// # } +/// ``` +pub struct LeadListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for LeadListCall<'a, C, A> {} + +impl<'a, C, A> LeadListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListLeadsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "partners.leads.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + for &field in ["alt", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds", "pageToken", "pageSize", "orderBy"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/leads".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + 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) + } + } + } + } + + + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> LeadListCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> LeadListCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> LeadListCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> LeadListCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> LeadListCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> LeadListCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> LeadListCall<'a, C, A> { + self._request_metadata_experiment_ids.push(new_value.to_string()); + self + } + /// A token identifying a page of results that the server returns. + /// Typically, this is the value of `ListLeadsResponse.next_page_token` + /// returned from the previous call to + /// ListLeads. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> LeadListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Requested page size. Server may return fewer leads than requested. + /// If unspecified, server picks an appropriate default. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> LeadListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// How to order Leads. Currently, only `create_time` + /// and `create_time desc` are supported + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> LeadListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> LeadListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> LeadListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Lists analytics data for a user's associated company. +/// Should only be called within the context of an authorized logged in user. +/// +/// A builder for the *list* method supported by a *analytic* resource. +/// It is not used directly, but through a `AnalyticMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.analytics().list() +/// .request_metadata_user_overrides_user_id("invidunt") +/// .request_metadata_user_overrides_ip_address("ea") +/// .request_metadata_traffic_source_traffic_sub_id("sadipscing") +/// .request_metadata_traffic_source_traffic_source_id("rebum.") +/// .request_metadata_partners_session_id("dolore") +/// .request_metadata_locale("nonumy") +/// .add_request_metadata_experiment_ids("sed") +/// .page_token("aliquyam") +/// .page_size(-53) +/// .doit(); +/// # } +/// ``` +pub struct AnalyticListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _page_token: Option, + _page_size: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for AnalyticListCall<'a, C, A> {} + +impl<'a, C, A> AnalyticListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListAnalyticsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "partners.analytics.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + for &field in ["alt", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds", "pageToken", "pageSize"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/analytics".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + 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) + } + } + } + } + + + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> AnalyticListCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> AnalyticListCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> AnalyticListCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> AnalyticListCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> AnalyticListCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> AnalyticListCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> AnalyticListCall<'a, C, A> { + self._request_metadata_experiment_ids.push(new_value.to_string()); + self + } + /// A token identifying a page of results that the server returns. + /// Typically, this is the value of `ListAnalyticsResponse.next_page_token` + /// returned from the previous call to + /// ListAnalytics. + /// Will be a date string in `YYYY-MM-DD` format representing the end date + /// of the date range of results to return. + /// If unspecified or set to "", default value is the current date. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> AnalyticListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Requested page size. Server may return fewer analytics than requested. + /// If unspecified or set to 0, default value is 30. + /// Specifies the number of days in the date range when querying analytics. + /// The `page_token` represents the end date of the date range + /// and the start date is calculated using the `page_size` as the number + /// of days BEFORE the end date. + /// Must be a non-negative integer. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> AnalyticListCall<'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) -> AnalyticListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> AnalyticListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Lists the Historical Offers for the current user (or user's entire company) +/// +/// A builder for the *history.list* method supported by a *offer* resource. +/// It is not used directly, but through a `OfferMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.offers().history_list() +/// .request_metadata_user_overrides_user_id("eirmod") +/// .request_metadata_user_overrides_ip_address("consetetur") +/// .request_metadata_traffic_source_traffic_sub_id("labore") +/// .request_metadata_traffic_source_traffic_source_id("sed") +/// .request_metadata_partners_session_id("ea") +/// .request_metadata_locale("gubergren") +/// .add_request_metadata_experiment_ids("aliquyam") +/// .page_token("eos") +/// .page_size(-38) +/// .order_by("sea") +/// .entire_company(false) +/// .doit(); +/// # } +/// ``` +pub struct OfferHistoryListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _page_token: Option, + _page_size: Option, + _order_by: Option, + _entire_company: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for OfferHistoryListCall<'a, C, A> {} + +impl<'a, C, A> OfferHistoryListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOffersHistoryResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "partners.offers.history.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((13 + self._additional_params.len())); + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + if let Some(value) = self._page_token { + params.push(("pageToken", value.to_string())); + } + if let Some(value) = self._page_size { + params.push(("pageSize", value.to_string())); + } + if let Some(value) = self._order_by { + params.push(("orderBy", value.to_string())); + } + if let Some(value) = self._entire_company { + params.push(("entireCompany", value.to_string())); + } + for &field in ["alt", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds", "pageToken", "pageSize", "orderBy", "entireCompany"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/offers/history".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + 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) + } + } + } + } + + + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> OfferHistoryListCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> OfferHistoryListCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> OfferHistoryListCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> OfferHistoryListCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> OfferHistoryListCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> OfferHistoryListCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> OfferHistoryListCall<'a, C, A> { + self._request_metadata_experiment_ids.push(new_value.to_string()); + self + } + /// Token to retrieve a specific page. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> OfferHistoryListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of rows to return per page. + /// + /// Sets the *page size* query property to the given value. + pub fn page_size(mut self, new_value: i32) -> OfferHistoryListCall<'a, C, A> { + self._page_size = Some(new_value); + self + } + /// Comma-separated list of fields to order by, e.g.: "foo,bar,baz". + /// Use "foo desc" to sort descending. + /// List of valid field names is: name, offer_code, expiration_time, status, + /// last_modified_time, sender_name, creation_time, country_code, + /// offer_type. + /// + /// Sets the *order by* query property to the given value. + pub fn order_by(mut self, new_value: &str) -> OfferHistoryListCall<'a, C, A> { + self._order_by = Some(new_value.to_string()); + self + } + /// if true, show history for the entire company. Requires user to be admin. + /// + /// Sets the *entire company* query property to the given value. + pub fn entire_company(mut self, new_value: bool) -> OfferHistoryListCall<'a, C, A> { + self._entire_company = 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) -> OfferHistoryListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> OfferHistoryListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Lists the Offers available for the current user +/// +/// A builder for the *list* method supported by a *offer* resource. +/// It is not used directly, but through a `OfferMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.offers().list() +/// .request_metadata_user_overrides_user_id("ipsum") +/// .request_metadata_user_overrides_ip_address("aliquyam") +/// .request_metadata_traffic_source_traffic_sub_id("dolores") +/// .request_metadata_traffic_source_traffic_source_id("sit") +/// .request_metadata_partners_session_id("diam") +/// .request_metadata_locale("ut") +/// .add_request_metadata_experiment_ids("justo") +/// .doit(); +/// # } +/// ``` +pub struct OfferListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for OfferListCall<'a, C, A> {} + +impl<'a, C, A> OfferListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListOffersResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "partners.offers.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + for &field in ["alt", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/offers".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + 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) + } + } + } + } + + + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> OfferListCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> OfferListCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> OfferListCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> OfferListCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> OfferListCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> OfferListCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> OfferListCall<'a, C, A> { + self._request_metadata_experiment_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) -> OfferListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> OfferListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Gets an Exam Token for a Partner's user to take an exam in the Exams System +/// +/// A builder for the *getToken* method supported by a *exam* resource. +/// It is not used directly, but through a `ExamMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.exams().get_token("examType") +/// .request_metadata_user_overrides_user_id("amet") +/// .request_metadata_user_overrides_ip_address("accusam") +/// .request_metadata_traffic_source_traffic_sub_id("clita") +/// .request_metadata_traffic_source_traffic_source_id("diam") +/// .request_metadata_partners_session_id("justo") +/// .request_metadata_locale("est") +/// .add_request_metadata_experiment_ids("clita") +/// .doit(); +/// # } +/// ``` +pub struct ExamGetTokenCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _exam_type: String, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for ExamGetTokenCall<'a, C, A> {} + +impl<'a, C, A> ExamGetTokenCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ExamToken)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "partners.exams.getToken", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("examType", self._exam_type.to_string())); + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + for &field in ["alt", "examType", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/exams/{examType}/token".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + for &(find_this, param_name) in [("{examType}", "examType")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["examType"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The exam type we are requesting a token for. + /// + /// Sets the *exam 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 exam_type(mut self, new_value: &str) -> ExamGetTokenCall<'a, C, A> { + self._exam_type = new_value.to_string(); + self + } + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> ExamGetTokenCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> ExamGetTokenCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> ExamGetTokenCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> ExamGetTokenCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> ExamGetTokenCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> ExamGetTokenCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> ExamGetTokenCall<'a, C, A> { + self._request_metadata_experiment_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) -> ExamGetTokenCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> ExamGetTokenCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + /// Lists states for current user. /// /// A builder for the *list* method supported by a *userState* resource. @@ -2778,13 +6744,13 @@ impl<'a, C, A> CompanyListCall<'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.user_states().list() -/// .request_metadata_user_overrides_user_id("eirmod") -/// .request_metadata_user_overrides_ip_address("elitr") -/// .request_metadata_traffic_source_traffic_sub_id("amet") -/// .request_metadata_traffic_source_traffic_source_id("no") -/// .request_metadata_partners_session_id("labore") -/// .request_metadata_locale("eirmod") -/// .add_request_metadata_experiment_ids("dolore") +/// .request_metadata_user_overrides_user_id("invidunt") +/// .request_metadata_user_overrides_ip_address("ut") +/// .request_metadata_traffic_source_traffic_sub_id("dolores") +/// .request_metadata_traffic_source_traffic_source_id("eos") +/// .request_metadata_partners_session_id("voluptua.") +/// .request_metadata_locale("duo") +/// .add_request_metadata_experiment_ids("sed") /// .doit(); /// # } /// ``` @@ -2855,7 +6821,7 @@ impl<'a, C, A> UserStateListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/userStates"; + let mut url = "https://partners.googleapis.com/v2/userStates".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2946,14 +6912,18 @@ impl<'a, C, A> UserStateListCall<'a, C, A> where C: BorrowMut, A: self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); self } - /// Second level identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. /// /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> UserStateListCall<'a, C, A> { self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); self } - /// Identifier to indicate where the traffic comes from. An identifier has multiple letters created by a team which redirected the traffic to us. + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. /// /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> UserStateListCall<'a, C, A> { @@ -3024,3 +6994,1289 @@ impl<'a, C, A> UserStateListCall<'a, C, A> where C: BorrowMut, A: } +/// Updates a user's profile. A user can only update their own profile and +/// should only be called within the context of a logged in user. +/// +/// A builder for the *updateProfile* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// use partners2::UserProfile; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = UserProfile::default(); +/// +/// // You can configure optional parameters by calling 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().update_profile(req) +/// .request_metadata_user_overrides_user_id("aliquyam") +/// .request_metadata_user_overrides_ip_address("ea") +/// .request_metadata_traffic_source_traffic_sub_id("ea") +/// .request_metadata_traffic_source_traffic_source_id("et") +/// .request_metadata_partners_session_id("dolor") +/// .request_metadata_locale("diam") +/// .add_request_metadata_experiment_ids("kasd") +/// .doit(); +/// # } +/// ``` +pub struct UserUpdateProfileCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _request: UserProfile, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for UserUpdateProfileCall<'a, C, A> {} + +impl<'a, C, A> UserUpdateProfileCall<'a, C, 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: "partners.users.updateProfile", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + for &field in ["alt", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/users/profile".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).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::Patch, &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: UserProfile) -> UserUpdateProfileCall<'a, C, A> { + self._request = new_value; + self + } + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> UserUpdateProfileCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> UserUpdateProfileCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> UserUpdateProfileCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> UserUpdateProfileCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> UserUpdateProfileCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> UserUpdateProfileCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> UserUpdateProfileCall<'a, C, A> { + self._request_metadata_experiment_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) -> UserUpdateProfileCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> UserUpdateProfileCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Creates a user's company relation. Affiliates the user to a company. +/// +/// A builder for the *createCompanyRelation* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// use partners2::CompanyRelation; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = CompanyRelation::default(); +/// +/// // You can configure optional parameters by calling 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().create_company_relation(req, "userId") +/// .request_metadata_user_overrides_user_id("rebum.") +/// .request_metadata_user_overrides_ip_address("Lorem") +/// .request_metadata_traffic_source_traffic_sub_id("clita") +/// .request_metadata_traffic_source_traffic_source_id("invidunt") +/// .request_metadata_partners_session_id("eirmod") +/// .request_metadata_locale("At") +/// .add_request_metadata_experiment_ids("consetetur") +/// .doit(); +/// # } +/// ``` +pub struct UserCreateCompanyRelationCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _request: CompanyRelation, + _user_id: String, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for UserCreateCompanyRelationCall<'a, C, A> {} + +impl<'a, C, A> UserCreateCompanyRelationCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, CompanyRelation)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "partners.users.createCompanyRelation", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + for &field in ["alt", "userId", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/users/{userId}/companyRelation".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + for &(find_this, param_name) in [("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["userId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Put, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: CompanyRelation) -> UserCreateCompanyRelationCall<'a, C, A> { + self._request = new_value; + self + } + /// The ID of the user. Can be set to me to mean + /// the currently authenticated user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserCreateCompanyRelationCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> UserCreateCompanyRelationCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> UserCreateCompanyRelationCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> UserCreateCompanyRelationCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> UserCreateCompanyRelationCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> UserCreateCompanyRelationCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> UserCreateCompanyRelationCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> UserCreateCompanyRelationCall<'a, C, A> { + self._request_metadata_experiment_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) -> UserCreateCompanyRelationCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> UserCreateCompanyRelationCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Gets a user. +/// +/// A builder for the *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 yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.users().get("userId") +/// .user_view("sed") +/// .request_metadata_user_overrides_user_id("sit") +/// .request_metadata_user_overrides_ip_address("takimata") +/// .request_metadata_traffic_source_traffic_sub_id("elitr") +/// .request_metadata_traffic_source_traffic_source_id("nonumy") +/// .request_metadata_partners_session_id("rebum.") +/// .request_metadata_locale("Lorem") +/// .add_request_metadata_experiment_ids("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct UserGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _user_id: String, + _user_view: Option, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for UserGetCall<'a, C, A> {} + +impl<'a, C, A> UserGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, User)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "partners.users.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + if let Some(value) = self._user_view { + params.push(("userView", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + for &field in ["alt", "userId", "userView", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/users/{userId}".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + for &(find_this, param_name) in [("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["userId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + 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) + } + } + } + } + + + /// Identifier of the user. Can be set to me to mean the currently + /// authenticated user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// Specifies what parts of the user information to return. + /// + /// Sets the *user view* query property to the given value. + pub fn user_view(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._user_view = Some(new_value.to_string()); + self + } + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> UserGetCall<'a, C, A> { + self._request_metadata_experiment_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) -> UserGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> UserGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Deletes a user's company relation. Unaffiliaites the user from a company. +/// +/// A builder for the *deleteCompanyRelation* method supported by a *user* resource. +/// It is not used directly, but through a `UserMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_partners2 as partners2; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use partners2::Partners; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Partners::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.users().delete_company_relation("userId") +/// .request_metadata_user_overrides_user_id("ut") +/// .request_metadata_user_overrides_ip_address("ut") +/// .request_metadata_traffic_source_traffic_sub_id("amet.") +/// .request_metadata_traffic_source_traffic_source_id("ipsum") +/// .request_metadata_partners_session_id("ut") +/// .request_metadata_locale("dolor") +/// .add_request_metadata_experiment_ids("sea") +/// .doit(); +/// # } +/// ``` +pub struct UserDeleteCompanyRelationCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Partners, + _user_id: String, + _request_metadata_user_overrides_user_id: Option, + _request_metadata_user_overrides_ip_address: Option, + _request_metadata_traffic_source_traffic_sub_id: Option, + _request_metadata_traffic_source_traffic_source_id: Option, + _request_metadata_partners_session_id: Option, + _request_metadata_locale: Option, + _request_metadata_experiment_ids: Vec, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for UserDeleteCompanyRelationCall<'a, C, A> {} + +impl<'a, C, A> UserDeleteCompanyRelationCall<'a, C, 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: "partners.users.deleteCompanyRelation", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("userId", self._user_id.to_string())); + if let Some(value) = self._request_metadata_user_overrides_user_id { + params.push(("requestMetadata.userOverrides.userId", value.to_string())); + } + if let Some(value) = self._request_metadata_user_overrides_ip_address { + params.push(("requestMetadata.userOverrides.ipAddress", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_sub_id { + params.push(("requestMetadata.trafficSource.trafficSubId", value.to_string())); + } + if let Some(value) = self._request_metadata_traffic_source_traffic_source_id { + params.push(("requestMetadata.trafficSource.trafficSourceId", value.to_string())); + } + if let Some(value) = self._request_metadata_partners_session_id { + params.push(("requestMetadata.partnersSessionId", value.to_string())); + } + if let Some(value) = self._request_metadata_locale { + params.push(("requestMetadata.locale", value.to_string())); + } + if self._request_metadata_experiment_ids.len() > 0 { + for f in self._request_metadata_experiment_ids.iter() { + params.push(("requestMetadata.experimentIds", f.to_string())); + } + } + for &field in ["alt", "userId", "requestMetadata.userOverrides.userId", "requestMetadata.userOverrides.ipAddress", "requestMetadata.trafficSource.trafficSubId", "requestMetadata.trafficSource.trafficSourceId", "requestMetadata.partnersSessionId", "requestMetadata.locale", "requestMetadata.experimentIds"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://partners.googleapis.com/v2/users/{userId}/companyRelation".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + for &(find_this, param_name) in [("{userId}", "userId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["userId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Delete, &url) + .header(UserAgent(self.hub._user_agent.clone())); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 user. Can be set to me to mean + /// the currently authenticated user. + /// + /// Sets the *user id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn user_id(mut self, new_value: &str) -> UserDeleteCompanyRelationCall<'a, C, A> { + self._user_id = new_value.to_string(); + self + } + /// Logged-in user ID to impersonate instead of the user's ID. + /// + /// Sets the *request metadata.user overrides.user id* query property to the given value. + pub fn request_metadata_user_overrides_user_id(mut self, new_value: &str) -> UserDeleteCompanyRelationCall<'a, C, A> { + self._request_metadata_user_overrides_user_id = Some(new_value.to_string()); + self + } + /// IP address to use instead of the user's geo-located IP address. + /// + /// Sets the *request metadata.user overrides.ip address* query property to the given value. + pub fn request_metadata_user_overrides_ip_address(mut self, new_value: &str) -> UserDeleteCompanyRelationCall<'a, C, A> { + self._request_metadata_user_overrides_ip_address = Some(new_value.to_string()); + self + } + /// Second level identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic sub id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_sub_id(mut self, new_value: &str) -> UserDeleteCompanyRelationCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_sub_id = Some(new_value.to_string()); + self + } + /// Identifier to indicate where the traffic comes from. + /// An identifier has multiple letters created by a team which redirected the + /// traffic to us. + /// + /// Sets the *request metadata.traffic source.traffic source id* query property to the given value. + pub fn request_metadata_traffic_source_traffic_source_id(mut self, new_value: &str) -> UserDeleteCompanyRelationCall<'a, C, A> { + self._request_metadata_traffic_source_traffic_source_id = Some(new_value.to_string()); + self + } + /// Google Partners session ID. + /// + /// Sets the *request metadata.partners session id* query property to the given value. + pub fn request_metadata_partners_session_id(mut self, new_value: &str) -> UserDeleteCompanyRelationCall<'a, C, A> { + self._request_metadata_partners_session_id = Some(new_value.to_string()); + self + } + /// Locale to use for the current request. + /// + /// Sets the *request metadata.locale* query property to the given value. + pub fn request_metadata_locale(mut self, new_value: &str) -> UserDeleteCompanyRelationCall<'a, C, A> { + self._request_metadata_locale = Some(new_value.to_string()); + self + } + /// Experiment IDs the current request belongs to. + /// + /// Append the given value to the *request metadata.experiment ids* query property. + /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. + pub fn add_request_metadata_experiment_ids(mut self, new_value: &str) -> UserDeleteCompanyRelationCall<'a, C, A> { + self._request_metadata_experiment_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) -> UserDeleteCompanyRelationCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> UserDeleteCompanyRelationCall<'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/people1-cli/Cargo.toml b/gen/people1-cli/Cargo.toml index 79e4d8414a..4fd89acc23 100644 --- a/gen/people1-cli/Cargo.toml +++ b/gen/people1-cli/Cargo.toml @@ -4,9 +4,9 @@ [package] name = "google-people1-cli" -version = "1.0.4+20160210" +version = "1.0.4+20170518" authors = ["Sebastian Thiel "] -description = "A complete library to interact with people (protocol v1)" +description = "A complete library to interact with People Service (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/people1-cli" homepage = "https://developers.google.com/people/" documentation = "http://byron.github.io/google-apis-rs/google_people1_cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-people1] path = "../people1" -version = "1.0.4+20160210" +version = "1.0.4+20170518" diff --git a/gen/people1-cli/README.md b/gen/people1-cli/README.md index 1494a6ed4c..f6217206f3 100644 --- a/gen/people1-cli/README.md +++ b/gen/people1-cli/README.md @@ -3,14 +3,14 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `people1` command-line interface *(CLI)* allows to use most features of the *Google people* service from the comfort of your terminal. +The `people1` command-line interface *(CLI)* allows to use most features of the *Google People 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 *people* API can be found at the +Everything else about the *People Service* API can be found at the [official documentation site](https://developers.google.com/people/). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *people* API at revision *20160210*. The CLI is at version *1.0.4*. +This documentation was generated from the *People Service* API at revision *20170518*. The CLI is at version *1.0.4*. ```bash people1 [options] diff --git a/gen/people1-cli/mkdocs.yml b/gen/people1-cli/mkdocs.yml index 19d7ccf796..fb56e98498 100644 --- a/gen/people1-cli/mkdocs.yml +++ b/gen/people1-cli/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: people v1.0.4+20160210 +site_name: People Service v1.0.4+20170518 site_url: http://byron.github.io/google-apis-rs/google-people1-cli -site_description: A complete library to interact with people (protocol v1) +site_description: A complete library to interact with People Service (protocol v1) repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/people1-cli diff --git a/gen/people1-cli/src/main.rs b/gen/people1-cli/src/main.rs index 654ba17f65..37dfff5f4b 100644 --- a/gen/people1-cli/src/main.rs +++ b/gen/people1-cli/src/main.rs @@ -39,7 +39,7 @@ enum DoitError { struct Engine<'n> { opt: ArgMatches<'n>, - hub: api::People>, + hub: api::PeopleService>, gp: Vec<&'static str>, gpm: Vec<(&'static str, &'static str)>, } @@ -58,6 +58,9 @@ impl<'n> Engine<'n> { "sort-order" => { call = call.sort_order(value.unwrap_or("")); }, + "request-sync-token" => { + call = call.request_sync_token(arg_from_str(value.unwrap_or("false"), err, "request-sync-token", "boolean")); + }, "request-mask-include-field" => { call = call.request_mask_include_field(value.unwrap_or("")); }, @@ -80,7 +83,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(["sync-token", "page-size", "sort-order", "page-token", "request-mask-include-field"].iter().map(|v|*v)); + v.extend(["sync-token", "page-size", "request-mask-include-field", "page-token", "sort-order", "request-sync-token"].iter().map(|v|*v)); v } )); } } @@ -305,7 +308,7 @@ impl<'n> Engine<'n> { }; let engine = Engine { opt: opt, - hub: api::People::new(client, auth), + hub: api::PeopleService::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"), @@ -339,7 +342,8 @@ fn main() { let arg_data = [ ("people", "methods: 'connections-list', 'get' and 'get-batch-get'", vec![ ("connections-list", - Some(r##"Provides a list of the authenticated user's contacts merged with any linked profiles."##), + Some(r##"Provides a list of the authenticated user's contacts merged with any + linked profiles."##), "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_connections-list", vec![ (Some(r##"resource-name"##), @@ -361,12 +365,18 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Provides information about a person resource for a resource name. Use `people/me` to indicate the authenticated user."##), + Some(r##"Provides information about a person for a resource name. Use + `people/me` to indicate the authenticated user."##), "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_get", vec![ (Some(r##"resource-name"##), None, - Some(r##"The resource name of the person to provide information about. - To get information about the authenticated user, specify `people/me`. - To get information about any user, specify the resource name that identifies the user, such as the resource names returned by [`people.connections.list`](/people/api/rest/v1/people.connections/list)."##), + Some(r##"The resource name of the person to provide information about. + + - To get information about the authenticated user, specify `people/me`. + - To get information about any user, specify the resource name that + identifies the user, such as the resource names returned by + [`people.connections.list`](/people/api/rest/v1/people.connections/list)."##), Some(true), Some(false)), @@ -383,7 +393,9 @@ fn main() { Some(false)), ]), ("get-batch-get", - Some(r##"Provides information about a list of specific people by specifying a list of requested resource names. Use `people/me` to indicate the authenticated user."##), + Some(r##"Provides information about a list of specific people by specifying a list + of requested resource names. Use `people/me` to indicate the authenticated + user."##), "Details at http://byron.github.io/google-apis-rs/google_people1_cli/people_get-batch-get", vec![ (Some(r##"v"##), @@ -404,8 +416,8 @@ fn main() { let mut app = App::new("people1") .author("Sebastian Thiel ") - .version("1.0.4+20160210") - .about("The Google People API service gives access to information about profiles and contacts.") + .version("1.0.4+20170518") + .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") .long("scope") diff --git a/gen/people1/Cargo.toml b/gen/people1/Cargo.toml index 18ccf470d3..61c4817753 100644 --- a/gen/people1/Cargo.toml +++ b/gen/people1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-people1" -version = "1.0.4+20160210" +version = "1.0.4+20170518" authors = ["Sebastian Thiel "] -description = "A complete library to interact with people (protocol v1)" +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.4+20160210" +documentation = "https://docs.rs/google-people1/1.0.4+20170518" license = "MIT" keywords = ["people", "google", "protocol", "web", "api"] diff --git a/gen/people1/README.md b/gen/people1/README.md index d5eed41228..817450ae7f 100644 --- a/gen/people1/README.md +++ b/gen/people1/README.md @@ -3,18 +3,18 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-people1` library allows access to all features of the *Google people* service. +The `google-people1` library allows access to all features of the *Google People Service* service. -This documentation was generated from *people* crate version *1.0.4+20160210*, where *20160210* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *People Service* crate version *1.0.4+20170518*, where *20170518* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. -Everything else about the *people* *v1* API can be found at the +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.4+20160210/google_people1/struct.People.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-people1/1.0.4+20170518/google_people1/struct.PeopleService.html) ... * people - * [*connections list*](https://docs.rs/google-people1/1.0.4+20160210/google_people1/struct.PeopleConnectionListCall.html), [*get*](https://docs.rs/google-people1/1.0.4+20160210/google_people1/struct.PeopleGetCall.html) and [*get batch get*](https://docs.rs/google-people1/1.0.4+20160210/google_people1/struct.PeopleGetBatchGetCall.html) + * [*connections list*](https://docs.rs/google-people1/1.0.4+20170518/google_people1/struct.PeopleConnectionListCall.html), [*get*](https://docs.rs/google-people1/1.0.4+20170518/google_people1/struct.PeopleGetCall.html) and [*get batch get*](https://docs.rs/google-people1/1.0.4+20170518/google_people1/struct.PeopleGetBatchGetCall.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-people1/1.0.4+20160210/google_people1/struct.People.html)** +* **[Hub](https://docs.rs/google-people1/1.0.4+20170518/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.4+20160210/google_people1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-people1/1.0.4+20160210/google_people1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-people1/1.0.4+20160210/google_people1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-people1/1.0.4+20170518/google_people1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-people1/1.0.4+20170518/google_people1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-people1/1.0.4+20170518/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.4+20160210/google_people1/trait.Part.html)** + * **[Parts](https://docs.rs/google-people1/1.0.4+20170518/google_people1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-people1/1.0.4+20160210/google_people1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-people1/1.0.4+20170518/google_people1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -75,7 +75,7 @@ extern crate google_people1 as people1; use people1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -use people1::People; +use people1::PeopleService; // Get an ApplicationSecret instance by some means. It contains the `client_id` and // `client_secret`, among other things. @@ -88,7 +88,7 @@ let secret: ApplicationSecret = Default::default(); let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::new(), ::default(), None); -let mut hub = People::new(hyper::Client::new(), auth); +let mut hub = PeopleService::new(hyper::Client::new(), auth); // You can configure optional parameters by calling the respective setters at will, and // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! @@ -116,17 +116,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-people1/1.0.4+20160210/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.4+20170518/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.4+20160210/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.4+20170518/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.4+20160210/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.4+20170518/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.4+20160210/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.4+20170518/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")`. @@ -136,29 +136,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-people1/1.0.4+20160210/google_people1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-people1/1.0.4+20160210/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.4+20170518/google_people1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-people1/1.0.4+20170518/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.4+20160210/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.4+20170518/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.4+20160210/google_people1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-people1/1.0.4+20160210/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.4+20170518/google_people1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-people1/1.0.4+20170518/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.4+20160210/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.4+20170518/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.4+20160210/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.4+20170518/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.4+20160210/google_people1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-people1/1.0.4+20170518/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 32e352bac2..55680ab61b 100644 --- a/gen/people1/src/lib.rs +++ b/gen/people1/src/lib.rs @@ -2,14 +2,14 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *people* crate version *1.0.4+20160210*, where *20160210* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *People Service* crate version *1.0.4+20170518*, where *20170518* is the exact revision of the *people:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! -//! Everything else about the *people* *v1* API can be found at the +//! Everything else about the *People Service* *v1* API can be found at the //! [official documentation site](https://developers.google.com/people/). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/people1). //! # Features //! -//! Handle the following *Resources* with ease from the central [hub](struct.People.html) ... +//! Handle the following *Resources* with ease from the central [hub](struct.PeopleService.html) ... //! //! * people //! * [*connections list*](struct.PeopleConnectionListCall.html), [*get*](struct.PeopleGetCall.html) and [*get batch get*](struct.PeopleGetBatchGetCall.html) @@ -23,7 +23,7 @@ //! //! The API is structured into the following primary items: //! -//! * **[Hub](struct.People.html)** +//! * **[Hub](struct.PeopleService.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) @@ -76,7 +76,7 @@ //! # #[test] fn egal() { //! use std::default::Default; //! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -//! use people1::People; +//! use people1::PeopleService; //! //! // Get an ApplicationSecret instance by some means. It contains the `client_id` and //! // `client_secret`, among other things. @@ -89,7 +89,7 @@ //! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, //! hyper::Client::new(), //! ::default(), None); -//! let mut hub = People::new(hyper::Client::new(), auth); +//! let mut hub = PeopleService::new(hyper::Client::new(), auth); //! // You can configure optional parameters by calling the respective setters at will, and //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! @@ -171,7 +171,7 @@ // 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 +// 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)] @@ -216,7 +216,7 @@ 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 { - /// Know your basic profile info and list of people in your circles. + /// Know the list of people in your circles, your age range, and language PluLogin, /// View your complete date of birth @@ -234,14 +234,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 { @@ -253,9 +253,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", } } } @@ -272,7 +272,7 @@ impl Default for Scope { // HUB ### // ###### -/// Central instance to access all People related resource activities +/// Central instance to access all PeopleService related resource activities /// /// # Examples /// @@ -286,7 +286,7 @@ impl Default for Scope { /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use people1::People; +/// use people1::PeopleService; /// /// // Get an ApplicationSecret instance by some means. It contains the `client_id` and /// // `client_secret`, among other things. @@ -299,7 +299,7 @@ impl Default for Scope { /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// hyper::Client::new(), /// ::default(), None); -/// let mut hub = People::new(hyper::Client::new(), auth); +/// let mut hub = PeopleService::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -325,26 +325,22 @@ impl Default for Scope { /// } /// # } /// ``` -pub struct People { +pub struct PeopleService { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } -impl<'a, C, A> Hub for People {} +impl<'a, C, A> Hub for PeopleService {} -impl<'a, C, A> People +impl<'a, C, A> PeopleService where C: BorrowMut, A: oauth2::GetToken { - pub fn new(client: C, authenticator: A) -> People { - People { + pub fn new(client: C, authenticator: A) -> PeopleService { + PeopleService { client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://people.googleapis.com/".to_string(), - _root_url: "https://people.googleapis.com/".to_string(), } } @@ -361,26 +357,6 @@ impl<'a, C, A> People self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://people.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://people.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -398,29 +374,48 @@ impl<'a, C, A> People /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListConnectionsResponse { - /// The list of people that the requestor is connected to. - pub connections: Option>, /// The token that can be used to retrieve the next page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// The list of people that the requestor is connected to. + pub connections: Option>, /// The token that can be used to retrieve changes since the last request. #[serde(rename="nextSyncToken")] pub next_sync_token: Option, + /// The total number of items in the list without pagination. + #[serde(rename="totalItems")] + pub total_items: Option, + /// DEPRECATED(Please use total_items). The total number of people in the list + /// without pagination. + #[serde(rename="totalPeople")] + pub total_people: Option, } impl ResponseResult for ListConnectionsResponse {} -/// A person's relationship status. +/// A person's read-only relationship status. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RelationshipStatus { - /// The read-only value of the relationship status translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. + /// The read-only value of the relationship status translated and formatted in + /// the viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedValue")] pub formatted_value: Option, - /// The relationship status. The value can be custom or predefined. Possible values include, but are not limited to, the following: * `single` * `inARelationship` * `engaged` * `married` * `itsComplicated` * `openRelationship` * `widowed` * `inDomesticPartnership` * `inCivilUnion` + /// The relationship status. The value can be custom or predefined. + /// Possible values include, but are not limited to, the following: + /// + /// * `single` + /// * `inARelationship` + /// * `engaged` + /// * `married` + /// * `itsComplicated` + /// * `openRelationship` + /// * `widowed` + /// * `inDomesticPartnership` + /// * `inCivilUnion` pub value: Option, /// Metadata about the relationship status. pub metadata: Option, @@ -435,20 +430,29 @@ 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, - /// [HTTP 1.1 status code](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). + /// DEPRECATED(Please use status instead). + /// [HTTP 1.1 status + /// code](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). #[serde(rename="httpStatusCode")] pub http_status_code: Option, + /// The original requested resource name. May be different than the resource + /// name on the returned person. + /// + /// 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 {} -/// A brief one-line description of the person. +/// A read-only brief one-line description of the person. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -469,7 +473,13 @@ impl Part for Tagline {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ContactGroupMembership { - /// The contact group ID for the contact group membership. The contact group ID can be custom or predefined. Possible values include, but are not limited to, the following: * `myContacts` * `starred` * A numerical ID for user-created groups. + /// The contact group ID for the contact group membership. The contact group + /// ID can be custom or predefined. Possible values include, but are not + /// limited to, the following: + /// + /// * `myContacts` + /// * `starred` + /// * A numerical ID for user-created groups. #[serde(rename="contactGroupId")] pub contact_group_id: Option, } @@ -483,11 +493,18 @@ impl Part for ContactGroupMembership {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Source { + /// The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the + /// source. Used for web cache validation. Only populated in + /// person.metadata.sources. + pub etag: Option, /// The source type. #[serde(rename="type")] pub type_: Option, - /// A unique identifier within the source type generated by the server. + /// The unique identifier within the source type generated by the server. pub id: Option, + /// Metadata about a source of type PROFILE. + #[serde(rename="profileMetadata")] + pub profile_metadata: Option, } impl Part for Source {} @@ -508,16 +525,18 @@ pub struct Interest { impl Part for Interest {} -/// A person's cover photo. A large image shown on the person's profile page that represents who they are or what they care about. +/// A person's read-only cover photo. A large image shown on the person's +/// profile page that represents who they are or what they care about. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CoverPhoto { + /// True if the cover photo is the default cover photo; + /// false if the cover photo is a user-provided cover photo. + pub default: Option, /// The URL of the cover photo. pub url: Option, - /// True if the cover photo is the default cover photo; false if the cover photo is a user-provided cover photo. - pub default: Option, /// Metadata about the cover photo. pub metadata: Option, } @@ -533,9 +552,12 @@ impl Part for CoverPhoto {} 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. + /// 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. + /// True if the field is the primary field; false if the field is a secondary + /// field. pub primary: Option, } @@ -554,12 +576,18 @@ pub struct Name { /// The honorific prefixes, such as `Mrs.` or `Dr.` #[serde(rename="honorificPrefix")] pub honorific_prefix: Option, + /// The read-only display name with the last name first formatted according to + /// the locale specified by the viewer's account or the + /// Accept-Language HTTP header. + #[serde(rename="displayNameLastFirst")] + pub display_name_last_first: Option, + /// The read-only display name formatted according to the locale specified by + /// the viewer's account or the Accept-Language HTTP header. + #[serde(rename="displayName")] + pub display_name: Option, /// The family name spelled as it sounds. #[serde(rename="phoneticFamilyName")] pub phonetic_family_name: Option, - /// The display name formatted according to the locale specified by the viewer's account or the Accept-Language HTTP header. - #[serde(rename="displayName")] - pub display_name: Option, /// The middle name(s). #[serde(rename="middleName")] pub middle_name: Option, @@ -569,6 +597,9 @@ pub struct Name { /// The family name. #[serde(rename="familyName")] pub family_name: Option, + /// 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, @@ -588,16 +619,25 @@ pub struct Name { impl Part for Name {} -/// The kind of relationship the person is looking for. +/// A person's read-only relationship interest . /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RelationshipInterest { - /// The value of the relationship interest translated and formatted in the viewer's account locale or the locale specified in the Accept-Language HTTP header. + /// The value of the relationship interest translated and formatted in the + /// viewer's account locale or the locale specified in the Accept-Language + /// HTTP header. #[serde(rename="formattedValue")] pub formatted_value: Option, - /// The kind of relationship the person is looking for. The value can be custom or predefined. Possible values include, but are not limited to, the following values: * `friend` * `date` * `relationship` * `networking` + /// The kind of relationship the person is looking for. The value can be custom + /// or predefined. Possible values include, but are not limited to, the + /// following values: + /// + /// * `friend` + /// * `date` + /// * `relationship` + /// * `networking` pub value: Option, /// Metadata about the relationship interest. pub metadata: Option, @@ -621,7 +661,7 @@ pub struct BraggingRights { impl Part for BraggingRights {} -/// A person's membership in a group. +/// A person's read-only membership in a group. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -640,7 +680,9 @@ pub struct Membership { impl Part for Membership {} -/// A person's birthday. At least one of the `date` and `text` fields are specified. The `date` and `text` fields typically represent the same date, but are not guaranteed to. +/// A person's birthday. At least one of the `date` and `text` fields are +/// specified. The `date` and `text` fields typically represent the same +/// date, but are not guaranteed to. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -657,21 +699,25 @@ pub struct Birthday { impl Part for Birthday {} -/// A person's physical address. May be a P.O. box or street address. All fields are optional. +/// A 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. + /// 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. + /// 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 read-only value of the address formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. + /// 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. @@ -690,7 +736,12 @@ pub struct Address { /// 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` + /// 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. @@ -700,42 +751,67 @@ pub struct Address { impl Part for Address {} -/// Represents a whole calendar date, for example a 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](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). The day may be 0 to represent a year and month where the day is not significant. The year may be 0 to represent a month and day independent of year; for example, anniversary date. +/// Represents a whole calendar date, for example a 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](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). +/// The day may be 0 to represent a year and month where the day is not +/// significant. The year may be 0 to represent a month and day independent +/// of year; for example, anniversary date. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Date { - /// 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, + /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 + /// if specifying a year/month where the day is not significant. + pub day: Option, + /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without + /// a year. + pub year: Option, } impl Part for Date {} -/// A person's email address. +/// A person's relation to another person. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EmailAddress { - /// The read-only type of the email address translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. +pub struct Relation { + /// The name of the other person this relation refers to. + pub person: Option, + /// The type of the relation translated and formatted in the viewer's account + /// locale or the locale specified in the Accept-Language HTTP header. #[serde(rename="formattedType")] pub formatted_type: Option, - /// The type of the email address. The type can be custom or predefined. Possible values include, but are not limited to, the following: * `home` * `work` * `other` + /// 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: + /// + /// * `spouse` + /// * `child` + /// * `mother` + /// * `father` + /// * `parent` + /// * `brother` + /// * `sister` + /// * `friend` + /// * `relative` + /// * `domesticPartner` + /// * `manager` + /// * `assistant` + /// * `referredBy` + /// * `partner` #[serde(rename="type")] pub type_: Option, - /// The email address. - pub value: Option, - /// Metadata about the email address. + /// Metadata about the relation. pub metadata: Option, } -impl Part for EmailAddress {} +impl Part for Relation {} /// A person's nickname. @@ -756,6 +832,77 @@ pub struct Nickname { impl Part for Nickname {} +/// 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 will be a + /// common set of message types for APIs to use. + pub details: Option>>, +} + +impl Part for Status {} + + /// A person's instant messaging client. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -764,15 +911,33 @@ impl Part for Nickname {} pub struct ImClient { /// The user name used in the IM client. pub username: Option, - /// The read-only type of the IM client translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. + /// The read-only type of the IM client translated and formatted in the + /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, - /// The protocol of the IM client. The protocol can be custom or predefined. Possible values include, but are not limited to, the following: * `aim` * `msn` * `yahoo` * `skype` * `qq` * `googleTalk` * `icq` * `jabber` * `netMeeting` + /// The protocol of the IM client. The protocol can be custom or predefined. + /// Possible values include, but are not limited to, the following: + /// + /// * `aim` + /// * `msn` + /// * `yahoo` + /// * `skype` + /// * `qq` + /// * `googleTalk` + /// * `icq` + /// * `jabber` + /// * `netMeeting` pub protocol: Option, - /// The read-only protocol of the IM client formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. + /// The read-only protocol of the IM client formatted in the viewer's account + /// locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedProtocol")] pub formatted_protocol: Option, - /// The type of the IM client. The type can be custom or predefined. Possible values include, but are not limited to, the following: * `home` * `work` * `other` + /// The type of the IM client. 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 IM client. @@ -782,6 +947,22 @@ pub struct ImClient { impl Part for ImClient {} +/// A person's age 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 AgeRangeType { + /// The age range. + #[serde(rename="ageRange")] + pub age_range: Option, + /// Metadata about the age range. + pub metadata: Option, +} + +impl Part for AgeRangeType {} + + /// There is no detailed description. /// /// # Activities @@ -806,10 +987,22 @@ impl ResponseResult for GetPeopleResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Url { - /// The read-only type of the URL translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. + /// The read-only type of the URL translated and formatted in the viewer's + /// account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, - /// The type of the URL. The type can be custom or predefined. Possible values include, but are not limited to, the following: * `home` * `work` * `blog` * `profile` * `homePage` * `ftp` * `reservations` * `appInstallPage`: website for a Google+ application. * `other` + /// The type of the URL. The type can be custom or predefined. + /// Possible values include, but are not limited to, the following: + /// + /// * `home` + /// * `work` + /// * `blog` + /// * `profile` + /// * `homePage` + /// * `ftp` + /// * `reservations` + /// * `appInstallPage`: website for a Google+ application. + /// * `other` #[serde(rename="type")] pub type_: Option, /// The URL. @@ -827,7 +1020,8 @@ impl Part for Url {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Residence { - /// True if the residence is the person's current residence; false if the residence is a past residence. + /// True if the residence is the person's current residence; + /// false if the residence is a past residence. pub current: Option, /// The address of the residence. pub value: Option, @@ -838,7 +1032,12 @@ pub struct Residence { impl Part for Residence {} -/// Information about a person merged from various data sources such as the authenticated user's contacts and profile data. Fields other than IDs, metadata, and group memberships are user-edited. Most fields can have multiple items. The items in a field have no guaranteed order, but each non-empty field is guaranteed to have exactly one field with `metadata.primary` set to true. +/// Information about a person merged from various data sources such as the +/// authenticated user's contacts and profile data. +/// +/// Most fields can have multiple items. The items in a field have no guaranteed +/// order, but each non-empty field is guaranteed to have exactly one field with +/// `metadata.primary` set to true. /// /// # Activities /// @@ -863,18 +1062,17 @@ pub struct Person { /// The person's phone numbers. #[serde(rename="phoneNumbers")] pub phone_numbers: Option>, - /// The person's age range. - #[serde(rename="ageRange")] - pub age_range: Option, /// The person's photos. pub photos: Option>, /// The person's names. pub names: Option>, - /// The person's biographies. - pub biographies: Option>, + /// DEPRECATED(Please read person.age_ranges instead). The person's age range. + #[serde(rename="ageRange")] + pub age_range: Option, /// The person's residences. pub residences: Option>, - /// The resource name for the person, assigned by the server. An ASCII string with a max length of 27 characters. Always starts with `people/`. + /// The resource name for the person, assigned by the server. An ASCII string + /// with a max length of 27 characters, in the form of `people/`. #[serde(rename="resourceName")] pub resource_name: Option, /// The kind of relationship the person is looking for. @@ -887,17 +1085,23 @@ pub struct Person { pub locales: Option>, /// The person's past or current organizations. pub organizations: Option>, + /// The person's taglines. + pub taglines: Option>, /// The person's skills. pub skills: Option>, + /// The person's age ranges. + #[serde(rename="ageRanges")] + pub age_ranges: Option>, /// The person's birthdays. pub birthdays: Option>, /// The person's relations. pub relations: Option>, /// The person's group memberships. pub memberships: Option>, - /// The person's taglines. - pub taglines: Option>, - /// The [HTTP entity tag](https://en.wikipedia.org/wiki/HTTP_ETag) of the resource. Used for web cache validation. + /// The person's biographies. + pub biographies: 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 associated URLs. pub urls: Option>, @@ -927,10 +1131,18 @@ impl ResponseResult for Person {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Gender { - /// The read-only value of the gender translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. + /// 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` + /// 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, @@ -945,31 +1157,49 @@ impl Part for Gender {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PhoneNumber { - /// The read-only canonicalized [ITU-T E.164](https://law.resource.org/pub/us/cfr/ibr/004/itu-t.E.164.1.2008.pdf) form of the phone number. - #[serde(rename="canonicalForm")] - pub canonical_form: Option, + /// The read-only type of the phone number translated and formatted in the + /// viewer's account locale or the the `Accept-Language` HTTP header locale. + #[serde(rename="formattedType")] + pub formatted_type: 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: * `home` * `work` * `mobile` * `homeFax` * `workFax` * `otherFax` * `pager` * `workMobile` * `workPager` * `main` * `googleVoice` * `other` + /// The type of the phone number. The type can be custom or predefined. + /// Possible values include, but are not limited to, the following: + /// + /// * `home` + /// * `work` + /// * `mobile` + /// * `homeFax` + /// * `workFax` + /// * `otherFax` + /// * `pager` + /// * `workMobile` + /// * `workPager` + /// * `main` + /// * `googleVoice` + /// * `other` #[serde(rename="type")] pub type_: Option, /// The phone number. pub value: Option, - /// The read-only type of the phone number translated and formatted in the viewer's account locale or the the `Accept-Language` HTTP header locale. - #[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, } impl Part for PhoneNumber {} -/// A person's past or current organization. Overlapping date ranges are permitted. +/// A person's past or current organization. Overlapping date ranges are +/// permitted. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Organization { - /// The read-only type of the organization translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. + /// 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`. @@ -979,14 +1209,20 @@ pub struct Organization { pub end_date: Option, /// The name of the organization. pub name: Option, - /// The start date when the person joined the organization. - #[serde(rename="startDate")] - pub start_date: Option, - /// The symbol associated with the organization; for example, a stock ticker symbol, abbreviation, or acronym. - pub symbol: Option, /// The person's job title at the organization. pub title: Option, - /// True if the organization is the person's current organization; false if the organization is a past organization. + /// The type of the organization. The type can be custom or predefined. + /// Possible values include, but are not limited to, the following: + /// + /// * `work` + /// * `school` + #[serde(rename="type")] + pub type_: Option, + /// The symbol associated with the organization; for example, a stock ticker + /// symbol, abbreviation, or acronym. + pub symbol: Option, + /// True if the organization is the person's current organization; + /// false if the organization is a past organization. pub current: Option, /// The person's job description at the organization. #[serde(rename="jobDescription")] @@ -995,9 +1231,9 @@ pub struct Organization { pub location: Option, /// The person's department at the organization. pub department: Option, - /// The type of the organization. The type can be custom or predefined. Possible values include, but are not limited to, the following: * `work` * `school` - #[serde(rename="type")] - pub type_: Option, + /// The start date when the person joined the organization. + #[serde(rename="startDate")] + pub start_date: Option, /// The phonetic name of the organization. #[serde(rename="phoneticName")] pub phonetic_name: Option, @@ -1014,7 +1250,8 @@ impl Part for Organization {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Locale { - /// The well-formed [IETF BCP 47](https://tools.ietf.org/html/bcp47) language tag representing the locale. + /// The well-formed [IETF BCP 47](https://tools.ietf.org/html/bcp47) + /// language tag representing the locale. pub value: Option, /// Metadata about the locale. pub metadata: Option, @@ -1023,7 +1260,8 @@ pub struct Locale { impl Part for Locale {} -/// A person's photo. A picture shown next to the person's name to help others recognize the person. +/// A person's read-only photo. A picture shown next to the person's name to +/// help others recognize the person. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -1038,19 +1276,31 @@ pub struct Photo { impl Part for Photo {} -/// Metadata about a person. +/// The read-only metadata about a person. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PersonMetadata { - /// Any former resource names this person has had. Populated only for [`connections.list`](/people/api/rest/v1/people.connections/list) requests that include a sync token. The resource name may change when adding or removing fields that link a contact and profile such as a verified email, verified phone number, or profile URL. + /// Any former resource names this person has had. Populated only for + /// [`connections.list`](/people/api/rest/v1/people.connections/list) requests + /// that include a sync token. + /// + /// The resource name may change when adding or removing fields that link a + /// contact and profile such as a verified email, verified phone number, or + /// profile URL. #[serde(rename="previousResourceNames")] pub previous_resource_names: Option>, /// The sources of data for the person. pub sources: Option>, - /// True if the person resource has been deleted. Populated only for [`connections.list`](/people/api/rest/v1/people.connections/list) requests that include a sync token. + /// Resource names of people linked to this resource. + #[serde(rename="linkedPeopleResourceNames")] + pub linked_people_resource_names: Option>, + /// True if the person resource has been deleted. Populated only for + /// [`connections.list`](/people/api/rest/v1/people.connections/list) requests + /// that include a sync token. pub deleted: Option, + /// DEPRECATED(Please read person.metadata.sources.profile_metadata instead). /// The type of the person object. #[serde(rename="objectType")] pub object_type: Option, @@ -1059,25 +1309,34 @@ pub struct PersonMetadata { impl Part for PersonMetadata {} -/// A person's relation to another person. +/// A person's email address. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Relation { - /// The name of the other person this relation refers to. - pub person: Option, - /// Metadata about the relation. - pub metadata: Option, - /// The person's relation to the other person. The type can be custom or predefined. Possible values include, but are not limited to, the following values: * `spouse` * `child` * `mother` * `father` * `parent` * `brother` * `sister` * `friend` * `relative` * `domesticPartner` * `manager` * `assistant` * `referredBy` * `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. +pub struct EmailAddress { + /// The read-only type of the email address translated and formatted in the + /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, + /// The type of the email address. The type can be custom or predefined. + /// Possible values include, but are not limited to, the following: + /// + /// * `home` + /// * `work` + /// * `other` + #[serde(rename="type")] + pub type_: Option, + /// The display name of the email. + #[serde(rename="displayName")] + pub display_name: Option, + /// The email address. + pub value: Option, + /// Metadata about the email address. + pub metadata: Option, } -impl Part for Relation {} +impl Part for EmailAddress {} /// A skill that the person has. @@ -1095,6 +1354,21 @@ pub struct Skill { impl Part for Skill {} +/// 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 Occupation { + /// The occupation; for example, `carpenter`. + pub value: Option, + /// Metadata about the occupation. + pub metadata: Option, +} + +impl Part for Occupation {} + + /// A Google Apps Domain membership. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1117,10 +1391,15 @@ impl Part for DomainMembership {} pub struct Event { /// The date of the event. pub date: Option, - /// The read-only type of the event translated and formatted in the viewer's account locale or the `Accept-Language` HTTP header locale. + /// The read-only type of the event translated and formatted in the + /// viewer's account locale or the `Accept-Language` HTTP header locale. #[serde(rename="formattedType")] pub formatted_type: Option, - /// The type of the event. The type can be custom or predefined. Possible values include, but are not limited to, the following: * `anniversary` * `other` + /// The type of the event. The type can be custom or predefined. + /// Possible values include, but are not limited to, the following: + /// + /// * `anniversary` + /// * `other` #[serde(rename="type")] pub type_: Option, /// Metadata about the event. @@ -1136,6 +1415,9 @@ impl Part for Event {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Biography { + /// The content type of the biography. + #[serde(rename="contentType")] + pub content_type: Option, /// The short biography. pub value: Option, /// Metadata about the biography. @@ -1145,19 +1427,18 @@ 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 profile object type. + #[serde(rename="objectType")] + pub object_type: Option, } -impl Part for Occupation {} +impl Part for ProfileMetadata {} @@ -1166,7 +1447,7 @@ impl Part for Occupation {} // ################# /// A builder providing access to all methods supported on *people* resources. -/// It is not used directly, but through the `People` hub. +/// It is not used directly, but through the `PeopleService` hub. /// /// # Example /// @@ -1180,13 +1461,13 @@ impl Part for Occupation {} /// # #[test] fn egal() { /// use std::default::Default; /// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// use people1::People; +/// use people1::PeopleService; /// /// let secret: ApplicationSecret = Default::default(); /// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// hyper::Client::new(), /// ::default(), None); -/// let mut hub = People::new(hyper::Client::new(), auth); +/// let mut hub = PeopleService::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* /// // like `connections_list(...)`, `get(...)` and `get_batch_get(...)` /// // to build up your call. @@ -1196,7 +1477,7 @@ impl Part for Occupation {} pub struct PeopleMethods<'a, C, A> where C: 'a, A: 'a { - hub: &'a People, + hub: &'a PeopleService, } impl<'a, C, A> MethodsBuilder for PeopleMethods<'a, C, A> {} @@ -1205,11 +1486,16 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Provides information about a person resource for a resource name. Use `people/me` to indicate the authenticated user. + /// Provides information about a person for a resource name. Use + /// `people/me` to indicate the authenticated user. /// /// # Arguments /// - /// * `resourceName` - The resource name of the person to provide information about. - To get information about the authenticated user, specify `people/me`. - To get information about any user, specify the resource name that identifies the user, such as the resource names returned by [`people.connections.list`](/people/api/rest/v1/people.connections/list). + /// * `resourceName` - The resource name of the person to provide information about. + /// - To get information about the authenticated user, specify `people/me`. + /// - To get information about any user, specify the resource name that + /// identifies the user, such as the resource names returned by + /// [`people.connections.list`](/people/api/rest/v1/people.connections/list). pub fn get(&self, resource_name: &str) -> PeopleGetCall<'a, C, A> { PeopleGetCall { hub: self.hub, @@ -1223,7 +1509,8 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Provides a list of the authenticated user's contacts merged with any linked profiles. + /// Provides a list of the authenticated user's contacts merged with any + /// linked profiles. /// /// # Arguments /// @@ -1234,6 +1521,7 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { _resource_name: resource_name.to_string(), _sync_token: Default::default(), _sort_order: Default::default(), + _request_sync_token: Default::default(), _request_mask_include_field: Default::default(), _page_token: Default::default(), _page_size: Default::default(), @@ -1245,7 +1533,9 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Provides information about a list of specific people by specifying a list of requested resource names. Use `people/me` to indicate the authenticated user. + /// Provides information about a list of specific people by specifying a list + /// of requested resource names. Use `people/me` to indicate the authenticated + /// user. pub fn get_batch_get(&self) -> PeopleGetBatchGetCall<'a, C, A> { PeopleGetBatchGetCall { hub: self.hub, @@ -1266,7 +1556,8 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { // CallBuilders ### // ################# -/// Provides information about a person resource for a resource name. Use `people/me` to indicate the authenticated user. +/// Provides information about a person for a resource name. Use +/// `people/me` to indicate the authenticated user. /// /// A builder for the *get* method supported by a *people* resource. /// It is not used directly, but through a `PeopleMethods` instance. @@ -1282,13 +1573,13 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use people1::People; +/// # use people1::PeopleService; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::new(), /// # ::default(), None); -/// # let mut hub = People::new(hyper::Client::new(), auth); +/// # let mut hub = PeopleService::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! @@ -1300,7 +1591,7 @@ impl<'a, C, A> PeopleMethods<'a, C, A> { pub struct PeopleGetCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a People, + hub: &'a PeopleService, _resource_name: String, _request_mask_include_field: Option, _delegate: Option<&'a mut Delegate>, @@ -1342,7 +1633,7 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resourceName}"; + let mut url = "https://people.googleapis.com/v1/{+resourceName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ContactReadonly.as_ref().to_string(), ()); } @@ -1448,7 +1739,12 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau } - /// The resource name of the person to provide information about. - To get information about the authenticated user, specify `people/me`. - To get information about any user, specify the resource name that identifies the user, such as the resource names returned by [`people.connections.list`](/people/api/rest/v1/people.connections/list). + /// The resource name of the person to provide information about. + /// + /// - To get information about the authenticated user, specify `people/me`. + /// - To get information about any user, specify the resource name that + /// identifies the user, such as the resource names returned by + /// [`people.connections.list`](/people/api/rest/v1/people.connections/list). /// /// Sets the *resource name* path property to the given value. /// @@ -1458,7 +1754,12 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau self._resource_name = new_value.to_string(); self } - /// Comma-separated list of fields to be included in the response. Omitting this field will include all fields. Each path should start with `person.`: for example, `person.names` or `person.photos`. + /// Comma-separated list of fields to be included in the response. Omitting + /// this field will include all fields except for connections.list requests, + /// which have a default mask that includes common fields like metadata, name, + /// photo, and profile url. + /// Each path should start with `person.`: for example, `person.names` or + /// `person.photos`. /// /// Sets the *request mask.include field* query property to the given value. pub fn request_mask_include_field(mut self, new_value: &str) -> PeopleGetCall<'a, C, A> { @@ -1523,7 +1824,8 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau } -/// Provides a list of the authenticated user's contacts merged with any linked profiles. +/// Provides a list of the authenticated user's contacts merged with any +/// linked profiles. /// /// A builder for the *connections.list* method supported by a *people* resource. /// It is not used directly, but through a `PeopleMethods` instance. @@ -1539,32 +1841,34 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use people1::People; +/// # use people1::PeopleService; /// /// # let secret: ApplicationSecret = Default::default(); /// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, /// # hyper::Client::new(), /// # ::default(), None); -/// # let mut hub = People::new(hyper::Client::new(), auth); +/// # let mut hub = PeopleService::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.people().connections_list("resourceName") /// .sync_token("justo") /// .sort_order("amet.") -/// .request_mask_include_field("erat") -/// .page_token("labore") -/// .page_size(-9) +/// .request_sync_token(false) +/// .request_mask_include_field("labore") +/// .page_token("sea") +/// .page_size(-90) /// .doit(); /// # } /// ``` pub struct PeopleConnectionListCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a People, + hub: &'a PeopleService, _resource_name: String, _sync_token: Option, _sort_order: Option, + _request_sync_token: Option, _request_mask_include_field: Option, _page_token: Option, _page_size: Option, @@ -1590,7 +1894,7 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((8 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); params.push(("resourceName", self._resource_name.to_string())); if let Some(value) = self._sync_token { params.push(("syncToken", value.to_string())); @@ -1598,6 +1902,9 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> { self._sync_token = Some(new_value.to_string()); self } - /// The order in which the connections should be sorted. Defaults to `LAST_MODIFIED_ASCENDING`. + /// The order in which the connections should be sorted. Defaults to + /// `LAST_MODIFIED_ASCENDING`. /// /// Sets the *sort order* query property to the given value. pub fn sort_order(mut self, new_value: &str) -> PeopleConnectionListCall<'a, C, A> { self._sort_order = Some(new_value.to_string()); self } - /// Comma-separated list of fields to be included in the response. Omitting this field will include all fields. Each path should start with `person.`: for example, `person.names` or `person.photos`. + /// Whether the response should include a sync token, which can be used to get + /// all changes since the last request. + /// + /// Sets the *request sync token* query property to the given value. + pub fn request_sync_token(mut self, new_value: bool) -> PeopleConnectionListCall<'a, C, A> { + self._request_sync_token = Some(new_value); + self + } + /// Comma-separated list of fields to be included in the response. Omitting + /// this field will include all fields except for connections.list requests, + /// which have a default mask that includes common fields like metadata, name, + /// photo, and profile url. + /// Each path should start with `person.`: for example, `person.names` or + /// `person.photos`. /// /// Sets the *request mask.include field* query property to the given value. pub fn request_mask_include_field(mut self, new_value: &str) -> PeopleConnectionListCall<'a, C, A> { @@ -1763,7 +2085,8 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> { @@ -1828,7 +2151,9 @@ impl<'a, C, A> PeopleConnectionListCall<'a, C, A> where C: BorrowMut PeopleConnectionListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = People::new(hyper::Client::new(), auth); +/// # let mut hub = PeopleService::new(hyper::Client::new(), auth); /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.people().get_batch_get() -/// .add_resource_names("nonumy") -/// .request_mask_include_field("dolores") +/// .add_resource_names("dolores") +/// .request_mask_include_field("gubergren") /// .doit(); /// # } /// ``` pub struct PeopleGetBatchGetCall<'a, C, A> where C: 'a, A: 'a { - hub: &'a People, + hub: &'a PeopleService, _resource_names: Vec, _request_mask_include_field: Option, _delegate: Option<&'a mut Delegate>, @@ -1908,7 +2233,7 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/people:batchGet"; + let mut url = "https://people.googleapis.com/v1/people:batchGet".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ContactReadonly.as_ref().to_string(), ()); } @@ -1990,7 +2315,10 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut } - /// The resource name, such as one returned by [`people.connections.list`](/people/api/rest/v1/people.connections/list), of one of the people to provide information about. You can include this parameter up to 50 times in one request. + /// The resource name, such as one returned by + /// [`people.connections.list`](/people/api/rest/v1/people.connections/list), + /// of one of the people to provide information about. You can include this + /// parameter up to 50 times in one request. /// /// Append the given value to the *resource names* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -1998,7 +2326,12 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut self._resource_names.push(new_value.to_string()); self } - /// Comma-separated list of fields to be included in the response. Omitting this field will include all fields. Each path should start with `person.`: for example, `person.names` or `person.photos`. + /// Comma-separated list of fields to be included in the response. Omitting + /// this field will include all fields except for connections.list requests, + /// which have a default mask that includes common fields like metadata, name, + /// photo, and profile url. + /// Each path should start with `person.`: for example, `person.names` or + /// `person.photos`. /// /// Sets the *request mask.include field* query property to the given value. pub fn request_mask_include_field(mut self, new_value: &str) -> PeopleGetBatchGetCall<'a, C, A> { @@ -2063,3 +2396,4 @@ impl<'a, C, A> PeopleGetBatchGetCall<'a, C, A> where C: BorrowMut } + diff --git a/gen/playmoviespartner1-cli/Cargo.toml b/gen/playmoviespartner1-cli/Cargo.toml index 2f9a4648f3..e0e67b429a 100644 --- a/gen/playmoviespartner1-cli/Cargo.toml +++ b/gen/playmoviespartner1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-playmoviespartner1-cli" -version = "1.0.4+20160518" +version = "1.0.4+20170516" authors = ["Sebastian Thiel "] description = "A complete library to interact with Play Movies (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/playmoviespartner1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-playmoviespartner1] path = "../playmoviespartner1" -version = "1.0.4+20160518" +version = "1.0.4+20170516" diff --git a/gen/playmoviespartner1-cli/README.md b/gen/playmoviespartner1-cli/README.md index c9d8020e7a..155194d291 100644 --- a/gen/playmoviespartner1-cli/README.md +++ b/gen/playmoviespartner1-cli/README.md @@ -25,17 +25,13 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Play Movies* API at revision *20160518*. The CLI is at version *1.0.4*. +This documentation was generated from the *Play Movies* API at revision *20170516*. The CLI is at version *1.0.4*. ```bash playmoviespartner1 [options] accounts avails-get [-p ]... [-o ] avails-list [-p ]... [-o ] - components-list [-p ]... [-o ] - components-type-get [-p ]... [-o ] - experience-locales-get [-p ]... [-o ] - experience-locales-list [-p ]... [-o ] orders-get [-p ]... [-o ] orders-list [-p ]... [-o ] store-infos-country-get [-p ]... [-o ] diff --git a/gen/playmoviespartner1-cli/mkdocs.yml b/gen/playmoviespartner1-cli/mkdocs.yml index 94179fb1f0..bfab03ca7a 100644 --- a/gen/playmoviespartner1-cli/mkdocs.yml +++ b/gen/playmoviespartner1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Play Movies v1.0.4+20160518 +site_name: Play Movies v1.0.4+20170516 site_url: http://byron.github.io/google-apis-rs/google-playmoviespartner1-cli site_description: A complete library to interact with Play Movies (protocol v1) @@ -11,10 +11,6 @@ pages: - ['index.md', 'Home'] - ['accounts_avails-get.md', 'Accounts', 'Avails Get'] - ['accounts_avails-list.md', 'Accounts', 'Avails List'] -- ['accounts_components-list.md', 'Accounts', 'Components List'] -- ['accounts_components-type-get.md', 'Accounts', 'Components Type Get'] -- ['accounts_experience-locales-get.md', 'Accounts', 'Experience Locales Get'] -- ['accounts_experience-locales-list.md', 'Accounts', 'Experience Locales List'] - ['accounts_orders-get.md', 'Accounts', 'Orders Get'] - ['accounts_orders-list.md', 'Accounts', 'Orders List'] - ['accounts_store-infos-country-get.md', 'Accounts', 'Store Infos Country Get'] diff --git a/gen/playmoviespartner1-cli/src/main.rs b/gen/playmoviespartner1-cli/src/main.rs index 6a4ae941f6..a0bea39472 100644 --- a/gen/playmoviespartner1-cli/src/main.rs +++ b/gen/playmoviespartner1-cli/src/main.rs @@ -178,285 +178,6 @@ impl<'n> Engine<'n> { } } - fn _accounts_components_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.accounts().components_list(opt.value_of("account-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "title-level-eidr" => { - call = call.title_level_eidr(value.unwrap_or("")); - }, - "studio-names" => { - call = call.add_studio_names(value.unwrap_or("")); - }, - "status" => { - call = call.add_status(value.unwrap_or("")); - }, - "presentation-id" => { - call = call.presentation_id(value.unwrap_or("")); - }, - "pph-names" => { - call = call.add_pph_names(value.unwrap_or("")); - }, - "playable-sequence-id" => { - call = call.playable_sequence_id(value.unwrap_or("")); - }, - "page-token" => { - call = call.page_token(value.unwrap_or("")); - }, - "page-size" => { - call = call.page_size(arg_from_str(value.unwrap_or("-0"), err, "page-size", "integer")); - }, - "inventory-id" => { - call = call.inventory_id(value.unwrap_or("")); - }, - "filename" => { - call = call.filename(value.unwrap_or("")); - }, - "el-id" => { - call = call.el_id(value.unwrap_or("")); - }, - "edit-level-eidr" => { - call = call.edit_level_eidr(value.unwrap_or("")); - }, - "custom-id" => { - call = call.custom_id(value.unwrap_or("")); - }, - "alt-cut-id" => { - call = call.alt_cut_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(["status", "presentation-id", "title-level-eidr", "page-size", "alt-cut-id", "studio-names", "filename", "page-token", "pph-names", "edit-level-eidr", "inventory-id", "el-id", "custom-id", "playable-sequence-id"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - - fn _accounts_components_type_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.accounts().components_type_get(opt.value_of("account-id").unwrap_or(""), opt.value_of("component-id").unwrap_or(""), opt.value_of("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); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_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_experience_locales_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.accounts().experience_locales_get(opt.value_of("account-id").unwrap_or(""), opt.value_of("el-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - _ => { - let mut found = false; - for param in &self.gp { - if key == *param { - found = true; - call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); - break; - } - } - if !found { - err.issues.push(CLIError::UnknownParameter(key.to_string(), - {let mut v = Vec::new(); - v.extend(self.gp.iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_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_experience_locales_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.accounts().experience_locales_list(opt.value_of("account-id").unwrap_or("")); - for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - let (key, value) = parse_kv_arg(&*parg, err, false); - match key { - "title-level-eidr" => { - call = call.title_level_eidr(value.unwrap_or("")); - }, - "studio-names" => { - call = call.add_studio_names(value.unwrap_or("")); - }, - "status" => { - call = call.add_status(value.unwrap_or("")); - }, - "pph-names" => { - call = call.add_pph_names(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")); - }, - "edit-level-eidr" => { - call = call.edit_level_eidr(value.unwrap_or("")); - }, - "custom-id" => { - call = call.custom_id(value.unwrap_or("")); - }, - "alt-cut-id" => { - call = call.alt_cut_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(["status", "pph-names", "title-level-eidr", "page-size", "studio-names", "page-token", "edit-level-eidr", "custom-id", "alt-cut-id"].iter().map(|v|*v)); - v } )); - } - } - } - } - let protocol = CallType::Standard; - if dry_run { - Ok(()) - } else { - assert!(err.issues.len() == 0); - for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { - call = call.add_scope(scope); - } - let mut ostream = match writer_from_opts(opt.value_of("out")) { - Ok(mut f) => f, - Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), - }; - match match protocol { - CallType::Standard => call.doit(), - _ => unreachable!() - } { - Err(api_err) => Err(DoitError::ApiError(api_err)), - Ok((mut response, output_schema)) => { - let mut value = json::value::to_value(&output_schema).expect("serde to work"); - remove_json_null_values(&mut value); - json::to_writer_pretty(&mut ostream, &value).unwrap(); - ostream.flush().unwrap(); - Ok(()) - } - } - } - } - fn _accounts_orders_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.accounts().orders_get(opt.value_of("account-id").unwrap_or(""), opt.value_of("order-id").unwrap_or("")); @@ -734,18 +455,6 @@ impl<'n> Engine<'n> { ("avails-list", Some(opt)) => { call_result = self._accounts_avails_list(opt, dry_run, &mut err); }, - ("components-list", Some(opt)) => { - call_result = self._accounts_components_list(opt, dry_run, &mut err); - }, - ("components-type-get", Some(opt)) => { - call_result = self._accounts_components_type_get(opt, dry_run, &mut err); - }, - ("experience-locales-get", Some(opt)) => { - call_result = self._accounts_experience_locales_get(opt, dry_run, &mut err); - }, - ("experience-locales-list", Some(opt)) => { - call_result = self._accounts_experience_locales_list(opt, dry_run, &mut err); - }, ("orders-get", Some(opt)) => { call_result = self._accounts_orders_get(opt, dry_run, &mut err); }, @@ -850,7 +559,7 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ - ("accounts", "methods: 'avails-get', 'avails-list', 'components-list', 'components-type-get', 'experience-locales-get', 'experience-locales-list', 'orders-get', 'orders-list', 'store-infos-country-get' and 'store-infos-list'", vec![ + ("accounts", "methods: 'avails-get', 'avails-list', 'orders-get', 'orders-list', 'store-infos-country-get' and 'store-infos-list'", vec![ ("avails-get", Some(r##"Get an Avail given its avail group id and avail id."##), "Details at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli/accounts_avails-get", @@ -880,7 +589,10 @@ fn main() { Some(false)), ]), ("avails-list", - Some(r##"List Avails owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method."##), + Some(r##"List Avails owned or managed by the partner. + + See _Authentication and Authorization rules_ and + _List methods rules_ for more information about this method."##), "Details at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli/accounts_avails-list", vec![ (Some(r##"account-id"##), @@ -895,112 +607,6 @@ fn main() { Some(false), Some(true)), - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("components-list", - Some(r##"List Components owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method."##), - "Details at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli/accounts_components-list", - vec![ - (Some(r##"account-id"##), - None, - Some(r##"REQUIRED. See _General rules_ for more information about this field."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("components-type-get", - Some(r##"Get a Component given its id."##), - "Details at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli/accounts_components-type-get", - vec![ - (Some(r##"account-id"##), - None, - Some(r##"REQUIRED. See _General rules_ for more information about this field."##), - Some(true), - Some(false)), - - (Some(r##"component-id"##), - None, - Some(r##"REQUIRED. Component ID."##), - Some(true), - Some(false)), - - (Some(r##"type"##), - None, - Some(r##"REQUIRED. Component Type."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("experience-locales-get", - Some(r##"Get an ExperienceLocale given its id. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method."##), - "Details at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli/accounts_experience-locales-get", - vec![ - (Some(r##"account-id"##), - None, - Some(r##"REQUIRED. See _General rules_ for more information about this field."##), - Some(true), - Some(false)), - - (Some(r##"el-id"##), - None, - Some(r##"REQUIRED. ExperienceLocale ID, as defined by Google."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - - (Some(r##"out"##), - Some(r##"o"##), - Some(r##"Specify the file into which to write the program's output"##), - Some(false), - Some(false)), - ]), - ("experience-locales-list", - Some(r##"List ExperienceLocales owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method."##), - "Details at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli/accounts_experience-locales-list", - vec![ - (Some(r##"account-id"##), - None, - Some(r##"REQUIRED. See _General rules_ for more information about this field."##), - Some(true), - Some(false)), - - (Some(r##"v"##), - Some(r##"p"##), - Some(r##"Set various optional parameters, matching the key=value form"##), - Some(false), - Some(true)), - (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -1008,7 +614,10 @@ fn main() { Some(false)), ]), ("orders-get", - Some(r##"Get an Order given its id. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method."##), + Some(r##"Get an Order given its id. + + See _Authentication and Authorization rules_ and + _Get methods rules_ for more information about this method."##), "Details at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli/accounts_orders-get", vec![ (Some(r##"account-id"##), @@ -1036,7 +645,10 @@ fn main() { Some(false)), ]), ("orders-list", - Some(r##"List Orders owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method."##), + Some(r##"List Orders owned or managed by the partner. + + See _Authentication and Authorization rules_ and + _List methods rules_ for more information about this method."##), "Details at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli/accounts_orders-list", vec![ (Some(r##"account-id"##), @@ -1058,7 +670,10 @@ fn main() { Some(false)), ]), ("store-infos-country-get", - Some(r##"Get a StoreInfo given its video id and country. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method."##), + Some(r##"Get a StoreInfo given its video id and country. + + See _Authentication and Authorization rules_ and + _Get methods rules_ for more information about this method."##), "Details at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli/accounts_store-infos-country-get", vec![ (Some(r##"account-id"##), @@ -1092,7 +707,10 @@ fn main() { Some(false)), ]), ("store-infos-list", - Some(r##"List StoreInfos owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method."##), + Some(r##"List StoreInfos owned or managed by the partner. + + See _Authentication and Authorization rules_ and + _List methods rules_ for more information about this method."##), "Details at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli/accounts_store-infos-list", vec![ (Some(r##"account-id"##), @@ -1119,7 +737,7 @@ fn main() { let mut app = App::new("playmoviespartner1") .author("Sebastian Thiel ") - .version("1.0.4+20160518") + .version("1.0.4+20170516") .about("Gets the delivery status of titles for Google Play Movies Partners.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_playmoviespartner1_cli") .arg(Arg::with_name("url") diff --git a/gen/playmoviespartner1/Cargo.toml b/gen/playmoviespartner1/Cargo.toml index a1f931cade..bee626b725 100644 --- a/gen/playmoviespartner1/Cargo.toml +++ b/gen/playmoviespartner1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-playmoviespartner1" -version = "1.0.4+20160518" +version = "1.0.4+20170516" authors = ["Sebastian Thiel "] description = "A complete library to interact with Play Movies (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/playmoviespartner1" homepage = "https://developers.google.com/playmoviespartner/" -documentation = "https://docs.rs/google-playmoviespartner1/1.0.4+20160518" +documentation = "https://docs.rs/google-playmoviespartner1/1.0.4+20170516" license = "MIT" keywords = ["playmoviespartner", "google", "protocol", "web", "api"] diff --git a/gen/playmoviespartner1/README.md b/gen/playmoviespartner1/README.md index 44330a2fe1..90e3a38e81 100644 --- a/gen/playmoviespartner1/README.md +++ b/gen/playmoviespartner1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-playmoviespartner1` library allows access to all features of the *Google Play Movies* service. -This documentation was generated from *Play Movies* crate version *1.0.4+20160518*, where *20160518* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Play Movies* crate version *1.0.4+20170516*, where *20170516* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *Play Movies* *v1* API can be found at the [official documentation site](https://developers.google.com/playmoviespartner/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.PlayMovies.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/struct.PlayMovies.html) ... * accounts - * [*avails get*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.AccountAvailGetCall.html), [*avails list*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.AccountAvailListCall.html), [*components list*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.AccountComponentListCall.html), [*components type get*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.AccountComponentTypeGetCall.html), [*experience locales get*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.AccountExperienceLocaleGetCall.html), [*experience locales list*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.AccountExperienceLocaleListCall.html), [*orders get*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.AccountOrderGetCall.html), [*orders list*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.AccountOrderListCall.html), [*store infos country get*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.AccountStoreInfoCountryGetCall.html) and [*store infos list*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.AccountStoreInfoListCall.html) + * [*avails get*](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/struct.AccountAvailGetCall.html), [*avails list*](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/struct.AccountAvailListCall.html), [*orders get*](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/struct.AccountOrderGetCall.html), [*orders list*](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/struct.AccountOrderListCall.html), [*store infos country get*](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/struct.AccountStoreInfoCountryGetCall.html) and [*store infos list*](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/struct.AccountStoreInfoListCall.html) @@ -23,17 +23,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/struct.PlayMovies.html)** +* **[Hub](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/struct.PlayMovies.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.Part.html)** + * **[Parts](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -115,17 +115,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.ResponseResult.html), it will return that by default. You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making this call: `.param("alt", "media")`. @@ -135,29 +135,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-playmoviespartner1/1.0.4+20160518/google_playmoviespartner1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-playmoviespartner1/1.0.4+20170516/google_playmoviespartner1/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/playmoviespartner1/src/lib.rs b/gen/playmoviespartner1/src/lib.rs index 95af45ae1c..d175636f92 100644 --- a/gen/playmoviespartner1/src/lib.rs +++ b/gen/playmoviespartner1/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *Play Movies* crate version *1.0.4+20160518*, where *20160518* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Play Movies* crate version *1.0.4+20170516*, where *20170516* is the exact revision of the *playmoviespartner:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Play Movies* *v1* API can be found at the //! [official documentation site](https://developers.google.com/playmoviespartner/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.PlayMovies.html) ... //! //! * accounts -//! * [*avails get*](struct.AccountAvailGetCall.html), [*avails list*](struct.AccountAvailListCall.html), [*components list*](struct.AccountComponentListCall.html), [*components type get*](struct.AccountComponentTypeGetCall.html), [*experience locales get*](struct.AccountExperienceLocaleGetCall.html), [*experience locales list*](struct.AccountExperienceLocaleListCall.html), [*orders get*](struct.AccountOrderGetCall.html), [*orders list*](struct.AccountOrderListCall.html), [*store infos country get*](struct.AccountStoreInfoCountryGetCall.html) and [*store infos list*](struct.AccountStoreInfoListCall.html) +//! * [*avails get*](struct.AccountAvailGetCall.html), [*avails list*](struct.AccountAvailListCall.html), [*orders get*](struct.AccountOrderGetCall.html), [*orders list*](struct.AccountOrderListCall.html), [*store infos country get*](struct.AccountStoreInfoCountryGetCall.html) and [*store infos list*](struct.AccountStoreInfoListCall.html) //! //! //! @@ -170,7 +170,7 @@ // 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 +// 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)] @@ -295,8 +295,6 @@ pub struct PlayMovies { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for PlayMovies {} @@ -309,8 +307,6 @@ impl<'a, C, A> PlayMovies client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://playmoviespartner.googleapis.com/".to_string(), - _root_url: "https://playmoviespartner.googleapis.com/".to_string(), } } @@ -327,55 +323,194 @@ impl<'a, C, A> PlayMovies self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://playmoviespartner.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://playmoviespartner.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## -/// Response to the 'ListExperienceLocales' method. +/// An Avail describes the Availability Window of a specific Edit in a given +/// country, which means the period Google is allowed to sell or rent the Edit. +/// +/// Avails are exposed in EMA format Version 1.6b (available at +/// http://www.movielabs.com/md/avails/) +/// +/// Studios can see the Avails for the Titles they own. +/// Post-production houses cannot see any Avails. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [experience locales list accounts](struct.AccountExperienceLocaleListCall.html) (response) +/// * [avails get accounts](struct.AccountAvailGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListExperienceLocalesResponse { - /// See _List methods rules_ for info about this field. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// See _List methods rules_ for more information about this field. - #[serde(rename="totalSize")] - pub total_size: Option, - /// List of ExperienceLocales that match the request criteria. - #[serde(rename="experienceLocales")] - pub experience_locales: Option>, +pub struct Avail { + /// Name of the post-production houses that manage the Avail. + /// Not part of EMA Specs. + #[serde(rename="pphNames")] + pub pph_names: Option>, + /// Type of transaction. + #[serde(rename="licenseType")] + pub license_type: Option, + /// Communicating if caption file will be delivered. + #[serde(rename="captionIncluded")] + pub caption_included: Option, + /// Release date of the Title in earliest released territory. + /// Typically it is just the year, but it is free-form as per EMA spec. + /// Examples: "1979", "Oct 2014" + #[serde(rename="releaseDate")] + pub release_date: Option, + /// Other identifier referring to the episode, as defined by partner. + /// Only available on TV avails. + /// Example: "rs_googlers_s1_3". + #[serde(rename="episodeAltId")] + pub episode_alt_id: Option, + /// OPTIONAL.TV Only. Title used by involved parties to refer to this episode. + /// Only available on TV Avails. + /// Example: "Coding at Google". + #[serde(rename="episodeTitleInternalAlias")] + pub episode_title_internal_alias: Option, + /// ID internally generated by Google to uniquely identify an Avail. + /// Not part of EMA Specs. + #[serde(rename="availId")] + pub avail_id: Option, + /// End of term in YYYY-MM-DD format in the timezone of the country + /// of the Avail. + /// "Open" if no end date is available. + /// Example: "2019-02-17" + pub end: Option, + /// Other identifier referring to the Edit, as defined by partner. + /// Example: "GOOGLER_2006" + #[serde(rename="altId")] + pub alt_id: Option, + /// Rating system applied to the version of title within territory + /// of Avail. + /// Rating systems should be formatted as per + /// [EMA ratings spec](http://www.movielabs.com/md/ratings/) + /// Example: "MPAA" + #[serde(rename="ratingSystem")] + pub rating_system: Option, + /// Start of term in YYYY-MM-DD format in the timezone of the + /// country of the Avail. + /// Example: "2013-05-14". + pub start: Option, + /// Title used by involved parties to refer to this content. + /// Example: "Googlers, The". + /// Only available on Movie Avails. + #[serde(rename="titleInternalAlias")] + pub title_internal_alias: Option, + /// Title used by involved parties to refer to this season. + /// Only available on TV Avails. + /// Example: "Googlers, The". + #[serde(rename="seasonTitleInternalAlias")] + pub season_title_internal_alias: Option, + /// ISO 3166-1 alpha-2 country code for the country or territory + /// of this Avail. + /// For Avails, we use Territory in lieu of Country to comply with + /// EMA specifications. + /// But please note that Territory and Country identify the same thing. + /// Example: "US". + pub territory: Option, + /// Manifestation Identifier. This should be the Manifestation + /// Level EIDR. + /// Example: "10.2340/1489-49A2-3956-4B2D-FE16-7" + #[serde(rename="encodeId")] + pub encode_id: Option, + /// Spoken language of the intended audience. + /// Language shall be encoded in accordance with RFC 5646. + /// Example: "fr". + #[serde(rename="storeLanguage")] + pub store_language: Option, + /// The number assigned to the season within a series. + /// Only available on TV Avails. + /// Example: "1". + #[serde(rename="seasonNumber")] + pub season_number: Option, + /// The number assigned to the episode within a season. + /// Only available on TV Avails. + /// Example: "3". + #[serde(rename="episodeNumber")] + pub episode_number: Option, + /// Indicates the format profile covered by the transaction. + #[serde(rename="formatProfile")] + pub format_profile: Option, + /// Value to be applied to the pricing type. + /// Example: "4" or "2.99" + #[serde(rename="priceValue")] + pub price_value: Option, + /// Google-generated ID identifying the video linked to this Avail, once + /// delivered. + /// Not part of EMA Specs. + /// Example: 'gtry456_xc' + #[serde(rename="videoId")] + pub video_id: Option, + /// Communicating an exempt category as defined by FCC regulations. + /// It is not required for non-US Avails. + /// Example: "1" + #[serde(rename="captionExemption")] + pub caption_exemption: Option, + /// Value representing the rating reason. + /// Rating reasons should be formatted as per + /// [EMA ratings spec](http://www.movielabs.com/md/ratings/) + /// and comma-separated for inclusion of multiple reasons. + /// Example: "L, S, V" + #[serde(rename="ratingReason")] + pub rating_reason: Option, + /// Work type as enumerated in EMA. + #[serde(rename="workType")] + pub work_type: Option, + /// The name of the studio that owns the Edit referred in the Avail. + /// This is the equivalent of `studio_name` in other resources, but it follows + /// the EMA nomenclature. + /// Example: "Google Films". + #[serde(rename="displayName")] + pub display_name: Option, + /// Other identifier referring to the season, as defined by partner. + /// Only available on TV avails. + /// Example: "rs_googlers_s1". + #[serde(rename="seasonAltId")] + pub season_alt_id: Option, + /// Title Identifier. This should be the Title Level EIDR. + /// Example: "10.5240/1489-49A2-3956-4B2D-FE16-5". + #[serde(rename="contentId")] + pub content_id: Option, + /// Other identifier referring to the series, as defined by partner. + /// Only available on TV avails. + /// Example: "rs_googlers". + #[serde(rename="seriesAltId")] + pub series_alt_id: Option, + /// Value representing the rating. + /// Ratings should be formatted as per http://www.movielabs.com/md/ratings/ + /// Example: "PG" + #[serde(rename="ratingValue")] + pub rating_value: Option, + /// Title used by involved parties to refer to this series. + /// Only available on TV Avails. + /// Example: "Googlers, The". + #[serde(rename="seriesTitleInternalAlias")] + pub series_title_internal_alias: Option, + /// First date an Edit could be publically announced as becoming + /// available at a specific future date in territory of Avail. + /// *Not* the Avail start date or pre-order start date. + /// Format is YYYY-MM-DD. + /// Only available for pre-orders. + /// Example: "2012-12-10" + #[serde(rename="suppressionLiftDate")] + pub suppression_lift_date: Option, + /// Edit Identifier. This should be the Edit Level EIDR. + /// Example: "10.2340/1489-49A2-3956-4B2D-FE16-6" + #[serde(rename="productId")] + pub product_id: Option, + /// Type of pricing that should be applied to this Avail + /// based on how the partner classify them. + /// Example: "Tier", "WSP", "SRP", or "Category". + #[serde(rename="priceType")] + pub price_type: Option, } -impl ResponseResult for ListExperienceLocalesResponse {} +impl ResponseResult for Avail {} /// Response to the 'ListOrders' method. @@ -413,12 +548,12 @@ impl ResponseResult for ListOrdersResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListStoreInfosResponse { - /// List of StoreInfos that match the request criteria. - #[serde(rename="storeInfos")] - pub store_infos: Option>, /// See 'List methods rules' for info about this field. #[serde(rename="nextPageToken")] pub next_page_token: Option, + /// List of StoreInfos that match the request criteria. + #[serde(rename="storeInfos")] + pub store_infos: Option>, /// See _List methods rules_ for more information about this field. #[serde(rename="totalSize")] pub total_size: Option, @@ -427,276 +562,14 @@ pub struct ListStoreInfosResponse { impl ResponseResult for ListStoreInfosResponse {} -/// A Component is an element (audio, video, subtitle, artwork, trailer, etc...) that is used in a set of ExperienceLocales. A Component is owned by a Studio and managed either by the Studio itself or by one Post-Production House. Each Component is identified by a `component_id` and its `type`. +/// Information about a playable sequence (video) associated with an Edit +/// and available at the Google Play Store. /// -/// # Activities +/// Internally, each StoreInfo is uniquely identified by a `video_id` +/// and `country`. /// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [components type get accounts](struct.AccountComponentTypeGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Component { - /// High-level status of the Component. - pub status: Option, - /// List of Alternative Cut IDs, sometimes available in lieu of the main Edit-level EIDR IDs. This is not an EIDR ID, but a Partner-provided ID. Example: "206346_79838". - #[serde(rename="altCutIds")] - pub alt_cut_ids: Option>, - /// Processing errors during XML file parsing. Example: 'Invalid input file' - #[serde(rename="processingErrors")] - pub processing_errors: Option>, - /// Name of the studio that owns the Component. - #[serde(rename="studioName")] - pub studio_name: Option, - /// Detailed status of the Component - #[serde(rename="statusDetail")] - pub status_detail: Option, - /// Notes explaining why a Component has been rejected. - #[serde(rename="rejectionNote")] - pub rejection_note: Option, - /// Timestamp when the Component was approved. - #[serde(rename="approvedTime")] - pub approved_time: Option, - /// List of Title-level EIDR IDs. Example: "10.5240/1489-49A2-3956-4B2D-FE16-5". - #[serde(rename="titleLevelEidrs")] - pub title_level_eidrs: Option>, - /// IDs internally generated by Google to uniquely identify the ExperienceLocales for which the Component is used. Example: 'KRZiVjY9h7t' - #[serde(rename="elIds")] - pub el_ids: Option>, - /// Default Edit name, usually in the language of the country of origin. Example: "Googlers, The". - pub name: Option, - /// Language of the component, using the "BCP 47" format. Examples: "en", "en-US", "es", "es-419". - pub language: Option, - /// Type of the playable unit for which the Component is intended. - #[serde(rename="playableUnitType")] - pub playable_unit_type: Option, - /// Detail about the type of the Component. - #[serde(rename="componentDetailType")] - pub component_detail_type: Option, - /// Timestamp when the Component was received. - #[serde(rename="receivedTime")] - pub received_time: Option, - /// List of custom IDs (defined by the partner) linked to the ExperienceLocale using this Component. Example: "R86241" - #[serde(rename="customIds")] - pub custom_ids: Option>, - /// Name of the post-production house that manages the Component. - #[serde(rename="pphName")] - pub pph_name: Option, - /// File name of the Component when delivered. - pub filename: Option, - /// Component priority, as defined by Google. The higher the value, the higher the priority. - pub priority: Option, - /// List of Edit-level EIDR IDs. Example: "10.5240/1489-49A2-3956-4B2D-FE16-6". - #[serde(rename="editLevelEidrs")] - pub edit_level_eidrs: Option>, - /// A simpler representation of the priority. - #[serde(rename="normalizedPriority")] - pub normalized_priority: Option, - /// Type of the Component. Example: AUDIO_51 - #[serde(rename="type")] - pub type_: Option, - /// ID internally generated by Google to uniquely identify the Component. Example: 'wteyrc_647xc' - #[serde(rename="componentId")] - pub component_id: Option, -} - -impl ResponseResult for Component {} - - -/// An Avail describes the Availability Window of a specific Edit in a given country, which means the period Google is allowed to sell or rent the Edit. Avails are exposed in EMA format Version 1.6b (available at http://www.movielabs.com/md/avails/) Studios can see the Avails for the Titles they own. Post-production houses cannot see any Avails. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [avails get accounts](struct.AccountAvailGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Avail { - /// Name of the post-production houses that manage the Avail. Not part of EMA Specs. - #[serde(rename="pphNames")] - pub pph_names: Option>, - /// Type of transaction. - #[serde(rename="licenseType")] - pub license_type: Option, - /// Manifestation Identifier. This should be the Manifestation Level EIDR. Example: "10.2340/1489-49A2-3956-4B2D-FE16-7" - #[serde(rename="encodeId")] - pub encode_id: Option, - /// Communicating if caption file will be delivered. - #[serde(rename="captionIncluded")] - pub caption_included: Option, - /// Release date of the Title in earliest released territory. Typically it is just the year, but it is free-form as per EMA spec. Examples: "1979", "Oct 2014" - #[serde(rename="releaseDate")] - pub release_date: Option, - /// Other identifier referring to the episode, as defined by partner. Only available on TV avails. Example: "rs_googlers_s1_3". - #[serde(rename="episodeAltId")] - pub episode_alt_id: Option, - /// OPTIONAL.TV Only. Title used by involved parties to refer to this episode. Only available on TV Avails. Example: "Coding at Google". - #[serde(rename="episodeTitleInternalAlias")] - pub episode_title_internal_alias: Option, - /// ID internally generated by Google to uniquely identify an Avail. Not part of EMA Specs. - #[serde(rename="availId")] - pub avail_id: Option, - /// End of term in YYYY-MM-DD format in the timezone of the country of the Avail. "Open" if no end date is available. Example: "2019-02-17" - pub end: Option, - /// Other identifier referring to the Edit, as defined by partner. Example: "GOOGLER_2006" - #[serde(rename="altId")] - pub alt_id: Option, - /// Other identifier referring to the series, as defined by partner. Only available on TV avails. Example: "rs_googlers". - #[serde(rename="seriesAltId")] - pub series_alt_id: Option, - /// Start of term in YYYY-MM-DD format in the timezone of the country of the Avail. Example: "2013-05-14". - pub start: Option, - /// Title used by involved parties to refer to this content. Example: "Googlers, The". Only available on Movie Avails. - #[serde(rename="titleInternalAlias")] - pub title_internal_alias: Option, - /// Title used by involved parties to refer to this season. Only available on TV Avails. Example: "Googlers, The". - #[serde(rename="seasonTitleInternalAlias")] - pub season_title_internal_alias: Option, - /// ISO 3166-1 alpha-2 country code for the country or territory of this Avail. For Avails, we use Territory in lieu of Country to comply with EMA specifications. But please note that Territory and Country identify the same thing. Example: "US". - pub territory: Option, - /// Edit Identifier. This should be the Edit Level EIDR. Example: "10.2340/1489-49A2-3956-4B2D-FE16-6" - #[serde(rename="productId")] - pub product_id: Option, - /// Spoken language of the intended audience. Language shall be encoded in accordance with RFC 5646. Example: "fr". - #[serde(rename="storeLanguage")] - pub store_language: Option, - /// The number assigned to the season within a series. Only available on TV Avails. Example: "1". - #[serde(rename="seasonNumber")] - pub season_number: Option, - /// The number assigned to the episode within a season. Only available on TV Avails. Example: "3". - #[serde(rename="episodeNumber")] - pub episode_number: Option, - /// Indicates the format profile covered by the transaction. - #[serde(rename="formatProfile")] - pub format_profile: Option, - /// Value to be applied to the pricing type. Example: "4" or "2.99" - #[serde(rename="priceValue")] - pub price_value: Option, - /// Google-generated ID identifying the video linked to this Avail, once delivered. Not part of EMA Specs. Example: 'gtry456_xc' - #[serde(rename="videoId")] - pub video_id: Option, - /// Value representing the rating reason. Rating reasons should be formatted as per [EMA ratings spec](http://www.movielabs.com/md/ratings/) and comma-separated for inclusion of multiple reasons. Example: "L, S, V" - #[serde(rename="ratingReason")] - pub rating_reason: Option, - /// Communicating an exempt category as defined by FCC regulations. It is not required for non-US Avails. Example: "1" - #[serde(rename="captionExemption")] - pub caption_exemption: Option, - /// Work type as enumerated in EMA. - #[serde(rename="workType")] - pub work_type: Option, - /// The name of the studio that owns the Edit referred in the Avail. This is the equivalent of `studio_name` in other resources, but it follows the EMA nomenclature. Example: "Google Films". - #[serde(rename="displayName")] - pub display_name: Option, - /// Other identifier referring to the season, as defined by partner. Only available on TV avails. Example: "rs_googlers_s1". - #[serde(rename="seasonAltId")] - pub season_alt_id: Option, - /// Title Identifier. This should be the Title Level EIDR. Example: "10.5240/1489-49A2-3956-4B2D-FE16-5". - #[serde(rename="contentId")] - pub content_id: Option, - /// Rating system applied to the version of title within territory of Avail. Rating systems should be formatted as per [EMA ratings spec](http://www.movielabs.com/md/ratings/) Example: "MPAA" - #[serde(rename="ratingSystem")] - pub rating_system: Option, - /// Value representing the rating. Ratings should be formatted as per http://www.movielabs.com/md/ratings/ Example: "PG" - #[serde(rename="ratingValue")] - pub rating_value: Option, - /// Title used by involved parties to refer to this series. Only available on TV Avails. Example: "Googlers, The". - #[serde(rename="seriesTitleInternalAlias")] - pub series_title_internal_alias: Option, - /// First date an Edit could be publically announced as becoming available at a specific future date in territory of Avail. *Not* the Avail start date or pre-order start date. Format is YYYY-MM-DD. Only available for pre-orders. Example: "2012-12-10" - #[serde(rename="suppressionLiftDate")] - pub suppression_lift_date: Option, - /// Type of pricing that should be applied to this Avail based on how the partner classify them. Example: "Tier", "WSP", "SRP", or "Category". - #[serde(rename="priceType")] - pub price_type: Option, -} - -impl ResponseResult for Avail {} - - -/// An ExperienceLocale tracks the fulfillment of a Title in a country using a specific language, when delivered using component-based delivery. For example, a Title in Switzerland might have 3 ExperienceLocales: they both share the same country ("CH"), but each has different languages ("de", "fr", and "it"). Each ExperienceLocale is uniquely identified by an `el_id`, which is generated by Google. Externally, an ExperienceLocale can also be identified by partners using its EIDR IDs, AltCutID or `custom_id` (when provided). -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [experience locales get accounts](struct.AccountExperienceLocaleGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ExperienceLocale { - /// Name of the post-production houses that manage the ExperienceLocale. - #[serde(rename="pphNames")] - pub pph_names: Option>, - /// High-level status of the ExperienceLocale. - pub status: Option, - /// Title-level EIDR ID. Example: "10.5240/1489-49A2-3956-4B2D-FE16-5". - #[serde(rename="titleLevelEidr")] - pub title_level_eidr: Option, - /// Trailer ID, as defined by Google, linked to the trailer video in the ExperienceLocale. Example: 'gtry457_tr'. - #[serde(rename="trailerId")] - pub trailer_id: Option, - /// YouTube Channel ID linked to the ExperienceLocale. Example: "UCRG64darCZhb". - #[serde(rename="channelId")] - pub channel_id: Option, - /// Name of the studio that owns the ExperienceLocale. - #[serde(rename="studioName")] - pub studio_name: Option, - /// Video ID, as defined by Google, linked to the feature video in the ExperienceLocale. Example: 'gtry456_xc'. - #[serde(rename="videoId")] - pub video_id: Option, - /// Timestamp when the ExperienceLocale was approved. - #[serde(rename="approvedTime")] - pub approved_time: Option, - /// Edit-level EIDR ID. Example: "10.5240/1489-49A2-3956-4B2D-FE16-6". - #[serde(rename="editLevelEidr")] - pub edit_level_eidr: Option, - /// InventoryID as defined in the EMA specs. - #[serde(rename="inventoryId")] - pub inventory_id: Option, - /// PlayableSequenceID as defined in the EMA specs. - #[serde(rename="playableSequenceId")] - pub playable_sequence_id: Option, - /// Default Edit name, usually in the language of the country of origin. Example: "Googlers, The". - pub name: Option, - /// ID internally generated by Google to uniquely identify a ExperienceLocale. Example: 'KRZiVjY9h7t' - #[serde(rename="elId")] - pub el_id: Option, - /// PresentationID as defined in the EMA specs. - #[serde(rename="presentationId")] - pub presentation_id: Option, - /// Timestamp of the earliest start date of the Avails linked to this ExperienceLocale. - #[serde(rename="earliestAvailStartTime")] - pub earliest_avail_start_time: Option, - /// Language of the ExperienceLocale, using the "BCP 47" format. Examples: "en", "en-US", "es", "es-419". - pub language: Option, - /// Alternative Cut ID, sometimes available in lieu of the main Edit-level EIDR ID. This is not an EIDR ID, but a Partner-provided ID. Example: "206346_79838". - #[serde(rename="altCutId")] - pub alt_cut_id: Option, - /// List of custom IDs (defined by the partner) linked to this ExperienceLocale. Example: "R86241" - #[serde(rename="customIds")] - pub custom_ids: Option>, - /// ExperienceLocale priority, as defined by Google. The higher the value, the higher the priority. Example: 90 - pub priority: Option, - /// A simpler representation of the priority. - #[serde(rename="normalizedPriority")] - pub normalized_priority: Option, - /// Timestamp when the ExperienceLocale was created. - #[serde(rename="createdTime")] - pub created_time: Option, - /// Country where the ExperienceLocale is available, using the "ISO 3166-1 alpha-2" format. Example: "US". - pub country: Option, - /// Type of the Edit linked to the ExperienceLocale. - #[serde(rename="type")] - pub type_: Option, -} - -impl ResponseResult for ExperienceLocale {} - - -/// Information about a playable sequence (video) associated with an Edit and available at the Google Play Store. Internally, each StoreInfo is uniquely identified by a `video_id` and `country`. Externally, Title-level EIDR or Edit-level EIDR, if provided, can also be used to identify a specific title or edit in a country. +/// Externally, Title-level EIDR or Edit-level EIDR, if provided, +/// can also be used to identify a specific title or edit in a country. /// /// # Activities /// @@ -713,25 +586,30 @@ pub struct StoreInfo { /// Whether the Edit has a EST offer. #[serde(rename="hasEstOffer")] pub has_est_offer: Option, - /// Title-level EIDR ID. Example: "10.5240/1489-49A2-3956-4B2D-FE16-5". + /// Title-level EIDR ID. + /// Example: "10.5240/1489-49A2-3956-4B2D-FE16-5". #[serde(rename="titleLevelEidr")] pub title_level_eidr: Option, /// Whether the Edit has a SD offer. #[serde(rename="hasSdOffer")] pub has_sd_offer: Option, - /// The number assigned to the season within a show. Only available on TV Edits. Example: "1". + /// The number assigned to the season within a show. + /// Only available on TV Edits. + /// Example: "1". #[serde(rename="seasonNumber")] pub season_number: Option, /// Timestamp when the Edit went live on the Store. #[serde(rename="liveTime")] pub live_time: Option, - /// Google-generated ID identifying the trailer linked to the Edit. Example: 'bhd_4e_cx' + /// Google-generated ID identifying the trailer linked to the Edit. + /// Example: 'bhd_4e_cx' #[serde(rename="trailerId")] pub trailer_id: Option, /// Name of the studio that owns the Edit ordered. #[serde(rename="studioName")] pub studio_name: Option, - /// Google-generated ID identifying the video linked to the Edit. Example: 'gtry456_xc' + /// Google-generated ID identifying the video linked to the Edit. + /// Example: 'gtry456_xc' #[serde(rename="videoId")] pub video_id: Option, /// Whether the Edit has a HD offer. @@ -740,30 +618,49 @@ pub struct StoreInfo { /// Whether the Edit has a VOD offer. #[serde(rename="hasVodOffer")] pub has_vod_offer: Option, - /// Edit-level EIDR ID. Example: "10.5240/1489-49A2-3956-4B2D-FE16-6". + /// Edit-level EIDR ID. + /// Example: "10.5240/1489-49A2-3956-4B2D-FE16-6". #[serde(rename="editLevelEidr")] pub edit_level_eidr: Option, /// Subtitles available for this Edit. pub subtitles: Option>, - /// The number assigned to the episode within a season. Only available on TV Edits. Example: "1". + /// The number assigned to the episode within a season. + /// Only available on TV Edits. + /// Example: "1". #[serde(rename="episodeNumber")] pub episode_number: Option, - /// Google-generated ID identifying the show linked to the Edit. Only available for TV Edits. Example: 'et2hsue_x' + /// Google-generated ID identifying the show linked to the Edit. + /// Only available for TV Edits. + /// Example: 'et2hsue_x' #[serde(rename="showId")] pub show_id: Option, - /// Default Edit name, usually in the language of the country of origin. Example: "Googlers, The". + /// Default Edit name, usually in the language of the country of + /// origin. + /// Example: "Googlers, The". pub name: Option, - /// Country where Edit is available in ISO 3166-1 alpha-2 country code. Example: "US". + /// Country where Edit is available in ISO 3166-1 alpha-2 country + /// code. + /// Example: "US". pub country: Option, - /// Google-generated ID identifying the season linked to the Edit. Only available for TV Edits. Example: 'ster23ex' + /// Google-generated ID identifying the season linked to the Edit. + /// Only available for TV Edits. + /// Example: 'ster23ex' #[serde(rename="seasonId")] pub season_id: Option, - /// Knowledge Graph ID associated to this Edit, if available. This ID links the Edit to its knowledge entity, externally accessible at http://freebase.com. In the absense of Title EIDR or Edit EIDR, this ID helps link together multiple Edits across countries. Example: '/m/0ffx29' + /// Knowledge Graph ID associated to this Edit, if available. + /// This ID links the Edit to its knowledge entity, externally accessible + /// at http://freebase.com. + /// In the absense of Title EIDR or Edit EIDR, this ID helps link together + /// multiple Edits across countries. + /// Example: '/m/0ffx29' pub mid: Option, /// Whether the Edit has a 5.1 channel audio track. #[serde(rename="hasAudio51")] pub has_audio51: Option, - /// Default Season name, usually in the language of the country of origin. Only available for TV Edits Example: "Googlers, The - A Brave New World". + /// Default Season name, usually in the language of the country of + /// origin. + /// Only available for TV Edits + /// Example: "Googlers, The - A Brave New World". #[serde(rename="seasonName")] pub season_name: Option, /// Audio tracks available for this Edit. @@ -775,7 +672,10 @@ pub struct StoreInfo { /// Edit type, like Movie, Episode or Season. #[serde(rename="type")] pub type_: Option, - /// Default Show name, usually in the language of the country of origin. Only available for TV Edits Example: "Googlers, The". + /// Default Show name, usually in the language of the country of + /// origin. + /// Only available for TV Edits + /// Example: "Googlers, The". #[serde(rename="showName")] pub show_name: Option, } @@ -807,7 +707,14 @@ pub struct ListAvailsResponse { impl ResponseResult for ListAvailsResponse {} -/// An Order tracks the fulfillment of an Edit when delivered using the legacy, non-component-based delivery. Each Order is uniquely identified by an `order_id`, which is generated by Google. Externally, Orders can also be identified by partners using its `custom_id` (when provided). +/// An Order tracks the fulfillment of an Edit when delivered using the +/// legacy, non-component-based delivery. +/// +/// Each Order is uniquely identified by an `order_id`, which is generated +/// by Google. +/// +/// Externally, Orders can also be identified by partners using its `custom_id` +/// (when provided). /// /// # Activities /// @@ -818,12 +725,14 @@ impl ResponseResult for ListAvailsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Order { - /// ID internally generated by Google to uniquely identify an Order. Example: 'abcde12_x' + /// ID internally generated by Google to uniquely identify an Order. + /// Example: 'abcde12_x' #[serde(rename="orderId")] pub order_id: Option, /// High-level status of the order. pub status: Option, - /// YouTube Channel ID that should be used to fulfill the Order. Example: "UCRG64darCZhb". + /// YouTube Channel ID that should be used to fulfill the Order. + /// Example: "UCRG64darCZhb". #[serde(rename="channelId")] pub channel_id: Option, /// Name of the studio that owns the Edit ordered. @@ -832,27 +741,40 @@ pub struct Order { /// Detailed status of the order #[serde(rename="statusDetail")] pub status_detail: Option, - /// Field explaining why an Order has been rejected. Example: "Trailer audio is 2ch mono, please re-deliver in stereo". + /// Field explaining why an Order has been rejected. + /// Example: "Trailer audio is 2ch mono, please re-deliver in stereo". #[serde(rename="rejectionNote")] pub rejection_note: Option, /// Timestamp when the Order was approved. #[serde(rename="approvedTime")] pub approved_time: Option, - /// Google-generated ID identifying the video linked to this Order, once delivered. Example: 'gtry456_xc'. + /// Google-generated ID identifying the video linked to this Order, once + /// delivered. + /// Example: 'gtry456_xc'. #[serde(rename="videoId")] pub video_id: Option, - /// Default Episode name, usually in the language of the country of origin. Only available for TV Edits Example: "Googlers, The - Pilot". + /// Default Episode name, + /// usually in the language of the country of origin. + /// Only available for TV Edits + /// Example: "Googlers, The - Pilot". #[serde(rename="episodeName")] pub episode_name: Option, - /// Default Edit name, usually in the language of the country of origin. Example: "Googlers, The". - pub name: Option, - /// Default Season name, usually in the language of the country of origin. Only available for TV Edits Example: "Googlers, The - A Brave New World". - #[serde(rename="seasonName")] - pub season_name: Option, - /// Timestamp of the earliest start date of the Avails linked to this Order. + /// Timestamp of the earliest start date of the Avails + /// linked to this Order. #[serde(rename="earliestAvailStartTime")] pub earliest_avail_start_time: Option, - /// Countries where the Order is available, using the "ISO 3166-1 alpha-2" format (example: "US"). + /// Default Season name, + /// usually in the language of the country of origin. + /// Only available for TV Edits + /// Example: "Googlers, The - A Brave New World". + #[serde(rename="seasonName")] + pub season_name: Option, + /// Default Edit name, + /// usually in the language of the country of origin. + /// Example: "Googlers, The". + pub name: Option, + /// Countries where the Order is available, + /// using the "ISO 3166-1 alpha-2" format (example: "US"). pub countries: Option>, /// A simpler representation of the priority. #[serde(rename="normalizedPriority")] @@ -866,21 +788,30 @@ pub struct Order { /// Name of the post-production house that manages the Edit ordered. #[serde(rename="pphName")] pub pph_name: Option, - /// Order priority, as defined by Google. The higher the value, the higher the priority. Example: 90 + /// Order priority, as defined by Google. + /// The higher the value, the higher the priority. + /// Example: 90 pub priority: Option, - /// Legacy Order priority, as defined by Google. Example: 'P0' + /// Legacy Order priority, as defined by Google. + /// Example: 'P0' #[serde(rename="legacyPriority")] pub legacy_priority: Option, - /// ID that can be used to externally identify an Order. This ID is provided by partners when submitting the Avails. Example: 'GOOGLER_2006' + /// ID that can be used to externally identify an Order. + /// This ID is provided by partners when submitting the Avails. + /// Example: 'GOOGLER_2006' #[serde(rename="customId")] pub custom_id: Option, - /// YouTube Channel Name that should be used to fulfill the Order. Example: "Google_channel". + /// YouTube Channel Name that should be used to fulfill the Order. + /// Example: "Google_channel". #[serde(rename="channelName")] pub channel_name: Option, /// Type of the Edit linked to the Order. #[serde(rename="type")] pub type_: Option, - /// Default Show name, usually in the language of the country of origin. Only available for TV Edits Example: "Googlers, The". + /// Default Show name, + /// usually in the language of the country of origin. + /// Only available for TV Edits + /// Example: "Googlers, The". #[serde(rename="showName")] pub show_name: Option, } @@ -888,30 +819,6 @@ pub struct Order { impl ResponseResult for Order {} -/// Response to the 'ListComponents' 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*). -/// -/// * [components list accounts](struct.AccountComponentListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListComponentsResponse { - /// See _List methods rules_ for info about this field. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// See _List methods rules_ for more information about this field. - #[serde(rename="totalSize")] - pub total_size: Option, - /// List of Components that match the request criteria. - pub components: Option>, -} - -impl ResponseResult for ListComponentsResponse {} - - // ################### // MethodBuilders ### @@ -940,7 +847,7 @@ impl ResponseResult for ListComponentsResponse {} /// ::default(), None); /// let mut hub = PlayMovies::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `avails_get(...)`, `avails_list(...)`, `components_list(...)`, `components_type_get(...)`, `experience_locales_get(...)`, `experience_locales_list(...)`, `orders_get(...)`, `orders_list(...)`, `store_infos_country_get(...)` and `store_infos_list(...)` +/// // like `avails_get(...)`, `avails_list(...)`, `orders_get(...)`, `orders_list(...)`, `store_infos_country_get(...)` and `store_infos_list(...)` /// // to build up your call. /// let rb = hub.accounts(); /// # } @@ -957,7 +864,10 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List Orders owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method. + /// List Orders owned or managed by the partner. + /// + /// See _Authentication and Authorization rules_ and + /// _List methods rules_ for more information about this method. /// /// # Arguments /// @@ -982,7 +892,10 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get a StoreInfo given its video id and country. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method. + /// Get a StoreInfo given its video id and country. + /// + /// See _Authentication and Authorization rules_ and + /// _Get methods rules_ for more information about this method. /// /// # Arguments /// @@ -1003,7 +916,10 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get an Order given its id. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method. + /// Get an Order given its id. + /// + /// See _Authentication and Authorization rules_ and + /// _Get methods rules_ for more information about this method. /// /// # Arguments /// @@ -1041,7 +957,10 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List Avails owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method. + /// List Avails owned or managed by the partner. + /// + /// See _Authentication and Authorization rules_ and + /// _List methods rules_ for more information about this method. /// /// # Arguments /// @@ -1067,26 +986,10 @@ impl<'a, C, A> AccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Get an ExperienceLocale given its id. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method. + /// List StoreInfos owned or managed by the partner. /// - /// # Arguments - /// - /// * `accountId` - REQUIRED. See _General rules_ for more information about this field. - /// * `elId` - REQUIRED. ExperienceLocale ID, as defined by Google. - pub fn experience_locales_get(&self, account_id: &str, el_id: &str) -> AccountExperienceLocaleGetCall<'a, C, A> { - AccountExperienceLocaleGetCall { - hub: self.hub, - _account_id: account_id.to_string(), - _el_id: el_id.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// List StoreInfos owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method. + /// See _Authentication and Authorization rules_ and + /// _List methods rules_ for more information about this method. /// /// # Arguments /// @@ -1110,84 +1013,6 @@ impl<'a, C, A> AccountMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// List ExperienceLocales owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method. - /// - /// # Arguments - /// - /// * `accountId` - REQUIRED. See _General rules_ for more information about this field. - pub fn experience_locales_list(&self, account_id: &str) -> AccountExperienceLocaleListCall<'a, C, A> { - AccountExperienceLocaleListCall { - hub: self.hub, - _account_id: account_id.to_string(), - _title_level_eidr: Default::default(), - _studio_names: Default::default(), - _status: Default::default(), - _pph_names: Default::default(), - _page_token: Default::default(), - _page_size: Default::default(), - _edit_level_eidr: Default::default(), - _custom_id: Default::default(), - _alt_cut_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// List Components owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method. - /// - /// # Arguments - /// - /// * `accountId` - REQUIRED. See _General rules_ for more information about this field. - pub fn components_list(&self, account_id: &str) -> AccountComponentListCall<'a, C, A> { - AccountComponentListCall { - hub: self.hub, - _account_id: account_id.to_string(), - _title_level_eidr: Default::default(), - _studio_names: Default::default(), - _status: Default::default(), - _presentation_id: Default::default(), - _pph_names: Default::default(), - _playable_sequence_id: Default::default(), - _page_token: Default::default(), - _page_size: Default::default(), - _inventory_id: Default::default(), - _filename: Default::default(), - _el_id: Default::default(), - _edit_level_eidr: Default::default(), - _custom_id: Default::default(), - _alt_cut_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Get a Component given its id. - /// - /// # Arguments - /// - /// * `accountId` - REQUIRED. See _General rules_ for more information about this field. - /// * `componentId` - REQUIRED. Component ID. - /// * `type` - REQUIRED. Component Type. - pub fn components_type_get(&self, account_id: &str, component_id: &str, type_: &str) -> AccountComponentTypeGetCall<'a, C, A> { - AccountComponentTypeGetCall { - hub: self.hub, - _account_id: account_id.to_string(), - _component_id: component_id.to_string(), - _type_: type_.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -1198,7 +1023,10 @@ impl<'a, C, A> AccountMethods<'a, C, A> { // CallBuilders ### // ################# -/// List Orders owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method. +/// List Orders owned or managed by the partner. +/// +/// See _Authentication and Authorization rules_ and +/// _List methods rules_ for more information about this method. /// /// A builder for the *orders.list* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -1316,7 +1144,7 @@ impl<'a, C, A> AccountOrderListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/orders"; + let mut url = "https://playmoviespartner.googleapis.com/v1/accounts/{accountId}/orders".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); } @@ -1475,7 +1303,8 @@ impl<'a, C, A> AccountOrderListCall<'a, C, A> where C: BorrowMut, self._page_size = Some(new_value); self } - /// Filter that matches Orders with a `name`, `show`, `season` or `episode` that contains the given case-insensitive name. + /// Filter that matches Orders with a `name`, `show`, `season` or `episode` + /// that contains the given case-insensitive name. /// /// Sets the *name* query property to the given value. pub fn name(mut self, new_value: &str) -> AccountOrderListCall<'a, C, A> { @@ -1514,12 +1343,12 @@ impl<'a, C, A> AccountOrderListCall<'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) -> AccountOrderListCall<'a, C, A> @@ -1547,7 +1376,10 @@ impl<'a, C, A> AccountOrderListCall<'a, C, A> where C: BorrowMut, } -/// Get a StoreInfo given its video id and country. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method. +/// Get a StoreInfo given its video id and country. +/// +/// See _Authentication and Authorization rules_ and +/// _Get methods rules_ for more information about this method. /// /// A builder for the *storeInfos.country.get* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -1621,7 +1453,7 @@ impl<'a, C, A> AccountStoreInfoCountryGetCall<'a, C, A> where C: BorrowMut AccountStoreInfoCountryGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountStoreInfoCountryGetCall<'a, C, A> @@ -1812,7 +1644,10 @@ impl<'a, C, A> AccountStoreInfoCountryGetCall<'a, C, A> where C: BorrowMut AccountOrderGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/orders/{orderId}"; + let mut url = "https://playmoviespartner.googleapis.com/v1/accounts/{accountId}/orders/{orderId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); } @@ -2032,12 +1867,12 @@ impl<'a, C, A> AccountOrderGetCall<'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) -> AccountOrderGetCall<'a, C, A> @@ -2137,7 +1972,7 @@ impl<'a, C, A> AccountAvailGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/avails/{availId}"; + let mut url = "https://playmoviespartner.googleapis.com/v1/accounts/{accountId}/avails/{availId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); } @@ -2285,12 +2120,12 @@ impl<'a, C, A> AccountAvailGetCall<'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) -> AccountAvailGetCall<'a, C, A> @@ -2318,7 +2153,10 @@ impl<'a, C, A> AccountAvailGetCall<'a, C, A> where C: BorrowMut, } -/// List Avails owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method. +/// List Avails owned or managed by the partner. +/// +/// See _Authentication and Authorization rules_ and +/// _List methods rules_ for more information about this method. /// /// A builder for the *avails.list* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -2443,7 +2281,7 @@ impl<'a, C, A> AccountAvailListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/avails"; + let mut url = "https://playmoviespartner.googleapis.com/v1/accounts/{accountId}/avails".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); } @@ -2564,14 +2402,18 @@ impl<'a, C, A> AccountAvailListCall<'a, C, A> where C: BorrowMut, self._video_ids.push(new_value.to_string()); self } - /// Filter that matches Avails with a `title_internal_alias`, `series_title_internal_alias`, `season_title_internal_alias`, or `episode_title_internal_alias` that contains the given case-insensitive title. + /// Filter that matches Avails with a `title_internal_alias`, + /// `series_title_internal_alias`, `season_title_internal_alias`, + /// or `episode_title_internal_alias` that contains the given + /// case-insensitive title. /// /// Sets the *title* query property to the given value. pub fn title(mut self, new_value: &str) -> AccountAvailListCall<'a, C, A> { self._title = Some(new_value.to_string()); self } - /// Filter Avails that match (case-insensitive) any of the given country codes, using the "ISO 3166-1 alpha-2" format (examples: "US", "us", "Us"). + /// Filter Avails that match (case-insensitive) any of the given country codes, + /// using the "ISO 3166-1 alpha-2" format (examples: "US", "us", "Us"). /// /// Append the given value to the *territories* query property. /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. @@ -2617,7 +2459,9 @@ impl<'a, C, A> AccountAvailListCall<'a, C, A> where C: BorrowMut, self._alt_ids.push(new_value.to_string()); self } - /// Filter Avails that match a case-insensitive, partner-specific custom id. NOTE: this field is deprecated and will be removed on V2; `alt_ids` should be used instead. + /// Filter Avails that match a case-insensitive, partner-specific custom id. + /// NOTE: this field is deprecated and will be removed on V2; `alt_ids` + /// should be used instead. /// /// Sets the *alt id* query property to the given value. pub fn alt_id(mut self, new_value: &str) -> AccountAvailListCall<'a, C, A> { @@ -2649,12 +2493,12 @@ impl<'a, C, A> AccountAvailListCall<'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) -> AccountAvailListCall<'a, C, A> @@ -2682,260 +2526,10 @@ impl<'a, C, A> AccountAvailListCall<'a, C, A> where C: BorrowMut, } -/// Get an ExperienceLocale given its id. See _Authentication and Authorization rules_ and _Get methods rules_ for more information about this method. -/// -/// A builder for the *experienceLocales.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 yup_oauth2 as oauth2; -/// # extern crate google_playmoviespartner1 as playmoviespartner1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use playmoviespartner1::PlayMovies; +/// List StoreInfos owned or managed by the partner. /// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = PlayMovies::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.accounts().experience_locales_get("accountId", "elId") -/// .doit(); -/// # } -/// ``` -pub struct AccountExperienceLocaleGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a PlayMovies, - _account_id: String, - _el_id: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccountExperienceLocaleGetCall<'a, C, A> {} - -impl<'a, C, A> AccountExperienceLocaleGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ExperienceLocale)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "playmoviespartner.accounts.experienceLocales.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); - params.push(("accountId", self._account_id.to_string())); - params.push(("elId", self._el_id.to_string())); - for &field in ["alt", "accountId", "elId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/experienceLocales/{elId}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{accountId}", "accountId"), ("{elId}", "elId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["elId", "accountId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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. See _General rules_ for more information about this field. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> AccountExperienceLocaleGetCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// REQUIRED. ExperienceLocale ID, as defined by Google. - /// - /// Sets the *el id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn el_id(mut self, new_value: &str) -> AccountExperienceLocaleGetCall<'a, C, A> { - self._el_id = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> AccountExperienceLocaleGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> AccountExperienceLocaleGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::PlaymovyPartnerReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccountExperienceLocaleGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// List StoreInfos owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method. +/// See _Authentication and Authorization rules_ and +/// _List methods rules_ for more information about this method. /// /// A builder for the *storeInfos.list* method supported by a *account* resource. /// It is not used directly, but through a `AccountMethods` instance. @@ -2962,16 +2556,16 @@ impl<'a, C, A> AccountExperienceLocaleGetCall<'a, C, A> where C: BorrowMut AccountStoreInfoListCall<'a, C, A> where C: BorrowMut AccountStoreInfoListCall<'a, C, A> where C: BorrowMut AccountStoreInfoListCall<'a, C, A> { @@ -3233,7 +2829,8 @@ impl<'a, C, A> AccountStoreInfoListCall<'a, C, A> where C: BorrowMut AccountStoreInfoListCall<'a, C, A> { @@ -3248,7 +2845,8 @@ impl<'a, C, A> AccountStoreInfoListCall<'a, C, A> where C: BorrowMut AccountStoreInfoListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> AccountStoreInfoListCall<'a, C, A> @@ -3314,1044 +2912,4 @@ impl<'a, C, A> AccountStoreInfoListCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = PlayMovies::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.accounts().experience_locales_list("accountId") -/// .title_level_eidr("accusam") -/// .add_studio_names("Lorem") -/// .add_status("sea") -/// .add_pph_names("et") -/// .page_token("duo") -/// .page_size(-21) -/// .edit_level_eidr("eirmod") -/// .custom_id("sanctus") -/// .alt_cut_id("et") -/// .doit(); -/// # } -/// ``` -pub struct AccountExperienceLocaleListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a PlayMovies, - _account_id: String, - _title_level_eidr: Option, - _studio_names: Vec, - _status: Vec, - _pph_names: Vec, - _page_token: Option, - _page_size: Option, - _edit_level_eidr: Option, - _custom_id: Option, - _alt_cut_id: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccountExperienceLocaleListCall<'a, C, A> {} - -impl<'a, C, A> AccountExperienceLocaleListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListExperienceLocalesResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "playmoviespartner.accounts.experienceLocales.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); - params.push(("accountId", self._account_id.to_string())); - if let Some(value) = self._title_level_eidr { - params.push(("titleLevelEidr", value.to_string())); - } - if self._studio_names.len() > 0 { - for f in self._studio_names.iter() { - params.push(("studioNames", f.to_string())); - } - } - if self._status.len() > 0 { - for f in self._status.iter() { - params.push(("status", f.to_string())); - } - } - if self._pph_names.len() > 0 { - for f in self._pph_names.iter() { - params.push(("pphNames", f.to_string())); - } - } - if let Some(value) = self._page_token { - params.push(("pageToken", value.to_string())); - } - if let Some(value) = self._page_size { - params.push(("pageSize", value.to_string())); - } - if let Some(value) = self._edit_level_eidr { - params.push(("editLevelEidr", value.to_string())); - } - if let Some(value) = self._custom_id { - params.push(("customId", value.to_string())); - } - if let Some(value) = self._alt_cut_id { - params.push(("altCutId", value.to_string())); - } - for &field in ["alt", "accountId", "titleLevelEidr", "studioNames", "status", "pphNames", "pageToken", "pageSize", "editLevelEidr", "customId", "altCutId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/experienceLocales"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{accountId}", "accountId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["accountId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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. See _General rules_ for more information about this field. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> AccountExperienceLocaleListCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// Filter ExperienceLocales that match a given title-level EIDR. - /// - /// Sets the *title level eidr* query property to the given value. - pub fn title_level_eidr(mut self, new_value: &str) -> AccountExperienceLocaleListCall<'a, C, A> { - self._title_level_eidr = Some(new_value.to_string()); - self - } - /// See _List methods rules_ for info about this field. - /// - /// Append the given value to the *studio names* query property. - /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. - pub fn add_studio_names(mut self, new_value: &str) -> AccountExperienceLocaleListCall<'a, C, A> { - self._studio_names.push(new_value.to_string()); - self - } - /// Filter ExperienceLocales that match one of the given status. - /// - /// Append the given value to the *status* query property. - /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. - pub fn add_status(mut self, new_value: &str) -> AccountExperienceLocaleListCall<'a, C, A> { - self._status.push(new_value.to_string()); - self - } - /// See _List methods rules_ for info about this field. - /// - /// Append the given value to the *pph names* query property. - /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. - pub fn add_pph_names(mut self, new_value: &str) -> AccountExperienceLocaleListCall<'a, C, A> { - self._pph_names.push(new_value.to_string()); - self - } - /// See _List methods rules_ for info about this field. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AccountExperienceLocaleListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// See _List methods rules_ for info about this field. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> AccountExperienceLocaleListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// Filter ExperienceLocales that match a given edit-level EIDR. - /// - /// Sets the *edit level eidr* query property to the given value. - pub fn edit_level_eidr(mut self, new_value: &str) -> AccountExperienceLocaleListCall<'a, C, A> { - self._edit_level_eidr = Some(new_value.to_string()); - self - } - /// Filter ExperienceLocales that match a case-insensitive, partner-specific custom id. - /// - /// Sets the *custom id* query property to the given value. - pub fn custom_id(mut self, new_value: &str) -> AccountExperienceLocaleListCall<'a, C, A> { - self._custom_id = Some(new_value.to_string()); - self - } - /// Filter ExperienceLocales that match a case-insensitive, partner-specific Alternative Cut ID. - /// - /// Sets the *alt cut id* query property to the given value. - pub fn alt_cut_id(mut self, new_value: &str) -> AccountExperienceLocaleListCall<'a, C, A> { - self._alt_cut_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) -> AccountExperienceLocaleListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> AccountExperienceLocaleListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::PlaymovyPartnerReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccountExperienceLocaleListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// List Components owned or managed by the partner. See _Authentication and Authorization rules_ and _List methods rules_ for more information about this method. -/// -/// A builder for the *components.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 yup_oauth2 as oauth2; -/// # extern crate google_playmoviespartner1 as playmoviespartner1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use playmoviespartner1::PlayMovies; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = PlayMovies::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.accounts().components_list("accountId") -/// .title_level_eidr("et") -/// .add_studio_names("consetetur") -/// .add_status("ut") -/// .presentation_id("ea") -/// .add_pph_names("sed") -/// .playable_sequence_id("dolor") -/// .page_token("dolor") -/// .page_size(-48) -/// .inventory_id("et") -/// .filename("consetetur") -/// .el_id("amet.") -/// .edit_level_eidr("voluptua.") -/// .custom_id("Lorem") -/// .alt_cut_id("gubergren") -/// .doit(); -/// # } -/// ``` -pub struct AccountComponentListCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a PlayMovies, - _account_id: String, - _title_level_eidr: Option, - _studio_names: Vec, - _status: Vec, - _presentation_id: Option, - _pph_names: Vec, - _playable_sequence_id: Option, - _page_token: Option, - _page_size: Option, - _inventory_id: Option, - _filename: Option, - _el_id: Option, - _edit_level_eidr: Option, - _custom_id: Option, - _alt_cut_id: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccountComponentListCall<'a, C, A> {} - -impl<'a, C, A> AccountComponentListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListComponentsResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "playmoviespartner.accounts.components.list", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((17 + self._additional_params.len())); - params.push(("accountId", self._account_id.to_string())); - if let Some(value) = self._title_level_eidr { - params.push(("titleLevelEidr", value.to_string())); - } - if self._studio_names.len() > 0 { - for f in self._studio_names.iter() { - params.push(("studioNames", f.to_string())); - } - } - if self._status.len() > 0 { - for f in self._status.iter() { - params.push(("status", f.to_string())); - } - } - if let Some(value) = self._presentation_id { - params.push(("presentationId", value.to_string())); - } - if self._pph_names.len() > 0 { - for f in self._pph_names.iter() { - params.push(("pphNames", f.to_string())); - } - } - if let Some(value) = self._playable_sequence_id { - params.push(("playableSequenceId", 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._inventory_id { - params.push(("inventoryId", value.to_string())); - } - if let Some(value) = self._filename { - params.push(("filename", value.to_string())); - } - if let Some(value) = self._el_id { - params.push(("elId", value.to_string())); - } - if let Some(value) = self._edit_level_eidr { - params.push(("editLevelEidr", value.to_string())); - } - if let Some(value) = self._custom_id { - params.push(("customId", value.to_string())); - } - if let Some(value) = self._alt_cut_id { - params.push(("altCutId", value.to_string())); - } - for &field in ["alt", "accountId", "titleLevelEidr", "studioNames", "status", "presentationId", "pphNames", "playableSequenceId", "pageToken", "pageSize", "inventoryId", "filename", "elId", "editLevelEidr", "customId", "altCutId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/components"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{accountId}", "accountId")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["accountId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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. See _General rules_ for more information about this field. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// Filter Components that match a given title-level EIDR. - /// - /// Sets the *title level eidr* query property to the given value. - pub fn title_level_eidr(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._title_level_eidr = Some(new_value.to_string()); - self - } - /// See _List methods rules_ for info about this field. - /// - /// Append the given value to the *studio names* query property. - /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. - pub fn add_studio_names(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._studio_names.push(new_value.to_string()); - self - } - /// Filter Components that match one of the given status. - /// - /// Append the given value to the *status* query property. - /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. - pub fn add_status(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._status.push(new_value.to_string()); - self - } - /// PresentationID available in Common Manifest. - /// - /// Sets the *presentation id* query property to the given value. - pub fn presentation_id(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._presentation_id = Some(new_value.to_string()); - self - } - /// See _List methods rules_ for info about this field. - /// - /// Append the given value to the *pph names* query property. - /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters. - pub fn add_pph_names(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._pph_names.push(new_value.to_string()); - self - } - /// PlayableSequenceID available in Common Manifest. - /// - /// Sets the *playable sequence id* query property to the given value. - pub fn playable_sequence_id(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._playable_sequence_id = Some(new_value.to_string()); - self - } - /// See _List methods rules_ for info about this field. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// See _List methods rules_ for info about this field. - /// - /// Sets the *page size* query property to the given value. - pub fn page_size(mut self, new_value: i32) -> AccountComponentListCall<'a, C, A> { - self._page_size = Some(new_value); - self - } - /// InventoryID available in Common Manifest. - /// - /// Sets the *inventory id* query property to the given value. - pub fn inventory_id(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._inventory_id = Some(new_value.to_string()); - self - } - /// Filter Components that match a case-insensitive substring of the physical name of the delivered file. - /// - /// Sets the *filename* query property to the given value. - pub fn filename(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._filename = Some(new_value.to_string()); - self - } - /// Experience ID, as defined by Google. - /// - /// Sets the *el id* query property to the given value. - pub fn el_id(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._el_id = Some(new_value.to_string()); - self - } - /// Filter Components that match a given edit-level EIDR. - /// - /// Sets the *edit level eidr* query property to the given value. - pub fn edit_level_eidr(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._edit_level_eidr = Some(new_value.to_string()); - self - } - /// Filter Components that match a case-insensitive partner-specific custom id. - /// - /// Sets the *custom id* query property to the given value. - pub fn custom_id(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._custom_id = Some(new_value.to_string()); - self - } - /// Filter Components that match a case-insensitive, partner-specific Alternative Cut ID. - /// - /// Sets the *alt cut id* query property to the given value. - pub fn alt_cut_id(mut self, new_value: &str) -> AccountComponentListCall<'a, C, A> { - self._alt_cut_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) -> AccountComponentListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> AccountComponentListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::PlaymovyPartnerReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccountComponentListCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Get a Component given its id. -/// -/// A builder for the *components.type.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 yup_oauth2 as oauth2; -/// # extern crate google_playmoviespartner1 as playmoviespartner1; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use playmoviespartner1::PlayMovies; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = PlayMovies::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.accounts().components_type_get("accountId", "componentId", "type") -/// .doit(); -/// # } -/// ``` -pub struct AccountComponentTypeGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a PlayMovies, - _account_id: String, - _component_id: String, - _type_: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for AccountComponentTypeGetCall<'a, C, A> {} - -impl<'a, C, A> AccountComponentTypeGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Component)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "playmoviespartner.accounts.components.type.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("accountId", self._account_id.to_string())); - params.push(("componentId", self._component_id.to_string())); - params.push(("type", self._type_.to_string())); - for &field in ["alt", "accountId", "componentId", "type"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1/accounts/{accountId}/components/{componentId}/type/{type}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::PlaymovyPartnerReadonly.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{accountId}", "accountId"), ("{componentId}", "componentId"), ("{type}", "type")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["type", "componentId", "accountId"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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. See _General rules_ for more information about this field. - /// - /// Sets the *account id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn account_id(mut self, new_value: &str) -> AccountComponentTypeGetCall<'a, C, A> { - self._account_id = new_value.to_string(); - self - } - /// REQUIRED. Component ID. - /// - /// Sets the *component id* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn component_id(mut self, new_value: &str) -> AccountComponentTypeGetCall<'a, C, A> { - self._component_id = new_value.to_string(); - self - } - /// REQUIRED. Component Type. - /// - /// Sets the *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 type_(mut self, new_value: &str) -> AccountComponentTypeGetCall<'a, C, A> { - self._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) -> AccountComponentTypeGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> AccountComponentTypeGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::PlaymovyPartnerReadonly`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> AccountComponentTypeGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - diff --git a/gen/plus1-cli/Cargo.toml b/gen/plus1-cli/Cargo.toml index b4044dd8b3..3b25616af2 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.4+20161214" +version = "1.0.4+20170410" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-plus1] path = "../plus1" -version = "1.0.4+20161214" +version = "1.0.4+20170410" diff --git a/gen/plus1-cli/README.md b/gen/plus1-cli/README.md index 25782c391b..ea4521b15e 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 *20161214*. The CLI is at version *1.0.4*. +This documentation was generated from the *plus* API at revision *20170410*. The CLI is at version *1.0.4*. ```bash plus1 [options] diff --git a/gen/plus1-cli/mkdocs.yml b/gen/plus1-cli/mkdocs.yml index e45110dc0a..458ea6ecbd 100644 --- a/gen/plus1-cli/mkdocs.yml +++ b/gen/plus1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plus v1.0.4+20161214 +site_name: plus v1.0.4+20170410 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 d71c8a7d6b..b03ec87c52 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.4+20161214") + .version("1.0.4+20170410") .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 8a258c9fa0..e668296e76 100644 --- a/gen/plus1/Cargo.toml +++ b/gen/plus1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-plus1" -version = "1.0.4+20161214" +version = "1.0.4+20170410" 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.4+20161214" +documentation = "https://docs.rs/google-plus1/1.0.4+20170410" license = "MIT" keywords = ["plus", "google", "protocol", "web", "api"] diff --git a/gen/plus1/README.md b/gen/plus1/README.md index 00b2042454..f342928c27 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.4+20161214*, where *20161214* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *plus* crate version *1.0.4+20170410*, where *20170410* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161214/google_plus1/struct.Plus.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.Plus.html) ... -* [activities](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.Activity.html) - * [*get*](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.ActivityGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.ActivityListCall.html) and [*search*](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.ActivitySearchCall.html) -* [comments](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.Comment.html) - * [*get*](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.CommentGetCall.html) and [*list*](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.CommentListCall.html) +* [activities](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.Activity.html) + * [*get*](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.ActivityGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.ActivityListCall.html) and [*search*](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.ActivitySearchCall.html) +* [comments](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.Comment.html) + * [*get*](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.CommentGetCall.html) and [*list*](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.CommentListCall.html) * people - * [*get*](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.PeopleListByActivityCall.html) and [*search*](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/struct.PeopleSearchCall.html) + * [*get*](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/struct.PeopleListByActivityCall.html) and [*search*](https://docs.rs/google-plus1/1.0.4+20170410/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.4+20161214/google_plus1/struct.Plus.html)** +* **[Hub](https://docs.rs/google-plus1/1.0.4+20170410/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.4+20161214/google_plus1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-plus1/1.0.4+20170410/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.4+20161214/google_plus1/trait.Part.html)** + * **[Parts](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-plus1/1.0.4+20161214/google_plus1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-plus1/1.0.4+20170410/google_plus1/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-plus1/1.0.4+20161214/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.4+20170410/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.4+20161214/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.4+20170410/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.4+20161214/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.4+20170410/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.4+20161214/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.4+20170410/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")`. @@ -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-plus1/1.0.4+20161214/google_plus1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-plus1/1.0.4+20161214/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.4+20170410/google_plus1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-plus1/1.0.4+20170410/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.4+20161214/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.4+20170410/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.4+20161214/google_plus1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-plus1/1.0.4+20161214/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.4+20170410/google_plus1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-plus1/1.0.4+20170410/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.4+20161214/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.4+20170410/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.4+20161214/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.4+20170410/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.4+20161214/google_plus1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-plus1/1.0.4+20170410/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 d0b6e71cb6..87b4dc8be2 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.4+20161214*, where *20161214* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *plus* crate version *1.0.4+20170410*, where *20170410* is the exact revision of the *plus:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *plus* *v1* API can be found at the //! [official documentation site](https://developers.google.com/+/api/). @@ -179,7 +179,7 @@ // 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 +// 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)] @@ -319,8 +319,6 @@ pub struct Plus { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Plus {} @@ -333,8 +331,6 @@ impl<'a, C, A> Plus client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/plus/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -357,26 +353,6 @@ impl<'a, C, A> Plus self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/plus/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1973,7 +1949,7 @@ impl<'a, C, A> ActivitySearchCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activities"; + let mut url = "https://www.googleapis.com/plus/v1/activities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -2215,7 +2191,7 @@ impl<'a, C, A> ActivityGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activities/{activityId}"; + let mut url = "https://www.googleapis.com/plus/v1/activities/{activityId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -2462,7 +2438,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people/{userId}/activities/{collection}"; + let mut url = "https://www.googleapis.com/plus/v1/people/{userId}/activities/{collection}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -2736,7 +2712,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activities/{activityId}/comments"; + let mut url = "https://www.googleapis.com/plus/v1/activities/{activityId}/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -2992,7 +2968,7 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "comments/{commentId}"; + let mut url = "https://www.googleapis.com/plus/v1/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -3242,7 +3218,7 @@ impl<'a, C, A> PeopleSearchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people"; + let mut url = "https://www.googleapis.com/plus/v1/people".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -3489,7 +3465,7 @@ impl<'a, C, A> PeopleListByActivityCall<'a, C, A> where C: BorrowMut PeopleListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people/{userId}/people/{collection}"; + let mut url = "https://www.googleapis.com/plus/v1/people/{userId}/people/{collection}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -4031,7 +4007,7 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people/{userId}"; + let mut url = "https://www.googleapis.com/plus/v1/people/{userId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Login.as_ref().to_string(), ()); } @@ -4196,3 +4172,4 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau } + diff --git a/gen/plusdomains1-cli/Cargo.toml b/gen/plusdomains1-cli/Cargo.toml index a035850ef5..b2f9cb23e0 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.4+20161214" +version = "1.0.4+20170410" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-plusdomains1] path = "../plusdomains1" -version = "1.0.4+20161214" +version = "1.0.4+20170410" diff --git a/gen/plusdomains1-cli/README.md b/gen/plusdomains1-cli/README.md index c61302ee26..206c2e359b 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 *20161214*. The CLI is at version *1.0.4*. +This documentation was generated from the *plusDomains* API at revision *20170410*. The CLI is at version *1.0.4*. ```bash plusdomains1 [options] diff --git a/gen/plusdomains1-cli/mkdocs.yml b/gen/plusdomains1-cli/mkdocs.yml index 547edee2f3..a60d236e8b 100644 --- a/gen/plusdomains1-cli/mkdocs.yml +++ b/gen/plusdomains1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: plusDomains v1.0.4+20161214 +site_name: plusDomains v1.0.4+20170410 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 579bc6c6b9..52f8c1b4ed 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.4+20161214") + .version("1.0.4+20170410") .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 af3466025c..7ad44fbea4 100644 --- a/gen/plusdomains1/Cargo.toml +++ b/gen/plusdomains1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-plusdomains1" -version = "1.0.4+20161214" +version = "1.0.4+20170410" 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.4+20161214" +documentation = "https://docs.rs/google-plusdomains1/1.0.4+20170410" license = "MIT" keywords = ["plusDomains", "google", "protocol", "web", "api"] diff --git a/gen/plusdomains1/README.md b/gen/plusdomains1/README.md index 7559cd9ba6..aeac0944a1 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.4+20161214*, where *20161214* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *plusDomains* crate version *1.0.4+20170410*, where *20170410* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161214/google_plusdomains1/struct.PlusDomains.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.PlusDomains.html) ... -* [activities](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.Activity.html) - * [*get*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.ActivityGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.ActivityListCall.html) -* [audiences](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.Audience.html) - * [*list*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.AudienceListCall.html) -* [circles](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.Circle.html) - * [*add people*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CircleAddPeopleCall.html), [*get*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CircleGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CircleInsertCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CircleListCall.html), [*patch*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CirclePatchCall.html), [*remove*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CircleRemoveCall.html), [*remove people*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CircleRemovePeopleCall.html) and [*update*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CircleUpdateCall.html) -* [comments](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.Comment.html) - * [*get*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CommentInsertCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.CommentListCall.html) -* [media](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.Media.html) - * [*insert*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.MediaInsertCall.html) +* [activities](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.Activity.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.ActivityGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.ActivityListCall.html) +* [audiences](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.Audience.html) + * [*list*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.AudienceListCall.html) +* [circles](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.Circle.html) + * [*add people*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CircleAddPeopleCall.html), [*get*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CircleGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CircleInsertCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CircleListCall.html), [*patch*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CirclePatchCall.html), [*remove*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CircleRemoveCall.html), [*remove people*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CircleRemovePeopleCall.html) and [*update*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CircleUpdateCall.html) +* [comments](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.Comment.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CommentGetCall.html), [*insert*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CommentInsertCall.html) and [*list*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.CommentListCall.html) +* [media](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.Media.html) + * [*insert*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.MediaInsertCall.html) * people - * [*get*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.PeopleListByActivityCall.html) and [*list by circle*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.PeopleListByCircleCall.html) + * [*get*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.PeopleGetCall.html), [*list*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.PeopleListCall.html), [*list by activity*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.PeopleListByActivityCall.html) and [*list by circle*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/struct.PeopleListByCircleCall.html) Upload supported by ... -* [*insert media*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/struct.MediaInsertCall.html) +* [*insert media*](https://docs.rs/google-plusdomains1/1.0.4+20170410/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.4+20161214/google_plusdomains1/struct.PlusDomains.html)** +* **[Hub](https://docs.rs/google-plusdomains1/1.0.4+20170410/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.4+20161214/google_plusdomains1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-plusdomains1/1.0.4+20170410/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.4+20161214/google_plusdomains1/trait.Part.html)** + * **[Parts](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-plusdomains1/1.0.4+20161214/google_plusdomains1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-plusdomains1/1.0.4+20170410/google_plusdomains1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -138,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-plusdomains1/1.0.4+20161214/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.4+20170410/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.4+20161214/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.4+20170410/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.4+20161214/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.4+20170410/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.4+20161214/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.4+20170410/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")`. @@ -158,29 +158,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.4+20161214/google_plusdomains1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-plusdomains1/1.0.4+20161214/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.4+20170410/google_plusdomains1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-plusdomains1/1.0.4+20170410/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.4+20161214/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.4+20170410/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.4+20161214/google_plusdomains1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-plusdomains1/1.0.4+20161214/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.4+20170410/google_plusdomains1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-plusdomains1/1.0.4+20170410/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.4+20161214/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.4+20170410/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.4+20161214/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.4+20170410/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.4+20161214/google_plusdomains1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-plusdomains1/1.0.4+20170410/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 8aa3b58ee9..363e306112 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.4+20161214*, where *20161214* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *plusDomains* crate version *1.0.4+20170410*, where *20170410* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *plusDomains* *v1* API can be found at the //! [official documentation site](https://developers.google.com/+/domains/). @@ -193,7 +193,7 @@ // 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 +// 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)] @@ -356,8 +356,6 @@ pub struct PlusDomains { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for PlusDomains {} @@ -370,8 +368,6 @@ impl<'a, C, A> PlusDomains client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/plusDomains/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -403,26 +399,6 @@ impl<'a, C, A> PlusDomains self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/plusDomains/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -2651,7 +2627,7 @@ impl<'a, C, A> CircleRemovePeopleCall<'a, C, A> where C: BorrowMut CircleInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people/{userId}/circles"; + let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/circles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleWrite.as_ref().to_string(), ()); } @@ -3172,7 +3148,7 @@ impl<'a, C, A> CircleAddPeopleCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "circles/{circleId}/people"; + let mut url = "https://www.googleapis.com/plusDomains/v1/circles/{circleId}/people".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleWrite.as_ref().to_string(), ()); } @@ -3423,7 +3399,7 @@ impl<'a, C, A> CircleGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "circles/{circleId}"; + let mut url = "https://www.googleapis.com/plusDomains/v1/circles/{circleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleRead.as_ref().to_string(), ()); } @@ -3668,7 +3644,7 @@ impl<'a, C, A> CircleListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people/{userId}/circles"; + let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/circles".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleRead.as_ref().to_string(), ()); } @@ -3924,7 +3900,7 @@ impl<'a, C, A> CircleUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "circles/{circleId}"; + let mut url = "https://www.googleapis.com/plusDomains/v1/circles/{circleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleWrite.as_ref().to_string(), ()); } @@ -4190,7 +4166,7 @@ impl<'a, C, A> CirclePatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "circles/{circleId}"; + let mut url = "https://www.googleapis.com/plusDomains/v1/circles/{circleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleWrite.as_ref().to_string(), ()); } @@ -4448,7 +4424,7 @@ impl<'a, C, A> CircleRemoveCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "circles/{circleId}"; + let mut url = "https://www.googleapis.com/plusDomains/v1/circles/{circleId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleWrite.as_ref().to_string(), ()); } @@ -4685,7 +4661,7 @@ impl<'a, C, A> ActivityInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people/{userId}/activities"; + let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/activities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -4951,7 +4927,7 @@ impl<'a, C, A> ActivityGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activities/{activityId}"; + let mut url = "https://www.googleapis.com/plusDomains/v1/activities/{activityId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -5198,7 +5174,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people/{userId}/activities/{collection}"; + let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/activities/{collection}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -5467,7 +5443,7 @@ impl<'a, C, A> PeopleListByCircleCall<'a, C, A> where C: BorrowMut PeopleListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people/{userId}/people/{collection}"; + let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/people/{collection}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleRead.as_ref().to_string(), ()); } @@ -5999,7 +5975,7 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people/{userId}"; + let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -6246,7 +6222,7 @@ impl<'a, C, A> PeopleListByActivityCall<'a, C, A> where C: BorrowMut MediaInsertCall<'a, C, A> where C: BorrowMut, A: o let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/plusDomains/v1/people/{userId}/media/{collection}", "multipart") + ("https://www.googleapis.com/upload/plusDomains/v1/people/{userId}/media/{collection}".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/plusDomains/v1/people/{userId}/media/{collection}", "resumable") + ("https://www.googleapis.com/resumable/upload/plusDomains/v1/people/{userId}/media/{collection}".to_string(), "resumable") } else { unreachable!() }; @@ -6899,7 +6875,7 @@ impl<'a, C, A> CommentInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activities/{activityId}/comments"; + let mut url = "https://www.googleapis.com/plusDomains/v1/activities/{activityId}/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -7173,7 +7149,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activities/{activityId}/comments"; + let mut url = "https://www.googleapis.com/plusDomains/v1/activities/{activityId}/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -7429,7 +7405,7 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "comments/{commentId}"; + let mut url = "https://www.googleapis.com/plusDomains/v1/comments/{commentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluLogin.as_ref().to_string(), ()); } @@ -7674,7 +7650,7 @@ impl<'a, C, A> AudienceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "people/{userId}/audiences"; + let mut url = "https://www.googleapis.com/plusDomains/v1/people/{userId}/audiences".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::PluCircleRead.as_ref().to_string(), ()); } @@ -7853,3 +7829,4 @@ impl<'a, C, A> AudienceListCall<'a, C, A> where C: BorrowMut, A: } + diff --git a/gen/prediction1d6-cli/Cargo.toml b/gen/prediction1d6-cli/Cargo.toml index 221734df74..2f76f93460 100644 --- a/gen/prediction1d6-cli/Cargo.toml +++ b/gen/prediction1d6-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/prediction1d6/src/lib.rs b/gen/prediction1d6/src/lib.rs index 6859cd5c9f..9c37164ef4 100644 --- a/gen/prediction1d6/src/lib.rs +++ b/gen/prediction1d6/src/lib.rs @@ -180,7 +180,7 @@ // 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 +// 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)] @@ -327,8 +327,6 @@ pub struct Prediction { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Prediction {} @@ -341,8 +339,6 @@ impl<'a, C, A> Prediction client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/prediction/v1.6/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -362,26 +358,6 @@ impl<'a, C, A> Prediction self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/prediction/v1.6/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1176,7 +1152,7 @@ impl<'a, C, A> TrainedmodelGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/trainedmodels/{id}"; + let mut url = "https://www.googleapis.com/prediction/v1.6/projects/{project}/trainedmodels/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1430,7 +1406,7 @@ impl<'a, C, A> TrainedmodelUpdateCall<'a, C, A> where C: BorrowMut TrainedmodelListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/trainedmodels/list"; + let mut url = "https://www.googleapis.com/prediction/v1.6/projects/{project}/trainedmodels/list".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1959,7 +1935,7 @@ impl<'a, C, A> TrainedmodelDeleteCall<'a, C, A> where C: BorrowMut TrainedmodelInsertCall<'a, C, A> where C: BorrowMut TrainedmodelAnalyzeCall<'a, C, A> where C: BorrowMut TrainedmodelPredictCall<'a, C, A> where C: BorrowMut HostedmodelPredictCall<'a, C, A> where C: BorrowMut HostedmodelPredictCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with proximitybeacon (protocol v1beta1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/proximitybeacon1_beta1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-proximitybeacon1_beta1] path = "../proximitybeacon1_beta1" -version = "1.0.4+20160429" +version = "1.0.4+20170517" diff --git a/gen/proximitybeacon1_beta1-cli/README.md b/gen/proximitybeacon1_beta1-cli/README.md index a9e1bf95f7..b7b8e5a06a 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 *20160429*. The CLI is at version *1.0.4*. +This documentation was generated from the *proximitybeacon* API at revision *20170517*. The CLI is at version *1.0.4*. ```bash proximitybeacon1-beta1 [options] @@ -39,6 +39,7 @@ proximitybeacon1-beta1 [options] attachments-list [-p ]... [-o ] deactivate [-p ]... [-o ] decommission [-p ]... [-o ] + delete [-p ]... [-o ] diagnostics-list [-p ]... [-o ] get [-p ]... [-o ] list [-p ]... [-o ] diff --git a/gen/proximitybeacon1_beta1-cli/mkdocs.yml b/gen/proximitybeacon1_beta1-cli/mkdocs.yml index eef03ff658..00286ade6c 100644 --- a/gen/proximitybeacon1_beta1-cli/mkdocs.yml +++ b/gen/proximitybeacon1_beta1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: proximitybeacon v1.0.4+20160429 +site_name: proximitybeacon v1.0.4+20170517 site_url: http://byron.github.io/google-apis-rs/google-proximitybeacon1_beta1-cli site_description: A complete library to interact with proximitybeacon (protocol v1beta1) @@ -17,6 +17,7 @@ pages: - ['beacons_attachments-list.md', 'Beacons', 'Attachments List'] - ['beacons_deactivate.md', 'Beacons', 'Deactivate'] - ['beacons_decommission.md', 'Beacons', 'Decommission'] +- ['beacons_delete.md', 'Beacons', 'Delete'] - ['beacons_diagnostics-list.md', 'Beacons', 'Diagnostics List'] - ['beacons_get.md', 'Beacons', 'Get'] - ['beacons_list.md', 'Beacons', 'List'] diff --git a/gen/proximitybeacon1_beta1-cli/src/main.rs b/gen/proximitybeacon1_beta1-cli/src/main.rs index cce77ec1fc..929d5c5747 100644 --- a/gen/proximitybeacon1_beta1-cli/src/main.rs +++ b/gen/proximitybeacon1_beta1-cli/src/main.rs @@ -267,10 +267,11 @@ 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 })), "attachment-name" => Some(("attachmentName", 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", "data", "namespaced-type"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["attachment-name", "creation-time-ms", "data", "namespaced-type"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -561,6 +562,62 @@ impl<'n> Engine<'n> { } } + fn _beacons_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.beacons().delete(opt.value_of("beacon-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 { + "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 _beacons_diagnostics_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.beacons().diagnostics_list(opt.value_of("beacon-name").unwrap_or("")); @@ -1196,6 +1253,9 @@ impl<'n> Engine<'n> { ("decommission", Some(opt)) => { call_result = self._beacons_decommission(opt, dry_run, &mut err); }, + ("delete", Some(opt)) => { + call_result = self._beacons_delete(opt, dry_run, &mut err); + }, ("diagnostics-list", Some(opt)) => { call_result = self._beacons_diagnostics_list(opt, dry_run, &mut err); }, @@ -1330,7 +1390,10 @@ fn main() { let arg_data = [ ("beaconinfo", "methods: 'getforobserved'", vec![ ("getforobserved", - Some(r##"Given one or more beacon observations, returns any beacon information and attachments accessible to your application. Authorize by using the [API key](https://developers.google.com/beacons/proximity/how-tos/authorizing#APIKey) for the application."##), + Some(r##"Given one or more beacon observations, returns any beacon information + and attachments accessible to your application. Authorize by using the + [API key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key) + for the application."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beaconinfo_getforobserved", vec![ (Some(r##"kv"##), @@ -1353,14 +1416,27 @@ fn main() { ]), ]), - ("beacons", "methods: 'activate', 'attachments-batch-delete', 'attachments-create', 'attachments-delete', 'attachments-list', 'deactivate', 'decommission', 'diagnostics-list', 'get', 'list', 'register' and 'update'", vec![ + ("beacons", "methods: 'activate', 'attachments-batch-delete', 'attachments-create', 'attachments-delete', 'attachments-list', 'deactivate', 'decommission', 'delete', 'diagnostics-list', 'get', 'list', 'register' and 'update'", vec![ ("activate", - Some(r##"Activates a beacon. A beacon that is active will return information and attachment data when queried via `beaconinfo.getforobserved`. Calling this method on an already active beacon will do nothing (but will return a successful response code). Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Activates a beacon. A beacon that is active will return information + and attachment data when queried via `beaconinfo.getforobserved`. + Calling this method on an already active beacon will do nothing (but + will return a successful response code). + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **Is owner** or **Can edit** permissions in the + Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_activate", vec![ (Some(r##"beacon-name"##), None, - Some(r##"Beacon that should be activated. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required."##), + Some(r##"Beacon that should be activated. A beacon name has the format + "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + the beacon and N is a code for the beacon's type. Possible values are + `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + for AltBeacon. For Eddystone-EID beacons, you may use either the + current EID or the beacon's "stable" UID. + Required."##), Some(true), Some(false)), @@ -1377,12 +1453,28 @@ fn main() { Some(false)), ]), ("attachments-batch-delete", - Some(r##"Deletes multiple attachments on a given beacon. This operation is permanent and cannot be undone. You can optionally specify `namespacedType` to choose which attachments should be deleted. If you do not specify `namespacedType`, all your attachments on the given beacon will be deleted. You also may explicitly specify `*/*` to delete all. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Deletes multiple attachments on a given beacon. This operation is + permanent and cannot be undone. + + You can optionally specify `namespacedType` to choose which attachments + should be deleted. If you do not specify `namespacedType`, all your + attachments on the given beacon will be deleted. You also may explicitly + specify `*/*` to delete all. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **Is owner** or **Can edit** permissions in the + Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_attachments-batch-delete", vec![ (Some(r##"beacon-name"##), None, - Some(r##"The beacon whose attachments should be deleted. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required."##), + Some(r##"The beacon whose attachments should be deleted. A beacon name has the + format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast + by the beacon and N is a code for the beacon's type. Possible values are + `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + for AltBeacon. For Eddystone-EID beacons, you may use either the + current EID or the beacon's "stable" UID. + Required."##), Some(true), Some(false)), @@ -1399,14 +1491,33 @@ fn main() { Some(false)), ]), ("attachments-create", - Some(r##"Associates the given data with the specified beacon. Attachment data must contain two parts: - - A namespaced type. - - The actual attachment data itself. The namespaced type consists of two parts, the namespace and the type. The namespace must be one of the values returned by the `namespaces` endpoint, while the type can be a string of any characters except for the forward slash (`/`) up to 100 characters in length. Attachment data can be up to 1024 bytes long. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Associates the given data with the specified beacon. Attachment data must + contain two parts: +
    +
  • A namespaced type.
  • +
  • The actual attachment data itself.
  • +
+ The namespaced type consists of two parts, the namespace and the type. + The namespace must be one of the values returned by the `namespaces` + endpoint, while the type can be a string of any characters except for the + forward slash (`/`) up to 100 characters in length. + + Attachment data can be up to 1024 bytes long. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **Is owner** or **Can edit** permissions in the + Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_attachments-create", vec![ (Some(r##"beacon-name"##), None, - Some(r##"Beacon on which the attachment should be created. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required."##), + Some(r##"Beacon on which the attachment should be created. A beacon name has the + format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast + by the beacon and N is a code for the beacon's type. Possible values are + `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + for AltBeacon. For Eddystone-EID beacons, you may use either the + current EID or the beacon's "stable" UID. + Required."##), Some(true), Some(false)), @@ -1429,12 +1540,25 @@ fn main() { Some(false)), ]), ("attachments-delete", - Some(r##"Deletes the specified attachment for the given beacon. Each attachment has a unique attachment name (`attachmentName`) which is returned when you fetch the attachment data via this API. You specify this with the delete request to control which attachment is removed. This operation cannot be undone. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Deletes the specified attachment for the given beacon. Each attachment has + a unique attachment name (`attachmentName`) which is returned when you + fetch the attachment data via this API. You specify this with the delete + request to control which attachment is removed. This operation cannot be + undone. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **Is owner** or **Can edit** permissions in the + Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_attachments-delete", vec![ (Some(r##"attachment-name"##), None, - Some(r##"The attachment name (`attachmentName`) of the attachment to remove. For example: `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For Eddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the beacon's current EID, or its "stable" Eddystone-UID. Required."##), + Some(r##"The attachment name (`attachmentName`) of + the attachment to remove. For example: + `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For + Eddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the + beacon's current EID, or its "stable" Eddystone-UID. + Required."##), Some(true), Some(false)), @@ -1451,12 +1575,28 @@ fn main() { Some(false)), ]), ("attachments-list", - Some(r##"Returns the attachments for the specified beacon that match the specified namespaced-type pattern. To control which namespaced types are returned, you add the `namespacedType` query parameter to the request. You must either use `*/*`, to return all attachments, or the namespace must be one of the ones returned from the `namespaces` endpoint. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Returns the attachments for the specified beacon that match the specified + namespaced-type pattern. + + To control which namespaced types are returned, you add the + `namespacedType` query parameter to the request. You must either use + `*/*`, to return all attachments, or the namespace must be one of + the ones returned from the `namespaces` endpoint. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **viewer**, **Is owner** or **Can edit** + permissions in the Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_attachments-list", vec![ (Some(r##"beacon-name"##), None, - Some(r##"Beacon whose attachments should be fetched. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required."##), + Some(r##"Beacon whose attachments should be fetched. A beacon name has the + format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast + by the beacon and N is a code for the beacon's type. Possible values are + `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + for AltBeacon. For Eddystone-EID beacons, you may use either the + current EID or the beacon's "stable" UID. + Required."##), Some(true), Some(false)), @@ -1473,12 +1613,25 @@ fn main() { Some(false)), ]), ("deactivate", - Some(r##"Deactivates a beacon. Once deactivated, the API will not return information nor attachment data for the beacon when queried via `beaconinfo.getforobserved`. Calling this method on an already inactive beacon will do nothing (but will return a successful response code). Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Deactivates a beacon. Once deactivated, the API will not return + information nor attachment data for the beacon when queried via + `beaconinfo.getforobserved`. Calling this method on an already inactive + beacon will do nothing (but will return a successful response code). + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **Is owner** or **Can edit** permissions in the + Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_deactivate", vec![ (Some(r##"beacon-name"##), None, - Some(r##"Beacon that should be deactivated. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required."##), + Some(r##"Beacon that should be deactivated. A beacon name has the format + "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + the beacon and N is a code for the beacon's type. Possible values are + `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + for AltBeacon. For Eddystone-EID beacons, you may use either the + current EID or the beacon's "stable" UID. + Required."##), Some(true), Some(false)), @@ -1495,12 +1648,59 @@ fn main() { Some(false)), ]), ("decommission", - Some(r##"Decommissions the specified beacon in the service. This beacon will no longer be returned from `beaconinfo.getforobserved`. This operation is permanent -- you will not be able to re-register a beacon with this ID again. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Decommissions the specified beacon in the service. This beacon will no + longer be returned from `beaconinfo.getforobserved`. This operation is + permanent -- you will not be able to re-register a beacon with this ID + again. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **Is owner** or **Can edit** permissions in the + Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_decommission", vec![ (Some(r##"beacon-name"##), None, - Some(r##"Beacon that should be decommissioned. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID of the beacon's "stable" UID. Required."##), + Some(r##"Beacon that should be decommissioned. A beacon name has the format + "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + the beacon and N is a code for the beacon's type. Possible values are + `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + for AltBeacon. For Eddystone-EID beacons, you may use either the + current EID of the beacon's "stable" UID. + Required."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("delete", + Some(r##"Deletes the specified beacon including all diagnostics data for the beacon + as well as any attachments on the beacon (including those belonging to + other projects). This operation cannot be undone. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **Is owner** or **Can edit** permissions in the + Google Developers Console project."##), + "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_delete", + vec![ + (Some(r##"beacon-name"##), + None, + Some(r##"Beacon that should be deleted. A beacon name has the format + "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + the beacon and N is a code for the beacon's type. Possible values are + `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + for AltBeacon. For Eddystone-EID beacons, you may use either the + current EID or the beacon's "stable" UID. + Required."##), Some(true), Some(false)), @@ -1517,7 +1717,13 @@ fn main() { Some(false)), ]), ("diagnostics-list", - Some(r##"List the diagnostics for a single beacon. You can also list diagnostics for all the beacons owned by your Google Developers Console project by using the beacon name `beacons/-`. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"List the diagnostics for a single beacon. You can also list diagnostics for + all the beacons owned by your Google Developers Console project by using + the beacon name `beacons/-`. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **viewer**, **Is owner** or **Can edit** + permissions in the Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_diagnostics-list", vec![ (Some(r##"beacon-name"##), @@ -1539,12 +1745,28 @@ fn main() { Some(false)), ]), ("get", - Some(r##"Returns detailed information about the specified beacon. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project. Requests may supply an Eddystone-EID beacon name in the form: `beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID broadcast by the beacon. The returned `Beacon` object will contain the beacon's stable Eddystone-UID. Clients not authorized to resolve the beacon's ephemeral Eddystone-EID broadcast will receive an error."##), + Some(r##"Returns detailed information about the specified beacon. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **viewer**, **Is owner** or **Can edit** + permissions in the Google Developers Console project. + + Requests may supply an Eddystone-EID beacon name in the form: + `beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID + broadcast by the beacon. The returned `Beacon` object will contain the + beacon's stable Eddystone-UID. Clients not authorized to resolve the + beacon's ephemeral Eddystone-EID broadcast will receive an error."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_get", vec![ (Some(r##"beacon-name"##), None, - Some(r##"Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required."##), + Some(r##"Resource name of this beacon. A beacon name has the format + "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + the beacon and N is a code for the beacon's type. Possible values are + `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + for AltBeacon. For Eddystone-EID beacons, you may use either the + current EID or the beacon's "stable" UID. + Required."##), Some(true), Some(false)), @@ -1561,7 +1783,13 @@ fn main() { Some(false)), ]), ("list", - Some(r##"Searches the beacon registry for beacons that match the given search criteria. Only those beacons that the client has permission to list will be returned. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Searches the beacon registry for beacons that match the given search + criteria. Only those beacons that the client has permission to list + will be returned. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **viewer**, **Is owner** or **Can edit** + permissions in the Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_list", vec![ (Some(r##"v"##), @@ -1577,7 +1805,12 @@ fn main() { Some(false)), ]), ("register", - Some(r##"Registers a previously unregistered beacon given its `advertisedId`. These IDs are unique within the system. An ID can be registered only once. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Registers a previously unregistered beacon given its `advertisedId`. + These IDs are unique within the system. An ID can be registered only once. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **Is owner** or **Can edit** permissions in the + Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_register", vec![ (Some(r##"kv"##), @@ -1599,12 +1832,28 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates the information about the specified beacon. **Any field that you do not populate in the submitted beacon will be permanently erased**, so you should follow the "read, modify, write" pattern to avoid inadvertently destroying data. Changes to the beacon status via this method will be silently ignored. To update beacon status, use the separate methods on this API for activation, deactivation, and decommissioning. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Updates the information about the specified beacon. **Any field that you do + not populate in the submitted beacon will be permanently erased**, so you + should follow the "read, modify, write" pattern to avoid inadvertently + destroying data. + + Changes to the beacon status via this method will be silently ignored. + To update beacon status, use the separate methods on this API for + activation, deactivation, and decommissioning. + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **Is owner** or **Can edit** permissions in the + Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/beacons_update", vec![ (Some(r##"beacon-name"##), None, - Some(r##"Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. This field must be left empty when registering. After reading a beacon, clients can use the name for future operations."##), + Some(r##"Resource name of this beacon. A beacon name has the format + "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + the beacon and N is a code for the beacon's type. Possible values are + `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. + + This field must be left empty when registering. After reading a beacon, + clients can use the name for future operations."##), Some(true), Some(false)), @@ -1630,7 +1879,13 @@ fn main() { ("methods", "methods: 'get-eidparams'", vec![ ("get-eidparams", - Some(r##"Gets the Proximity Beacon API's current public key and associated parameters used to initiate the Diffie-Hellman key exchange required to register a beacon that broadcasts the Eddystone-EID format. This key changes periodically; clients may cache it and re-use the same public key to provision and register multiple beacons. However, clients should be prepared to refresh this key when they encounter an error registering an Eddystone-EID beacon."##), + Some(r##"Gets the Proximity Beacon API's current public key and associated + parameters used to initiate the Diffie-Hellman key exchange required to + register a beacon that broadcasts the Eddystone-EID format. This key + changes periodically; clients may cache it and re-use the same public key + to provision and register multiple beacons. However, clients should be + prepared to refresh this key when they encounter an error registering an + Eddystone-EID beacon."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/methods_get-eidparams", vec![ (Some(r##"v"##), @@ -1649,7 +1904,13 @@ fn main() { ("namespaces", "methods: 'list' and 'update'", vec![ ("list", - Some(r##"Lists all attachment namespaces owned by your Google Developers Console project. Attachment data associated with a beacon must include a namespaced type, and the namespace must be owned by your project. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project."##), + Some(r##"Lists all attachment namespaces owned by your Google Developers Console + project. Attachment data associated with a beacon must include a + namespaced type, and the namespace must be owned by your project. + + Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + from a signed-in user with **viewer**, **Is owner** or **Can edit** + permissions in the Google Developers Console project."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/namespaces_list", vec![ (Some(r##"v"##), @@ -1665,12 +1926,14 @@ fn main() { Some(false)), ]), ("update", - Some(r##"Updates the information about the specified namespace. Only the namespace visibility can be updated."##), + Some(r##"Updates the information about the specified namespace. Only the namespace + visibility can be updated."##), "Details at http://byron.github.io/google-apis-rs/google_proximitybeacon1_beta1_cli/namespaces_update", vec![ (Some(r##"namespace-name"##), None, - Some(r##"Resource name of this namespace. Namespaces names have the format: namespaces/namespace."##), + Some(r##"Resource name of this namespace. Namespaces names have the format: + namespaces/namespace."##), Some(true), Some(false)), @@ -1698,7 +1961,7 @@ fn main() { let mut app = App::new("proximitybeacon1-beta1") .author("Sebastian Thiel ") - .version("1.0.4+20160429") + .version("1.0.4+20170517") .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 a1479cc90d..af137f9ecd 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.4+20160429" +version = "1.0.4+20170517" 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.4+20160429" +documentation = "https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517" license = "MIT" keywords = ["proximitybeacon", "google", "protocol", "web", "api"] diff --git a/gen/proximitybeacon1_beta1/README.md b/gen/proximitybeacon1_beta1/README.md index 658dcc9f52..10b694786f 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.4+20160429*, where *20160429* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *proximitybeacon* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20160429/google_proximitybeacon1_beta1/struct.Proximitybeacon.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.Proximitybeacon.html) ... * beaconinfo - * [*getforobserved*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconinfoGetforobservedCall.html) -* [beacons](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.Beacon.html) - * [*activate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconActivateCall.html), [*attachments batch delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconAttachmentBatchDeleteCall.html), [*attachments create*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconAttachmentCreateCall.html), [*attachments delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconAttachmentDeleteCall.html), [*attachments list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconAttachmentListCall.html), [*deactivate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconDeactivateCall.html), [*decommission*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconDecommissionCall.html), [*diagnostics list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconDiagnosticListCall.html), [*get*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconGetCall.html), [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconListCall.html), [*register*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconRegisterCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.BeaconUpdateCall.html) -* [namespaces](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.Namespace.html) - * [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.NamespaceListCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.NamespaceUpdateCall.html) + * [*getforobserved*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconinfoGetforobservedCall.html) +* [beacons](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.Beacon.html) + * [*activate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconActivateCall.html), [*attachments batch delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconAttachmentBatchDeleteCall.html), [*attachments create*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconAttachmentCreateCall.html), [*attachments delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconAttachmentDeleteCall.html), [*attachments list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconAttachmentListCall.html), [*deactivate*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconDeactivateCall.html), [*decommission*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconDecommissionCall.html), [*delete*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconDeleteCall.html), [*diagnostics list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconDiagnosticListCall.html), [*get*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconGetCall.html), [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconListCall.html), [*register*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconRegisterCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.BeaconUpdateCall.html) +* [namespaces](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.Namespace.html) + * [*list*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.NamespaceListCall.html) and [*update*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/struct.NamespaceUpdateCall.html) Other activities are ... -* [get eidparams](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/struct.MethodGetEidparamCall.html) +* [get eidparams](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/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.4+20160429/google_proximitybeacon1_beta1/struct.Proximitybeacon.html)** +* **[Hub](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/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.4+20160429/google_proximitybeacon1_beta1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/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.4+20160429/google_proximitybeacon1_beta1/trait.Part.html)** + * **[Parts](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/google_proximitybeacon1_beta1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/google_proximitybeacon1_beta1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/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. @@ -64,6 +64,7 @@ let r = hub.beacons().update(...).doit() let r = hub.beacons().attachments_delete(...).doit() let r = hub.beacons().deactivate(...).doit() let r = hub.beacons().register(...).doit() +let r = hub.beacons().delete(...).doit() let r = hub.beacons().diagnostics_list(...).doit() let r = hub.beacons().attachments_batch_delete(...).doit() ``` @@ -137,17 +138,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/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.4+20170517/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.4+20160429/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.4+20170517/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.4+20160429/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.4+20170517/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.4+20160429/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.4+20170517/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")`. @@ -157,29 +158,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.4+20160429/google_proximitybeacon1_beta1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/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.4+20170517/google_proximitybeacon1_beta1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/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.4+20160429/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.4+20170517/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.4+20160429/google_proximitybeacon1_beta1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20160429/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.4+20170517/google_proximitybeacon1_beta1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/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.4+20160429/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.4+20170517/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.4+20160429/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.4+20170517/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.4+20160429/google_proximitybeacon1_beta1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-proximitybeacon1_beta1/1.0.4+20170517/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 a015006bb2..8c2c36744d 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.4+20160429*, where *20160429* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *proximitybeacon* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *proximitybeacon:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *proximitybeacon* *v1_beta1* API can be found at the //! [official documentation site](https://developers.google.com/beacons/proximity/). @@ -14,7 +14,7 @@ //! * beaconinfo //! * [*getforobserved*](struct.BeaconinfoGetforobservedCall.html) //! * [beacons](struct.Beacon.html) -//! * [*activate*](struct.BeaconActivateCall.html), [*attachments batch delete*](struct.BeaconAttachmentBatchDeleteCall.html), [*attachments create*](struct.BeaconAttachmentCreateCall.html), [*attachments delete*](struct.BeaconAttachmentDeleteCall.html), [*attachments list*](struct.BeaconAttachmentListCall.html), [*deactivate*](struct.BeaconDeactivateCall.html), [*decommission*](struct.BeaconDecommissionCall.html), [*diagnostics list*](struct.BeaconDiagnosticListCall.html), [*get*](struct.BeaconGetCall.html), [*list*](struct.BeaconListCall.html), [*register*](struct.BeaconRegisterCall.html) and [*update*](struct.BeaconUpdateCall.html) +//! * [*activate*](struct.BeaconActivateCall.html), [*attachments batch delete*](struct.BeaconAttachmentBatchDeleteCall.html), [*attachments create*](struct.BeaconAttachmentCreateCall.html), [*attachments delete*](struct.BeaconAttachmentDeleteCall.html), [*attachments list*](struct.BeaconAttachmentListCall.html), [*deactivate*](struct.BeaconDeactivateCall.html), [*decommission*](struct.BeaconDecommissionCall.html), [*delete*](struct.BeaconDeleteCall.html), [*diagnostics list*](struct.BeaconDiagnosticListCall.html), [*get*](struct.BeaconGetCall.html), [*list*](struct.BeaconListCall.html), [*register*](struct.BeaconRegisterCall.html) and [*update*](struct.BeaconUpdateCall.html) //! * [namespaces](struct.Namespace.html) //! * [*list*](struct.NamespaceListCall.html) and [*update*](struct.NamespaceUpdateCall.html) //! @@ -64,6 +64,7 @@ //! let r = hub.beacons().attachments_delete(...).doit() //! let r = hub.beacons().deactivate(...).doit() //! let r = hub.beacons().register(...).doit() +//! let r = hub.beacons().delete(...).doit() //! let r = hub.beacons().diagnostics_list(...).doit() //! let r = hub.beacons().attachments_batch_delete(...).doit() //! ``` @@ -192,7 +193,7 @@ // 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 +// 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)] @@ -321,8 +322,6 @@ pub struct Proximitybeacon { client: RefCell, auth: RefCell
, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Proximitybeacon {} @@ -335,8 +334,6 @@ impl<'a, C, A> Proximitybeacon client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://proximitybeacon.googleapis.com/".to_string(), - _root_url: "https://proximitybeacon.googleapis.com/".to_string(), } } @@ -362,26 +359,6 @@ impl<'a, C, A> Proximitybeacon self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://proximitybeacon.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://proximitybeacon.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -399,12 +376,25 @@ 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. + /// 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, - /// 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. + /// The UTC time when this attachment was created, in milliseconds since the + /// UNIX epoch. + #[serde(rename="creationTimeMs")] + pub creation_time_ms: 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, - /// 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 `data`, for use by the client when parsing the `data` field. Required. + /// 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 + /// `data`, for use by the client when parsing the `data` field. + /// Required. #[serde(rename="namespacedType")] pub namespaced_type: Option, } @@ -419,10 +409,17 @@ impl ResponseResult for BeaconAttachment {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Observation { - /// The ID advertised by the beacon the client has encountered. Clients may submit an Eddystone-EID `advertised_id`. If the client is not authorized to resolve the given Eddystone-EID, no data will be returned for that beacon. Required. + /// The ID advertised by the beacon the client has encountered. + /// + /// If the submitted `advertised_id` type is Eddystone-EID, then the client + /// must be authorized to resolve the given beacon. Otherwise no data will be + /// returned for that beacon. + /// Required. #[serde(rename="advertisedId")] pub advertised_id: Option, - /// The array of telemetry bytes received from the beacon. The server is responsible for parsing it. This field may frequently be empty, as with a beacon that transmits telemetry only occasionally. + /// The array of telemetry bytes received from the beacon. The server is + /// responsible for parsing it. This field may frequently be empty, as + /// with a beacon that transmits telemetry only occasionally. pub telemetry: Option, /// Time when the beacon was observed. #[serde(rename="timestampMs")] @@ -432,7 +429,8 @@ pub struct Observation { impl Part for Observation {} -/// Indoor level, a human-readable string as returned by Google Maps APIs, useful to indicate which floor of a building a beacon is located on. +/// Indoor level, a human-readable string as returned by Google Maps APIs, +/// useful to indicate which floor of a building a beacon is located on. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -456,12 +454,14 @@ impl Part for IndoorLevel {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListBeaconsResponse { - /// The beacons that matched the search criteria. - pub beacons: Option>, - /// An opaque pagination token that the client may provide in their next request to retrieve the next page of results. + /// An opaque pagination token that the client may provide in their next + /// request to retrieve the next page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, - /// Estimate of the total number of beacons matched by the query. Higher values may be less accurate. + /// 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, } @@ -469,7 +469,8 @@ pub struct ListBeaconsResponse { impl ResponseResult for ListBeaconsResponse {} -/// Request for beacon and attachment information about beacons that a mobile client has encountered "in the wild". +/// Request for beacon and attachment information about beacons that +/// a mobile client has encountered "in the wild". /// /// # Activities /// @@ -480,9 +481,15 @@ impl ResponseResult for ListBeaconsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GetInfoForObservedBeaconsRequest { - /// The beacons that the client has encountered. At least one must be given. + /// The beacons that the client has encountered. + /// At least one must be given. pub observations: Option>, - /// Specifies what kind of attachments to include in the response. When given, the response will include only attachments of the given types. When empty, no attachments will be returned. Must be in the format namespace/type. Accepts `*` to specify all types in all namespaces. Optional. + /// Specifies what kind of attachments to include in the response. + /// When given, the response will include only attachments of the given types. + /// When empty, no attachments will be returned. Must be in the format + /// namespace/type. Accepts `*` to specify all types in + /// all namespaces owned by the client. + /// Optional. #[serde(rename="namespacedTypes")] pub namespaced_types: Option>, } @@ -490,7 +497,9 @@ pub struct GetInfoForObservedBeaconsRequest { impl RequestValue for GetInfoForObservedBeaconsRequest {} -/// An attachment namespace defines read and write access for all the attachments created under it. Each namespace is globally unique, and owned by one project which is the only project that can create attachments under it. +/// An attachment namespace defines read and write access for all the attachments +/// created under it. Each namespace is globally unique, and owned by one +/// project which is the only project that can create attachments under it. /// /// # Activities /// @@ -502,10 +511,12 @@ impl RequestValue for GetInfoForObservedBeaconsRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Namespace { - /// Resource name of this namespace. Namespaces names have the format: namespaces/namespace. + /// 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`. + /// Specifies what clients may receive attachments under this namespace + /// via `beaconinfo.getforobserved`. #[serde(rename="servingVisibility")] pub serving_visibility: Option, } @@ -515,7 +526,9 @@ impl Resource for Namespace {} impl ResponseResult for Namespace {} -/// A subset of attachment information served via the `beaconinfo.getforobserved` method, used when your users encounter your beacons. +/// A subset of attachment information served via the +/// `beaconinfo.getforobserved` method, used when your users encounter your +/// beacons. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -523,7 +536,9 @@ impl ResponseResult for Namespace {} pub struct AttachmentInfo { /// An opaque data container for client-provided data. pub data: Option, - /// Specifies what kind of attachment this is. Tells a client how to interpret the `data` field. Format is namespace/type, for example scrupulous-wombat-12345/welcome-message + /// Specifies what kind of attachment this is. Tells a client how to + /// interpret the `data` field. Format is namespace/type, for + /// example scrupulous-wombat-12345/welcome-message #[serde(rename="namespacedType")] pub namespaced_type: Option, } @@ -537,142 +552,23 @@ impl Part for AttachmentInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AdvertisedId { - /// Specifies the identifier type. Required. + /// Specifies the identifier type. + /// Required. #[serde(rename="type")] pub type_: Option, - /// The actual beacon identifier, as broadcast by the beacon hardware. Must be [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP requests, and will be so encoded (with padding) in responses. The base64 encoding should be of the binary byte-stream and not any textual (such as hex) representation thereof. Required. + /// The actual beacon identifier, as broadcast by the beacon hardware. Must be + /// [base64](http://tools.ietf.org/html/rfc4648#section-4) encoded in HTTP + /// requests, and will be so encoded (with padding) in responses. The base64 + /// encoding should be of the binary byte-stream and not any textual (such as + /// hex) representation thereof. + /// Required. pub id: Option, } impl Part for AdvertisedId {} -/// Write-only registration parameters for beacons using Eddystone-EID format. Two ways of securely registering an Eddystone-EID beacon with the service are supported: 1. Perform an ECDH key exchange via this API, including a previous call to `GET /v1beta1/eidparams`. In this case the fields `beacon_ecdh_public_key` and `service_ecdh_public_key` should be populated and `beacon_identity_key` should not be populated. This method ensures that only the two parties in the ECDH key exchange can compute the identity key, which becomes a secret between them. 2. Derive or obtain the beacon's identity key via other secure means (perhaps an ECDH key exchange between the beacon and a mobile device or any other secure method), and then submit the resulting identity key to the service. In this case `beacon_identity_key` field should be populated, and neither of `beacon_ecdh_public_key` nor `service_ecdh_public_key` fields should be. The security of this method depends on how securely the parties involved (in particular the bluetooth client) handle the identity key, and obviously on how securely the identity key was generated. See [the Eddystone specification](https://github.com/google/eddystone/tree/master/eddystone-eid) at GitHub. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EphemeralIdRegistration { - /// An initial ephemeral ID calculated using the clock value submitted as `initial_clock_value`, and the secret key generated by the Diffie-Hellman key exchange using `service_ecdh_public_key` and `service_ecdh_public_key`. This initial EID value will be used by the service to confirm that the key exchange process was successful. - #[serde(rename="initialEid")] - pub initial_eid: Option, - /// Indicates the nominal period between each rotation of the beacon's ephemeral ID. "Nominal" because the beacon should randomize the actual interval. See [the spec at github](https://github.com/google/eddystone/tree/master/eddystone-eid) for details. This value corresponds to a power-of-two scaler on the beacon's clock: when the scaler value is K, the beacon will begin broadcasting a new ephemeral ID on average every 2^K seconds. - #[serde(rename="rotationPeriodExponent")] - pub rotation_period_exponent: Option, - /// The beacon's public key used for the Elliptic curve Diffie-Hellman key exchange. When this field is populated, `service_ecdh_public_key` must also be populated, and `beacon_identity_key` must not be. - #[serde(rename="beaconEcdhPublicKey")] - pub beacon_ecdh_public_key: Option, - /// The initial clock value of the beacon. The beacon's clock must have begun counting at this value immediately prior to transmitting this value to the resolving service. Significant delay in transmitting this value to the service risks registration or resolution failures. If a value is not provided, the default is zero. - #[serde(rename="initialClockValue")] - pub initial_clock_value: Option, - /// The service's public key used for the Elliptic curve Diffie-Hellman key exchange. When this field is populated, `beacon_ecdh_public_key` must also be populated, and `beacon_identity_key` must not be. - #[serde(rename="serviceEcdhPublicKey")] - pub service_ecdh_public_key: Option, - /// The private key of the beacon. If this field is populated, `beacon_ecdh_public_key` and `service_ecdh_public_key` must not be populated. - #[serde(rename="beaconIdentityKey")] - pub beacon_identity_key: Option, -} - -impl Part for EphemeralIdRegistration {} - - -/// Diagnostics for a single beacon. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Diagnostics { - /// The date when the battery is expected to be low. If the value is missing then there is no estimate for when the battery will be low. This value is only an estimate, not an exact date. - #[serde(rename="estimatedLowBatteryDate")] - pub estimated_low_battery_date: Option, - /// An unordered list of Alerts that the beacon has. - pub alerts: Option>, - /// Resource name of the beacon. For Eddystone-EID beacons, this may be the beacon's current EID, or the beacon's "stable" Eddystone-UID. - #[serde(rename="beaconName")] - pub beacon_name: Option, -} - -impl Part for Diagnostics {} - - -/// A subset of beacon information served via the `beaconinfo.getforobserved` method, which you call when users of your app encounter your beacons. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BeaconInfo { - /// The ID advertised by the beacon. - #[serde(rename="advertisedId")] - pub advertised_id: Option, - /// Attachments matching the type(s) requested. May be empty if no attachment types were requested, or if none matched. - pub attachments: Option>, - /// The name under which the beacon is registered. - #[serde(rename="beaconName")] - pub beacon_name: Option, -} - -impl Part for BeaconInfo {} - - -/// 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*). -/// -/// * [decommission beacons](struct.BeaconDecommissionCall.html) (response) -/// * [attachments delete beacons](struct.BeaconAttachmentDeleteCall.html) (response) -/// * [deactivate beacons](struct.BeaconDeactivateCall.html) (response) -/// * [activate beacons](struct.BeaconActivateCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Empty { _never_set: Option } - -impl ResponseResult for Empty {} - - -/// Information a client needs to provision and register beacons that broadcast Eddystone-EID format beacon IDs, using Elliptic curve Diffie-Hellman key exchange. See [the Eddystone specification](https://github.com/google/eddystone/tree/master/eddystone-eid) at GitHub. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 eidparams](struct.MethodGetEidparamCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct EphemeralIdRegistrationParams { - /// Indicates the minimum rotation period supported by the service. See EddystoneEidRegistration.rotation_period_exponent - #[serde(rename="minRotationPeriodExponent")] - pub min_rotation_period_exponent: Option, - /// Indicates the maximum rotation period supported by the service. See EddystoneEidRegistration.rotation_period_exponent - #[serde(rename="maxRotationPeriodExponent")] - pub max_rotation_period_exponent: Option, - /// The beacon service's public key for use by a beacon to derive its Identity Key using Elliptic Curve Diffie-Hellman key exchange. - #[serde(rename="serviceEcdhPublicKey")] - pub service_ecdh_public_key: Option, -} - -impl ResponseResult for EphemeralIdRegistrationParams {} - - -/// An object representing a latitude/longitude pair. This is expressed as a pair of doubles representing degrees latitude and degrees longitude. Unless specified otherwise, this must conform to the WGS84 standard. Values must be within normalized ranges. Example of normalization code in Python: def NormalizeLongitude(longitude): """Wraps decimal degrees longitude to [-180.0, 180.0].""" q, r = divmod(longitude, 360.0) if r > 180.0 or (r == 180.0 and q <= -1.0): return r - 360.0 return r def NormalizeLatLng(latitude, longitude): """Wraps decimal degrees latitude and longitude to [-90.0, 90.0] and [-180.0, 180.0], respectively.""" r = latitude % 360.0 if r = 270.0: return r - 360, NormalizeLongitude(longitude) else: return 180 - r, NormalizeLongitude(longitude + 180.0) assert 180.0 == NormalizeLongitude(180.0) assert -180.0 == NormalizeLongitude(-180.0) assert -179.0 == NormalizeLongitude(181.0) assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct LatLng { - /// The latitude in degrees. It must be in the range [-90.0, +90.0]. - pub latitude: Option, - /// The longitude in degrees. It must be in the range [-180.0, +180.0]. - pub longitude: Option, -} - -impl Part for LatLng {} - - -/// Response to ListBeaconAttachments that contains the requested attachments. +/// Response to `ListBeaconAttachments` that contains the requested attachments. /// /// # Activities /// @@ -690,6 +586,223 @@ pub struct ListBeaconAttachmentsResponse { impl ResponseResult for ListBeaconAttachmentsResponse {} +/// Diagnostics for a single beacon. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Diagnostics { + /// The date when the battery is expected to be low. If the value is missing + /// then there is no estimate for when the battery will be low. + /// This value is only an estimate, not an exact date. + #[serde(rename="estimatedLowBatteryDate")] + pub estimated_low_battery_date: Option, + /// An unordered list of Alerts that the beacon has. + pub alerts: Option>, + /// Resource name of the beacon. For Eddystone-EID beacons, this may + /// be the beacon's current EID, or the beacon's "stable" Eddystone-UID. + #[serde(rename="beaconName")] + pub beacon_name: Option, +} + +impl Part for Diagnostics {} + + +/// A subset of beacon information served via the `beaconinfo.getforobserved` +/// method, which you call when users of your app encounter your beacons. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BeaconInfo { + /// The ID advertised by the beacon. + #[serde(rename="advertisedId")] + pub advertised_id: Option, + /// Attachments matching the type(s) requested. + /// May be empty if no attachment types were requested. + pub attachments: Option>, + /// The name under which the beacon is registered. + #[serde(rename="beaconName")] + pub beacon_name: Option, +} + +impl Part for BeaconInfo {} + + +/// Response that contains the requested diagnostics. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [diagnostics list beacons](struct.BeaconDiagnosticListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ListDiagnosticsResponse { + /// Token that can be used for pagination. Returned only if the + /// request matches more beacons than can be returned in this response. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// The diagnostics matching the given request. + pub diagnostics: Option>, +} + +impl ResponseResult for ListDiagnosticsResponse {} + + +/// Information a client needs to provision and register beacons that +/// broadcast Eddystone-EID format beacon IDs, using Elliptic curve +/// Diffie-Hellman key exchange. See +/// [the Eddystone specification](https://github.com/google/eddystone/tree/master/eddystone-eid) at GitHub. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 eidparams](struct.MethodGetEidparamCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EphemeralIdRegistrationParams { + /// Indicates the minimum rotation period supported by the service. + /// See EddystoneEidRegistration.rotation_period_exponent + #[serde(rename="minRotationPeriodExponent")] + pub min_rotation_period_exponent: Option, + /// Indicates the maximum rotation period supported by the service. + /// See EddystoneEidRegistration.rotation_period_exponent + #[serde(rename="maxRotationPeriodExponent")] + pub max_rotation_period_exponent: Option, + /// The beacon service's public key for use by a beacon to derive its + /// Identity Key using Elliptic Curve Diffie-Hellman key exchange. + #[serde(rename="serviceEcdhPublicKey")] + pub service_ecdh_public_key: Option, +} + +impl ResponseResult for EphemeralIdRegistrationParams {} + + +/// An object representing a latitude/longitude pair. This is expressed as a pair +/// of doubles representing degrees latitude and degrees longitude. Unless +/// specified otherwise, this must conform to the +/// WGS84 +/// standard. Values must be within normalized ranges. +/// +/// Example of normalization code in Python: +/// +/// def NormalizeLongitude(longitude): +/// """Wraps decimal degrees longitude to [-180.0, 180.0].""" +/// q, r = divmod(longitude, 360.0) +/// if r > 180.0 or (r == 180.0 and q <= -1.0): +/// return r - 360.0 +/// return r +/// +/// def NormalizeLatLng(latitude, longitude): +/// """Wraps decimal degrees latitude and longitude to +/// [-90.0, 90.0] and [-180.0, 180.0], respectively.""" +/// r = latitude % 360.0 +/// if r <= 90.0: +/// return r, NormalizeLongitude(longitude) +/// elif r >= 270.0: +/// return r - 360, NormalizeLongitude(longitude) +/// else: +/// return 180 - r, NormalizeLongitude(longitude + 180.0) +/// +/// assert 180.0 == NormalizeLongitude(180.0) +/// assert -180.0 == NormalizeLongitude(-180.0) +/// assert -179.0 == NormalizeLongitude(181.0) +/// assert (0.0, 0.0) == NormalizeLatLng(360.0, 0.0) +/// assert (0.0, 0.0) == NormalizeLatLng(-360.0, 0.0) +/// assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) +/// assert (-85.0, -170.0) == NormalizeLatLng(-95.0, 10.0) +/// assert (90.0, 10.0) == NormalizeLatLng(90.0, 10.0) +/// assert (-90.0, -10.0) == NormalizeLatLng(-90.0, -10.0) +/// assert (0.0, -170.0) == NormalizeLatLng(-180.0, 10.0) +/// assert (0.0, -170.0) == NormalizeLatLng(180.0, 10.0) +/// assert (-90.0, 10.0) == NormalizeLatLng(270.0, 10.0) +/// assert (90.0, 10.0) == NormalizeLatLng(-270.0, 10.0) +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LatLng { + /// The latitude in degrees. It must be in the range [-90.0, +90.0]. + pub latitude: Option, + /// The longitude in degrees. It must be in the range [-180.0, +180.0]. + pub longitude: Option, +} + +impl Part for LatLng {} + + +/// Write-only registration parameters for beacons using Eddystone-EID format. +/// Two ways of securely registering an Eddystone-EID beacon with the service +/// are supported: +/// +/// 1. Perform an ECDH key exchange via this API, including a previous call +/// to `GET /v1beta1/eidparams`. In this case the fields +/// `beacon_ecdh_public_key` and `service_ecdh_public_key` should be +/// populated and `beacon_identity_key` should not be populated. This +/// method ensures that only the two parties in the ECDH key exchange can +/// compute the identity key, which becomes a secret between them. +/// 2. Derive or obtain the beacon's identity key via other secure means +/// (perhaps an ECDH key exchange between the beacon and a mobile device +/// or any other secure method), and then submit the resulting identity key +/// to the service. In this case `beacon_identity_key` field should be +/// populated, and neither of `beacon_ecdh_public_key` nor +/// `service_ecdh_public_key` fields should be. The security of this method +/// depends on how securely the parties involved (in particular the +/// bluetooth client) handle the identity key, and obviously on how +/// securely the identity key was generated. +/// +/// See [the Eddystone specification](https://github.com/google/eddystone/tree/master/eddystone-eid) at GitHub. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct EphemeralIdRegistration { + /// An initial ephemeral ID calculated using the clock value submitted as + /// `initial_clock_value`, and the secret key generated by the + /// Diffie-Hellman key exchange using `service_ecdh_public_key` and + /// `service_ecdh_public_key`. This initial EID value will be used by the + /// service to confirm that the key exchange process was successful. + #[serde(rename="initialEid")] + pub initial_eid: Option, + /// Indicates the nominal period between each rotation of the beacon's + /// ephemeral ID. "Nominal" because the beacon should randomize the + /// actual interval. See [the spec at github](https://github.com/google/eddystone/tree/master/eddystone-eid) + /// for details. This value corresponds to a power-of-two scaler on the + /// beacon's clock: when the scaler value is K, the beacon will begin + /// broadcasting a new ephemeral ID on average every 2^K seconds. + #[serde(rename="rotationPeriodExponent")] + pub rotation_period_exponent: Option, + /// The beacon's public key used for the Elliptic curve Diffie-Hellman + /// key exchange. When this field is populated, `service_ecdh_public_key` + /// must also be populated, and `beacon_identity_key` must not be. + #[serde(rename="beaconEcdhPublicKey")] + pub beacon_ecdh_public_key: Option, + /// The initial clock value of the beacon. The beacon's clock must have + /// begun counting at this value immediately prior to transmitting this + /// value to the resolving service. Significant delay in transmitting this + /// value to the service risks registration or resolution failures. If a + /// value is not provided, the default is zero. + #[serde(rename="initialClockValue")] + pub initial_clock_value: Option, + /// The service's public key used for the Elliptic curve Diffie-Hellman + /// key exchange. When this field is populated, `beacon_ecdh_public_key` + /// must also be populated, and `beacon_identity_key` must not be. + #[serde(rename="serviceEcdhPublicKey")] + pub service_ecdh_public_key: Option, + /// The private key of the beacon. If this field is populated, + /// `beacon_ecdh_public_key` and `service_ecdh_public_key` must not be + /// populated. + #[serde(rename="beaconIdentityKey")] + pub beacon_identity_key: Option, +} + +impl Part for EphemeralIdRegistration {} + + /// Response to ListNamespacesRequest that contains all the project's namespaces. /// /// # Activities @@ -725,39 +838,79 @@ impl ResponseResult for ListNamespacesResponse {} /// * [attachments delete beacons](struct.BeaconAttachmentDeleteCall.html) (none) /// * [deactivate beacons](struct.BeaconDeactivateCall.html) (none) /// * [register beacons](struct.BeaconRegisterCall.html) (request|response) +/// * [delete beacons](struct.BeaconDeleteCall.html) (none) /// * [diagnostics list beacons](struct.BeaconDiagnosticListCall.html) (none) /// * [attachments batch delete beacons](struct.BeaconAttachmentBatchDeleteCall.html) (none) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Beacon { - /// Current status of the beacon. Required. + /// Current status of the beacon. + /// Required. pub status: Option, - /// Free text used to identify and describe the beacon. Maximum length 140 characters. Optional. + /// Free text used to identify and describe the beacon. Maximum length 140 + /// characters. + /// Optional. pub description: Option, - /// The indoor level information for this beacon, if known. As returned by the Google Maps API. Optional. + /// The indoor level information for this beacon, if known. As returned by the + /// Google Maps API. + /// Optional. #[serde(rename="indoorLevel")] pub indoor_level: Option, - /// The location of the beacon, expressed as a latitude and longitude pair. This location is given when the beacon is registered or updated. It does not necessarily indicate the actual current location of the beacon. Optional. + /// The location of the beacon, expressed as a latitude and longitude pair. + /// This location is given when the beacon is registered or updated. It does + /// not necessarily indicate the actual current location of the beacon. + /// Optional. #[serde(rename="latLng")] pub lat_lng: Option, - /// The [Google Places API](/places/place-id) Place ID of the place where the beacon is deployed. This is given when the beacon is registered or updated, not automatically detected in any way. Optional. + /// The [Google Places API](/places/place-id) Place ID of the place where + /// the beacon is deployed. This is given when the beacon is registered or + /// updated, not automatically detected in any way. + /// Optional. #[serde(rename="placeId")] pub place_id: Option, - /// Write-only registration parameters for beacons using Eddystone-EID (remotely resolved ephemeral ID) format. This information will not be populated in API responses. When submitting this data, the `advertised_id` field must contain an ID of type Eddystone-UID. Any other ID type will result in an error. + /// Write-only registration parameters for beacons using Eddystone-EID + /// (remotely resolved ephemeral ID) format. This information will not be + /// populated in API responses. When submitting this data, the `advertised_id` + /// field must contain an ID of type Eddystone-UID. Any other ID type will + /// result in an error. #[serde(rename="ephemeralIdRegistration")] pub ephemeral_id_registration: Option, - /// The identifier of a beacon as advertised by it. This field must be populated when registering. It may be empty when updating a beacon record because it is ignored in updates. When registering a beacon that broadcasts Eddystone-EID, this field should contain a "stable" Eddystone-UID that identifies the beacon and links it to its attachments. The stable Eddystone-UID is only used for administering the beacon. + /// The identifier of a beacon as advertised by it. This field must be + /// populated when registering. It may be empty when updating a beacon + /// record because it is ignored in updates. + /// + /// When registering a beacon that broadcasts Eddystone-EID, this field + /// should contain a "stable" Eddystone-UID that identifies the beacon and + /// links it to its attachments. The stable Eddystone-UID is only used for + /// administering the beacon. #[serde(rename="advertisedId")] pub advertised_id: Option, - /// Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. This field must be left empty when registering. After reading a beacon, clients can use the name for future operations. + /// Resource name of this beacon. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. + /// + /// This field must be left empty when registering. After reading a beacon, + /// clients can use the name for future operations. #[serde(rename="beaconName")] pub beacon_name: Option, - /// Expected location stability. This is set when the beacon is registered or updated, not automatically detected in any way. Optional. + /// Expected location stability. This is set when the beacon is registered or + /// updated, not automatically detected in any way. + /// Optional. #[serde(rename="expectedStability")] pub expected_stability: Option, - /// Properties of the beacon device, for example battery type or firmware version. Optional. + /// Properties of the beacon device, for example battery type or firmware + /// version. + /// Optional. pub properties: Option>, - /// Some beacons may require a user to provide an authorization key before changing any of its configuration (e.g. broadcast frames, transmit power). This field provides a place to store and control access to that key. This field is populated in responses to `GET /v1beta1/beacons/3!beaconId` from users with write access to the given beacon. That is to say: If the user is authorized to write the beacon's confidential data in the service, the service considers them authorized to configure the beacon. Note that this key grants nothing on the service, only on the beacon itself. + /// Some beacons may require a user to provide an authorization key before + /// changing any of its configuration (e.g. broadcast frames, transmit power). + /// This field provides a place to store and control access to that key. + /// This field is populated in responses to `GET /v1beta1/beacons/3!beaconId` + /// from users with write access to the given beacon. That is to say: If the + /// user is authorized to write the beacon's confidential data in the service, + /// the service considers them authorized to configure the beacon. Note + /// that this key grants nothing on the service, only on the beacon itself. #[serde(rename="provisioningKey")] pub provisioning_key: Option, } @@ -767,7 +920,8 @@ impl Resource for Beacon {} impl ResponseResult for Beacon {} -/// Information about the requested beacons, optionally including attachment data. +/// Information about the requested beacons, optionally including attachment +/// data. /// /// # Activities /// @@ -778,43 +932,58 @@ impl ResponseResult for Beacon {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GetInfoForObservedBeaconsResponse { - /// Public information about beacons. May be empty if the request matched no beacons. + /// Public information about beacons. + /// May be empty if the request matched no beacons. pub beacons: Option>, } impl ResponseResult for GetInfoForObservedBeaconsResponse {} -/// Response that contains the requested diagnostics. +/// 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*). /// -/// * [diagnostics list beacons](struct.BeaconDiagnosticListCall.html) (response) +/// * [delete beacons](struct.BeaconDeleteCall.html) (response) +/// * [decommission beacons](struct.BeaconDecommissionCall.html) (response) +/// * [attachments delete beacons](struct.BeaconAttachmentDeleteCall.html) (response) +/// * [deactivate beacons](struct.BeaconDeactivateCall.html) (response) +/// * [activate beacons](struct.BeaconActivateCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ListDiagnosticsResponse { - /// Token that can be used for pagination. Returned only if the request matches more beacons than can be returned in this response. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// The diagnostics matching the given request. - pub diagnostics: Option>, -} +pub struct Empty { _never_set: Option } -impl ResponseResult for ListDiagnosticsResponse {} +impl ResponseResult for Empty {} -/// 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`. +/// Represents a whole calendar date, e.g. date of birth. The time of day and +/// time zone are either specified elsewhere or are not significant. The date +/// is relative to the Proleptic Gregorian Calendar. The day may be 0 to +/// represent a year and month where the day is not significant, e.g. credit card +/// expiration date. The year may be 0 to represent a month and day independent +/// of year, e.g. anniversary date. Related types are google.type.TimeOfDay +/// and `google.protobuf.Timestamp`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Date { - /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without a year. + /// 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. + /// 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, @@ -870,7 +1039,7 @@ impl ResponseResult for DeleteAttachmentsResponse {} /// ::default(), None); /// let mut hub = Proximitybeacon::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `activate(...)`, `attachments_batch_delete(...)`, `attachments_create(...)`, `attachments_delete(...)`, `attachments_list(...)`, `deactivate(...)`, `decommission(...)`, `diagnostics_list(...)`, `get(...)`, `list(...)`, `register(...)` and `update(...)` +/// // like `activate(...)`, `attachments_batch_delete(...)`, `attachments_create(...)`, `attachments_delete(...)`, `attachments_list(...)`, `deactivate(...)`, `decommission(...)`, `delete(...)`, `diagnostics_list(...)`, `get(...)`, `list(...)`, `register(...)` and `update(...)` /// // to build up your call. /// let rb = hub.beacons(); /// # } @@ -887,11 +1056,27 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the attachments for the specified beacon that match the specified namespaced-type pattern. To control which namespaced types are returned, you add the `namespacedType` query parameter to the request. You must either use `*/*`, to return all attachments, or the namespace must be one of the ones returned from the `namespaces` endpoint. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Returns the attachments for the specified beacon that match the specified + /// namespaced-type pattern. + /// + /// To control which namespaced types are returned, you add the + /// `namespacedType` query parameter to the request. You must either use + /// `*/*`, to return all attachments, or the namespace must be one of + /// the ones returned from the `namespaces` endpoint. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **viewer**, **Is owner** or **Can edit** + /// permissions in the Google Developers Console project. /// /// # Arguments /// - /// * `beaconName` - Beacon whose attachments should be fetched. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + /// * `beaconName` - Beacon whose attachments should be fetched. A beacon name has the + /// format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast + /// by the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. pub fn attachments_list(&self, beacon_name: &str) -> BeaconAttachmentListCall<'a, C, A> { BeaconAttachmentListCall { hub: self.hub, @@ -906,11 +1091,27 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns detailed information about the specified beacon. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project. Requests may supply an Eddystone-EID beacon name in the form: `beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID broadcast by the beacon. The returned `Beacon` object will contain the beacon's stable Eddystone-UID. Clients not authorized to resolve the beacon's ephemeral Eddystone-EID broadcast will receive an error. + /// Returns detailed information about the specified beacon. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **viewer**, **Is owner** or **Can edit** + /// permissions in the Google Developers Console project. + /// + /// Requests may supply an Eddystone-EID beacon name in the form: + /// `beacons/4!beaconId` where the `beaconId` is the base16 ephemeral ID + /// broadcast by the beacon. The returned `Beacon` object will contain the + /// beacon's stable Eddystone-UID. Clients not authorized to resolve the + /// beacon's ephemeral Eddystone-EID broadcast will receive an error. /// /// # Arguments /// - /// * `beaconName` - Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + /// * `beaconName` - Resource name of this beacon. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. pub fn get(&self, beacon_name: &str) -> BeaconGetCall<'a, C, A> { BeaconGetCall { hub: self.hub, @@ -924,14 +1125,33 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Associates the given data with the specified beacon. Attachment data must contain two parts: - /// - A namespaced type. - /// - The actual attachment data itself. The namespaced type consists of two parts, the namespace and the type. The namespace must be one of the values returned by the `namespaces` endpoint, while the type can be a string of any characters except for the forward slash (`/`) up to 100 characters in length. Attachment data can be up to 1024 bytes long. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Associates the given data with the specified beacon. Attachment data must + /// contain two parts: + ///
    + ///
  • A namespaced type.
  • + ///
  • The actual attachment data itself.
  • + ///
+ /// The namespaced type consists of two parts, the namespace and the type. + /// The namespace must be one of the values returned by the `namespaces` + /// endpoint, while the type can be a string of any characters except for the + /// forward slash (`/`) up to 100 characters in length. + /// + /// Attachment data can be up to 1024 bytes long. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **Is owner** or **Can edit** permissions in the + /// Google Developers Console project. /// /// # Arguments /// /// * `request` - No description provided. - /// * `beaconName` - Beacon on which the attachment should be created. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + /// * `beaconName` - Beacon on which the attachment should be created. A beacon name has the + /// format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast + /// by the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. pub fn attachments_create(&self, request: BeaconAttachment, beacon_name: &str) -> BeaconAttachmentCreateCall<'a, C, A> { BeaconAttachmentCreateCall { hub: self.hub, @@ -946,11 +1166,24 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Decommissions the specified beacon in the service. This beacon will no longer be returned from `beaconinfo.getforobserved`. This operation is permanent -- you will not be able to re-register a beacon with this ID again. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Decommissions the specified beacon in the service. This beacon will no + /// longer be returned from `beaconinfo.getforobserved`. This operation is + /// permanent -- you will not be able to re-register a beacon with this ID + /// again. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **Is owner** or **Can edit** permissions in the + /// Google Developers Console project. /// /// # Arguments /// - /// * `beaconName` - Beacon that should be decommissioned. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID of the beacon's "stable" UID. Required. + /// * `beaconName` - Beacon that should be decommissioned. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID of the beacon's "stable" UID. + /// Required. pub fn decommission(&self, beacon_name: &str) -> BeaconDecommissionCall<'a, C, A> { BeaconDecommissionCall { hub: self.hub, @@ -964,11 +1197,24 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Activates a beacon. A beacon that is active will return information and attachment data when queried via `beaconinfo.getforobserved`. Calling this method on an already active beacon will do nothing (but will return a successful response code). Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Activates a beacon. A beacon that is active will return information + /// and attachment data when queried via `beaconinfo.getforobserved`. + /// Calling this method on an already active beacon will do nothing (but + /// will return a successful response code). + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **Is owner** or **Can edit** permissions in the + /// Google Developers Console project. /// /// # Arguments /// - /// * `beaconName` - Beacon that should be activated. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + /// * `beaconName` - Beacon that should be activated. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. pub fn activate(&self, beacon_name: &str) -> BeaconActivateCall<'a, C, A> { BeaconActivateCall { hub: self.hub, @@ -982,7 +1228,13 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Searches the beacon registry for beacons that match the given search criteria. Only those beacons that the client has permission to list will be returned. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Searches the beacon registry for beacons that match the given search + /// criteria. Only those beacons that the client has permission to list + /// will be returned. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **viewer**, **Is owner** or **Can edit** + /// permissions in the Google Developers Console project. pub fn list(&self) -> BeaconListCall<'a, C, A> { BeaconListCall { hub: self.hub, @@ -998,12 +1250,27 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the information about the specified beacon. **Any field that you do not populate in the submitted beacon will be permanently erased**, so you should follow the "read, modify, write" pattern to avoid inadvertently destroying data. Changes to the beacon status via this method will be silently ignored. To update beacon status, use the separate methods on this API for activation, deactivation, and decommissioning. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Updates the information about the specified beacon. **Any field that you do + /// not populate in the submitted beacon will be permanently erased**, so you + /// should follow the "read, modify, write" pattern to avoid inadvertently + /// destroying data. + /// + /// Changes to the beacon status via this method will be silently ignored. + /// To update beacon status, use the separate methods on this API for + /// activation, deactivation, and decommissioning. + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **Is owner** or **Can edit** permissions in the + /// Google Developers Console project. /// /// # Arguments /// /// * `request` - No description provided. - /// * `beaconName` - Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. This field must be left empty when registering. After reading a beacon, clients can use the name for future operations. + /// * `beaconName` - Resource name of this beacon. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. + /// This field must be left empty when registering. After reading a beacon, + /// clients can use the name for future operations. pub fn update(&self, request: Beacon, beacon_name: &str) -> BeaconUpdateCall<'a, C, A> { BeaconUpdateCall { hub: self.hub, @@ -1018,11 +1285,24 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes the specified attachment for the given beacon. Each attachment has a unique attachment name (`attachmentName`) which is returned when you fetch the attachment data via this API. You specify this with the delete request to control which attachment is removed. This operation cannot be undone. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Deletes the specified attachment for the given beacon. Each attachment has + /// a unique attachment name (`attachmentName`) which is returned when you + /// fetch the attachment data via this API. You specify this with the delete + /// request to control which attachment is removed. This operation cannot be + /// undone. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **Is owner** or **Can edit** permissions in the + /// Google Developers Console project. /// /// # Arguments /// - /// * `attachmentName` - The attachment name (`attachmentName`) of the attachment to remove. For example: `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For Eddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the beacon's current EID, or its "stable" Eddystone-UID. Required. + /// * `attachmentName` - The attachment name (`attachmentName`) of + /// the attachment to remove. For example: + /// `beacons/3!893737abc9/attachments/c5e937-af0-494-959-ec49d12738`. For + /// Eddystone-EID beacons, the beacon ID portion (`3!893737abc9`) may be the + /// beacon's current EID, or its "stable" Eddystone-UID. + /// Required. pub fn attachments_delete(&self, attachment_name: &str) -> BeaconAttachmentDeleteCall<'a, C, A> { BeaconAttachmentDeleteCall { hub: self.hub, @@ -1036,11 +1316,24 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deactivates a beacon. Once deactivated, the API will not return information nor attachment data for the beacon when queried via `beaconinfo.getforobserved`. Calling this method on an already inactive beacon will do nothing (but will return a successful response code). Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Deactivates a beacon. Once deactivated, the API will not return + /// information nor attachment data for the beacon when queried via + /// `beaconinfo.getforobserved`. Calling this method on an already inactive + /// beacon will do nothing (but will return a successful response code). + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **Is owner** or **Can edit** permissions in the + /// Google Developers Console project. /// /// # Arguments /// - /// * `beaconName` - Beacon that should be deactivated. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + /// * `beaconName` - Beacon that should be deactivated. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. pub fn deactivate(&self, beacon_name: &str) -> BeaconDeactivateCall<'a, C, A> { BeaconDeactivateCall { hub: self.hub, @@ -1054,7 +1347,12 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Registers a previously unregistered beacon given its `advertisedId`. These IDs are unique within the system. An ID can be registered only once. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Registers a previously unregistered beacon given its `advertisedId`. + /// These IDs are unique within the system. An ID can be registered only once. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **Is owner** or **Can edit** permissions in the + /// Google Developers Console project. /// /// # Arguments /// @@ -1072,7 +1370,43 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// List the diagnostics for a single beacon. You can also list diagnostics for all the beacons owned by your Google Developers Console project by using the beacon name `beacons/-`. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Deletes the specified beacon including all diagnostics data for the beacon + /// as well as any attachments on the beacon (including those belonging to + /// other projects). This operation cannot be undone. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **Is owner** or **Can edit** permissions in the + /// Google Developers Console project. + /// + /// # Arguments + /// + /// * `beaconName` - Beacon that should be deleted. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. + pub fn delete(&self, beacon_name: &str) -> BeaconDeleteCall<'a, C, A> { + BeaconDeleteCall { + hub: self.hub, + _beacon_name: beacon_name.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: + /// + /// List the diagnostics for a single beacon. You can also list diagnostics for + /// all the beacons owned by your Google Developers Console project by using + /// the beacon name `beacons/-`. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **viewer**, **Is owner** or **Can edit** + /// permissions in the Google Developers Console project. /// /// # Arguments /// @@ -1093,11 +1427,27 @@ impl<'a, C, A> BeaconMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Deletes multiple attachments on a given beacon. This operation is permanent and cannot be undone. You can optionally specify `namespacedType` to choose which attachments should be deleted. If you do not specify `namespacedType`, all your attachments on the given beacon will be deleted. You also may explicitly specify `*/*` to delete all. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Deletes multiple attachments on a given beacon. This operation is + /// permanent and cannot be undone. + /// + /// You can optionally specify `namespacedType` to choose which attachments + /// should be deleted. If you do not specify `namespacedType`, all your + /// attachments on the given beacon will be deleted. You also may explicitly + /// specify `*/*` to delete all. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **Is owner** or **Can edit** permissions in the + /// Google Developers Console project. /// /// # Arguments /// - /// * `beaconName` - The beacon whose attachments should be deleted. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + /// * `beaconName` - The beacon whose attachments should be deleted. A beacon name has the + /// format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast + /// by the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. pub fn attachments_batch_delete(&self, beacon_name: &str) -> BeaconAttachmentBatchDeleteCall<'a, C, A> { BeaconAttachmentBatchDeleteCall { hub: self.hub, @@ -1153,7 +1503,10 @@ impl<'a, C, A> BeaconinfoMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Given one or more beacon observations, returns any beacon information and attachments accessible to your application. Authorize by using the [API key](https://developers.google.com/beacons/proximity/how-tos/authorizing#APIKey) for the application. + /// Given one or more beacon observations, returns any beacon information + /// and attachments accessible to your application. Authorize by using the + /// [API key](https://developers.google.com/beacons/proximity/get-started#request_a_browser_api_key) + /// for the application. /// /// # Arguments /// @@ -1210,7 +1563,13 @@ impl<'a, C, A> MethodMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Gets the Proximity Beacon API's current public key and associated parameters used to initiate the Diffie-Hellman key exchange required to register a beacon that broadcasts the Eddystone-EID format. This key changes periodically; clients may cache it and re-use the same public key to provision and register multiple beacons. However, clients should be prepared to refresh this key when they encounter an error registering an Eddystone-EID beacon. + /// Gets the Proximity Beacon API's current public key and associated + /// parameters used to initiate the Diffie-Hellman key exchange required to + /// register a beacon that broadcasts the Eddystone-EID format. This key + /// changes periodically; clients may cache it and re-use the same public key + /// to provision and register multiple beacons. However, clients should be + /// prepared to refresh this key when they encounter an error registering an + /// Eddystone-EID beacon. pub fn get_eidparams(&self) -> MethodGetEidparamCall<'a, C, A> { MethodGetEidparamCall { hub: self.hub, @@ -1263,7 +1622,13 @@ impl<'a, C, A> NamespaceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists all attachment namespaces owned by your Google Developers Console project. Attachment data associated with a beacon must include a namespaced type, and the namespace must be owned by your project. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project. + /// Lists all attachment namespaces owned by your Google Developers Console + /// project. Attachment data associated with a beacon must include a + /// namespaced type, and the namespace must be owned by your project. + /// + /// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) + /// from a signed-in user with **viewer**, **Is owner** or **Can edit** + /// permissions in the Google Developers Console project. pub fn list(&self) -> NamespaceListCall<'a, C, A> { NamespaceListCall { hub: self.hub, @@ -1276,12 +1641,14 @@ impl<'a, C, A> NamespaceMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates the information about the specified namespace. Only the namespace visibility can be updated. + /// Updates the information about the specified namespace. Only the namespace + /// visibility can be updated. /// /// # Arguments /// /// * `request` - No description provided. - /// * `namespaceName` - Resource name of this namespace. Namespaces names have the format: namespaces/namespace. + /// * `namespaceName` - Resource name of this namespace. Namespaces names have the format: + /// namespaces/namespace. pub fn update(&self, request: Namespace, namespace_name: &str) -> NamespaceUpdateCall<'a, C, A> { NamespaceUpdateCall { hub: self.hub, @@ -1303,7 +1670,17 @@ impl<'a, C, A> NamespaceMethods<'a, C, A> { // CallBuilders ### // ################# -/// Returns the attachments for the specified beacon that match the specified namespaced-type pattern. To control which namespaced types are returned, you add the `namespacedType` query parameter to the request. You must either use `*/*`, to return all attachments, or the namespace must be one of the ones returned from the `namespaces` endpoint. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project. +/// Returns the attachments for the specified beacon that match the specified +/// namespaced-type pattern. +/// +/// To control which namespaced types are returned, you add the +/// `namespacedType` query parameter to the request. You must either use +/// `*/*`, to return all attachments, or the namespace must be one of +/// the ones returned from the `namespaces` endpoint. +/// +/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) +/// from a signed-in user with **viewer**, **Is owner** or **Can edit** +/// permissions in the Google Developers Console project. /// /// A builder for the *attachments.list* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -1384,7 +1761,7 @@ impl<'a, C, A> BeaconAttachmentListCall<'a, C, A> where C: BorrowMut BeaconAttachmentListCall<'a, C, A> where C: BorrowMut BeaconAttachmentListCall<'a, C, A> where C: BorrowMut BeaconAttachmentListCall<'a, C, A> { self._project_id = Some(new_value.to_string()); self } - /// Specifies the namespace and type of attachment to include in response in namespace/type format. Accepts `*/*` to specify "all types in all namespaces". + /// Specifies the namespace and type of attachment to include in response in + /// namespace/type format. Accepts `*/*` to specify + /// "all types in all namespaces". /// /// Sets the *namespaced type* query property to the given value. pub fn namespaced_type(mut self, new_value: &str) -> BeaconAttachmentListCall<'a, C, A> { @@ -1539,12 +1929,12 @@ impl<'a, C, A> BeaconAttachmentListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconAttachmentListCall<'a, C, A> @@ -1572,7 +1962,17 @@ impl<'a, C, A> BeaconAttachmentListCall<'a, C, A> where C: BorrowMut BeaconGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+beaconName}"; + let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+beaconName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -1754,7 +2154,13 @@ impl<'a, C, A> BeaconGetCall<'a, C, A> where C: BorrowMut, A: oau } - /// Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + /// Resource name of this beacon. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. /// /// Sets the *beacon name* path property to the given value. /// @@ -1764,7 +2170,10 @@ impl<'a, C, A> BeaconGetCall<'a, C, A> where C: BorrowMut, A: oau self._beacon_name = new_value.to_string(); self } - /// The project id of the beacon to request. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + /// The project id of the beacon to request. If the project id is not specified + /// then the project making the request is used. The project id must match the + /// project that owns the beacon. + /// Optional. /// /// Sets the *project id* query property to the given value. pub fn project_id(mut self, new_value: &str) -> BeaconGetCall<'a, C, A> { @@ -1796,12 +2205,12 @@ impl<'a, C, A> BeaconGetCall<'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) -> BeaconGetCall<'a, C, A> @@ -1829,9 +2238,22 @@ impl<'a, C, A> BeaconGetCall<'a, C, A> where C: BorrowMut, A: oau } -/// Associates the given data with the specified beacon. Attachment data must contain two parts: -/// - A namespaced type. -/// - The actual attachment data itself. The namespaced type consists of two parts, the namespace and the type. The namespace must be one of the values returned by the `namespaces` endpoint, while the type can be a string of any characters except for the forward slash (`/`) up to 100 characters in length. Attachment data can be up to 1024 bytes long. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. +/// Associates the given data with the specified beacon. Attachment data must +/// contain two parts: +///
    +///
  • A namespaced type.
  • +///
  • The actual attachment data itself.
  • +///
+/// The namespaced type consists of two parts, the namespace and the type. +/// The namespace must be one of the values returned by the `namespaces` +/// endpoint, while the type can be a string of any characters except for the +/// forward slash (`/`) up to 100 characters in length. +/// +/// Attachment data can be up to 1024 bytes long. +/// +/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) +/// from a signed-in user with **Is owner** or **Can edit** permissions in the +/// Google Developers Console project. /// /// A builder for the *attachments.create* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -1914,7 +2336,7 @@ impl<'a, C, A> BeaconAttachmentCreateCall<'a, C, A> where C: BorrowMut BeaconAttachmentCreateCall<'a, C, A> where C: BorrowMut BeaconAttachmentCreateCall<'a, C, A> where C: BorrowMut BeaconAttachmentCreateCall<'a, C, A> { @@ -2086,12 +2517,12 @@ impl<'a, C, A> BeaconAttachmentCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconAttachmentCreateCall<'a, C, A> @@ -2119,7 +2550,14 @@ impl<'a, C, A> BeaconAttachmentCreateCall<'a, C, A> where C: BorrowMut BeaconDecommissionCall<'a, C, A> where C: BorrowMut BeaconDecommissionCall<'a, C, A> where C: BorrowMut BeaconDecommissionCall<'a, C, A> where C: BorrowMut BeaconDecommissionCall<'a, C, A> { @@ -2343,12 +2790,12 @@ impl<'a, C, A> BeaconDecommissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconDecommissionCall<'a, C, A> @@ -2376,7 +2823,14 @@ impl<'a, C, A> BeaconDecommissionCall<'a, C, A> where C: BorrowMut BeaconActivateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+beaconName}:activate"; + let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+beaconName}:activate".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -2558,7 +3012,13 @@ impl<'a, C, A> BeaconActivateCall<'a, C, A> where C: BorrowMut, A } - /// Beacon that should be activated. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + /// Beacon that should be activated. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. /// /// Sets the *beacon name* path property to the given value. /// @@ -2568,7 +3028,10 @@ impl<'a, C, A> BeaconActivateCall<'a, C, A> where C: BorrowMut, A self._beacon_name = new_value.to_string(); self } - /// The project id of the beacon to activate. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + /// The project id of the beacon to activate. If the project id is not + /// specified then the project making the request is used. The project id + /// must match the project that owns the beacon. + /// Optional. /// /// Sets the *project id* query property to the given value. pub fn project_id(mut self, new_value: &str) -> BeaconActivateCall<'a, C, A> { @@ -2600,12 +3063,12 @@ impl<'a, C, A> BeaconActivateCall<'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) -> BeaconActivateCall<'a, C, A> @@ -2633,7 +3096,13 @@ impl<'a, C, A> BeaconActivateCall<'a, C, A> where C: BorrowMut, A } -/// Searches the beacon registry for beacons that match the given search criteria. Only those beacons that the client has permission to list will be returned. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project. +/// Searches the beacon registry for beacons that match the given search +/// criteria. Only those beacons that the client has permission to list +/// will be returned. +/// +/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) +/// from a signed-in user with **viewer**, **Is owner** or **Can edit** +/// permissions in the Google Developers Console project. /// /// A builder for the *list* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -2721,7 +3190,7 @@ impl<'a, C, A> BeaconListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/beacons"; + let mut url = "https://proximitybeacon.googleapis.com/v1beta1/beacons".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -2803,14 +3272,82 @@ impl<'a, C, A> BeaconListCall<'a, C, A> where C: BorrowMut, A: oa } - /// Filter query string that supports the following field filters: * `description:""` For example: `description:"Room 3"` Returns beacons whose description matches tokens in the string "Room 3" (not necessarily that exact string). The string must be double-quoted. * `status:` For example: `status:active` Returns beacons whose status matches the given value. Values must be one of the Beacon.Status enum values (case insensitive). Accepts multiple filters which will be combined with OR logic. * `stability:` For example: `stability:mobile` Returns beacons whose expected stability matches the given value. Values must be one of the Beacon.Stability enum values (case insensitive). Accepts multiple filters which will be combined with OR logic. * `place_id:""` For example: `place_id:"ChIJVSZzVR8FdkgRXGmmm6SslKw="` Returns beacons explicitly registered at the given place, expressed as a Place ID obtained from [Google Places API](/places/place-id). Does not match places inside the given place. Does not consider the beacon's actual location (which may be different from its registered place). Accepts multiple filters that will be combined with OR logic. The place ID must be double-quoted. * `registration_time[|=]` For example: `registration_time>=1433116800` Returns beacons whose registration time matches the given filter. Supports the operators: , =. Timestamp must be expressed as an integer number of seconds since midnight January 1, 1970 UTC. Accepts at most two filters that will be combined with AND logic, to support "between" semantics. If more than two are supplied, the latter ones are ignored. * `lat: lng: radius:` For example: `lat:51.1232343 lng:-1.093852 radius:1000` Returns beacons whose registered location is within the given circle. When any of these fields are given, all are required. Latitude and longitude must be decimal degrees between -90.0 and 90.0 and between -180.0 and 180.0 respectively. Radius must be an integer number of meters between 10 and 1,000,000 (1000 km). * `property:"="` For example: `property:"battery-type=CR2032"` Returns beacons which have a property of the given name and value. Supports multiple filters which will be combined with OR logic. The entire name=value string must be double-quoted as one string. * `attachment_type:""` For example: `attachment_type:"my-namespace/my-type"` Returns beacons having at least one attachment of the given namespaced type. Supports "any within this namespace" via the partial wildcard syntax: "my-namespace/*". Supports multiple filters which will be combined with OR logic. The string must be double-quoted. Multiple filters on the same field are combined with OR logic (except registration_time which is combined with AND logic). Multiple filters on different fields are combined with AND logic. Filters should be separated by spaces. As with any HTTP query string parameter, the whole filter expression must be URL-encoded. Example REST request: `GET /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000` + /// Filter query string that supports the following field filters: + /// + /// * **description:`""`** + /// For example: **description:"Room 3"** + /// Returns beacons whose description matches tokens in the string "Room 3" + /// (not necessarily that exact string). + /// The string must be double-quoted. + /// * **status:``** + /// For example: **status:active** + /// Returns beacons whose status matches the given value. Values must be + /// one of the Beacon.Status enum values (case insensitive). Accepts + /// multiple filters which will be combined with OR logic. + /// * **stability:``** + /// For example: **stability:mobile** + /// Returns beacons whose expected stability matches the given value. + /// Values must be one of the Beacon.Stability enum values (case + /// insensitive). Accepts multiple filters which will be combined with + /// OR logic. + /// * **place\_id:`""`** + /// For example: **place\_id:"ChIJVSZzVR8FdkgRXGmmm6SslKw="** + /// Returns beacons explicitly registered at the given place, expressed as + /// a Place ID obtained from [Google Places API](/places/place-id). Does not + /// match places inside the given place. Does not consider the beacon's + /// actual location (which may be different from its registered place). + /// Accepts multiple filters that will be combined with OR logic. The place + /// ID must be double-quoted. + /// * **registration\_time`[<|>|<=|>=]`** + /// For example: **registration\_time>=1433116800** + /// Returns beacons whose registration time matches the given filter. + /// Supports the operators: <, >, <=, and >=. Timestamp must be expressed as + /// an integer number of seconds since midnight January 1, 1970 UTC. Accepts + /// at most two filters that will be combined with AND logic, to support + /// "between" semantics. If more than two are supplied, the latter ones are + /// ignored. + /// * **lat:` lng: radius:`** + /// For example: **lat:51.1232343 lng:-1.093852 radius:1000** + /// Returns beacons whose registered location is within the given circle. + /// When any of these fields are given, all are required. Latitude and + /// longitude must be decimal degrees between -90.0 and 90.0 and between + /// -180.0 and 180.0 respectively. Radius must be an integer number of + /// meters between 10 and 1,000,000 (1000 km). + /// * **property:`"="`** + /// For example: **property:"battery-type=CR2032"** + /// Returns beacons which have a property of the given name and value. + /// Supports multiple filters which will be combined with OR logic. + /// The entire name=value string must be double-quoted as one string. + /// * **attachment\_type:`""`** + /// For example: **attachment_type:"my-namespace/my-type"** + /// Returns beacons having at least one attachment of the given namespaced + /// type. Supports "any within this namespace" via the partial wildcard + /// syntax: "my-namespace/*". Supports multiple filters which will be + /// combined with OR logic. The string must be double-quoted. + /// * **indoor\_level:`""`** + /// For example: **indoor\_level:"1"** + /// Returns beacons which are located on the given indoor level. Accepts + /// multiple filters that will be combined with OR logic. + /// + /// Multiple filters on the same field are combined with OR logic (except + /// registration_time which is combined with AND logic). + /// Multiple filters on different fields are combined with AND logic. + /// Filters should be separated by spaces. + /// + /// As with any HTTP query string parameter, the whole filter expression must + /// be URL-encoded. + /// + /// Example REST request: + /// `GET /v1beta1/beacons?q=status:active%20lat:51.123%20lng:-1.095%20radius:1000` /// /// Sets the *q* query property to the given value. pub fn q(mut self, new_value: &str) -> BeaconListCall<'a, C, A> { self._q = Some(new_value.to_string()); self } - /// The project id to list beacons under. If not present then the project credential that made the request is used as the project. Optional. + /// The project id to list beacons under. If not present then the project + /// credential that made the request is used as the project. + /// Optional. /// /// Sets the *project id* query property to the given value. pub fn project_id(mut self, new_value: &str) -> BeaconListCall<'a, C, A> { @@ -2824,7 +3361,8 @@ impl<'a, C, A> BeaconListCall<'a, C, A> where C: BorrowMut, A: oa self._page_token = Some(new_value.to_string()); self } - /// The maximum number of records to return for this request, up to a server-defined upper limit. + /// The maximum number of records to return for this request, up to a + /// server-defined upper limit. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> BeaconListCall<'a, C, A> { @@ -2856,12 +3394,12 @@ impl<'a, C, A> BeaconListCall<'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) -> BeaconListCall<'a, C, A> @@ -2889,7 +3427,17 @@ impl<'a, C, A> BeaconListCall<'a, C, A> where C: BorrowMut, A: oa } -/// Updates the information about the specified beacon. **Any field that you do not populate in the submitted beacon will be permanently erased**, so you should follow the "read, modify, write" pattern to avoid inadvertently destroying data. Changes to the beacon status via this method will be silently ignored. To update beacon status, use the separate methods on this API for activation, deactivation, and decommissioning. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. +/// Updates the information about the specified beacon. **Any field that you do +/// not populate in the submitted beacon will be permanently erased**, so you +/// should follow the "read, modify, write" pattern to avoid inadvertently +/// destroying data. +/// +/// Changes to the beacon status via this method will be silently ignored. +/// To update beacon status, use the separate methods on this API for +/// activation, deactivation, and decommissioning. +/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) +/// from a signed-in user with **Is owner** or **Can edit** permissions in the +/// Google Developers Console project. /// /// A builder for the *update* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -2972,7 +3520,7 @@ impl<'a, C, A> BeaconUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+beaconName}"; + let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+beaconName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -3102,7 +3650,13 @@ impl<'a, C, A> BeaconUpdateCall<'a, C, A> where C: BorrowMut, A: self._request = new_value; self } - /// Resource name of this beacon. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. This field must be left empty when registering. After reading a beacon, clients can use the name for future operations. + /// Resource name of this beacon. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone, `1` for iBeacon, or `5` for AltBeacon. + /// + /// This field must be left empty when registering. After reading a beacon, + /// clients can use the name for future operations. /// /// Sets the *beacon name* path property to the given value. /// @@ -3112,7 +3666,10 @@ impl<'a, C, A> BeaconUpdateCall<'a, C, A> where C: BorrowMut, A: self._beacon_name = new_value.to_string(); self } - /// The project id of the beacon to update. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + /// The project id of the beacon to update. If the project id is not + /// specified then the project making the request is used. The project id + /// must match the project that owns the beacon. + /// Optional. /// /// Sets the *project id* query property to the given value. pub fn project_id(mut self, new_value: &str) -> BeaconUpdateCall<'a, C, A> { @@ -3144,12 +3701,12 @@ impl<'a, C, A> BeaconUpdateCall<'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) -> BeaconUpdateCall<'a, C, A> @@ -3177,7 +3734,15 @@ impl<'a, C, A> BeaconUpdateCall<'a, C, A> where C: BorrowMut, A: } -/// Deletes the specified attachment for the given beacon. Each attachment has a unique attachment name (`attachmentName`) which is returned when you fetch the attachment data via this API. You specify this with the delete request to control which attachment is removed. This operation cannot be undone. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. +/// Deletes the specified attachment for the given beacon. Each attachment has +/// a unique attachment name (`attachmentName`) which is returned when you +/// fetch the attachment data via this API. You specify this with the delete +/// request to control which attachment is removed. This operation cannot be +/// undone. +/// +/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) +/// from a signed-in user with **Is owner** or **Can edit** permissions in the +/// Google Developers Console project. /// /// A builder for the *attachments.delete* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -3253,7 +3818,7 @@ impl<'a, C, A> BeaconAttachmentDeleteCall<'a, C, A> where C: BorrowMut BeaconAttachmentDeleteCall<'a, C, A> where C: BorrowMut BeaconAttachmentDeleteCall<'a, C, A> where C: BorrowMut BeaconAttachmentDeleteCall<'a, C, A> { @@ -3401,12 +3973,12 @@ impl<'a, C, A> BeaconAttachmentDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconAttachmentDeleteCall<'a, C, A> @@ -3434,7 +4006,14 @@ impl<'a, C, A> BeaconAttachmentDeleteCall<'a, C, A> where C: BorrowMut BeaconDeactivateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+beaconName}:deactivate"; + let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+beaconName}:deactivate".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -3616,7 +4195,13 @@ impl<'a, C, A> BeaconDeactivateCall<'a, C, A> where C: BorrowMut, } - /// Beacon that should be deactivated. A beacon name has the format "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by the beacon and N is a code for the beacon's type. Possible values are `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` for AltBeacon. For Eddystone-EID beacons, you may use either the current EID or the beacon's "stable" UID. Required. + /// Beacon that should be deactivated. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. /// /// Sets the *beacon name* path property to the given value. /// @@ -3626,7 +4211,10 @@ impl<'a, C, A> BeaconDeactivateCall<'a, C, A> where C: BorrowMut, self._beacon_name = new_value.to_string(); self } - /// The project id of the beacon to deactivate. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + /// The project id of the beacon to deactivate. If the project id is not + /// specified then the project making the request is used. The project id must + /// match the project that owns the beacon. + /// Optional. /// /// Sets the *project id* query property to the given value. pub fn project_id(mut self, new_value: &str) -> BeaconDeactivateCall<'a, C, A> { @@ -3658,12 +4246,12 @@ impl<'a, C, A> BeaconDeactivateCall<'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) -> BeaconDeactivateCall<'a, C, A> @@ -3691,7 +4279,12 @@ impl<'a, C, A> BeaconDeactivateCall<'a, C, A> where C: BorrowMut, } -/// Registers a previously unregistered beacon given its `advertisedId`. These IDs are unique within the system. An ID can be registered only once. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **Is owner** or **Can edit** permissions in the Google Developers Console project. +/// Registers a previously unregistered beacon given its `advertisedId`. +/// These IDs are unique within the system. An ID can be registered only once. +/// +/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) +/// from a signed-in user with **Is owner** or **Can edit** permissions in the +/// Google Developers Console project. /// /// A builder for the *register* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -3771,7 +4364,7 @@ impl<'a, C, A> BeaconRegisterCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/beacons:register"; + let mut url = "https://proximitybeacon.googleapis.com/v1beta1/beacons:register".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -3877,7 +4470,10 @@ impl<'a, C, A> BeaconRegisterCall<'a, C, A> where C: BorrowMut, A self._request = new_value; self } - /// The project id of the project the beacon will be registered to. If the project id is not specified then the project making the request is used. Optional. + /// The project id of the project the beacon will be registered to. If + /// the project id is not specified then the project making the request + /// is used. + /// Optional. /// /// Sets the *project id* query property to the given value. pub fn project_id(mut self, new_value: &str) -> BeaconRegisterCall<'a, C, A> { @@ -3909,12 +4505,12 @@ impl<'a, C, A> BeaconRegisterCall<'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) -> BeaconRegisterCall<'a, C, A> @@ -3942,7 +4538,284 @@ impl<'a, C, A> BeaconRegisterCall<'a, C, A> where C: BorrowMut, A } -/// List the diagnostics for a single beacon. You can also list diagnostics for all the beacons owned by your Google Developers Console project by using the beacon name `beacons/-`. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project. +/// Deletes the specified beacon including all diagnostics data for the beacon +/// as well as any attachments on the beacon (including those belonging to +/// other projects). This operation cannot be undone. +/// +/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) +/// from a signed-in user with **Is owner** or **Can edit** permissions in the +/// Google Developers Console project. +/// +/// A builder for the *delete* method supported by a *beacon* resource. +/// It is not used directly, but through a `BeaconMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_proximitybeacon1_beta1 as proximitybeacon1_beta1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use proximitybeacon1_beta1::Proximitybeacon; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Proximitybeacon::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.beacons().delete("beaconName") +/// .project_id("elitr") +/// .doit(); +/// # } +/// ``` +pub struct BeaconDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Proximitybeacon, + _beacon_name: String, + _project_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BeaconDeleteCall<'a, C, A> {} + +impl<'a, C, A> BeaconDeleteCall<'a, C, 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: "proximitybeacon.beacons.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("beaconName", self._beacon_name.to_string())); + if let Some(value) = self._project_id { + params.push(("projectId", value.to_string())); + } + for &field in ["alt", "beaconName", "projectId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+beaconName}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+beaconName}", "beaconName")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), DEFAULT_ENCODE_SET); + } + url = url.replace(find_this, &replace_with); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["beaconName"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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) + } + } + } + } + + + /// Beacon that should be deleted. A beacon name has the format + /// "beacons/N!beaconId" where the beaconId is the base16 ID broadcast by + /// the beacon and N is a code for the beacon's type. Possible values are + /// `3` for Eddystone-UID, `4` for Eddystone-EID, `1` for iBeacon, or `5` + /// for AltBeacon. For Eddystone-EID beacons, you may use either the + /// current EID or the beacon's "stable" UID. + /// Required. + /// + /// Sets the *beacon name* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn beacon_name(mut self, new_value: &str) -> BeaconDeleteCall<'a, C, A> { + self._beacon_name = new_value.to_string(); + self + } + /// The project id of the beacon to delete. If not provided, the project + /// that is making the request is used. + /// Optional. + /// + /// Sets the *project id* query property to the given value. + pub fn project_id(mut self, new_value: &str) -> BeaconDeleteCall<'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) -> BeaconDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *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> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::UserlocationBeaconRegistry`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> BeaconDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// List the diagnostics for a single beacon. You can also list diagnostics for +/// all the beacons owned by your Google Developers Console project by using +/// the beacon name `beacons/-`. +/// +/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) +/// from a signed-in user with **viewer**, **Is owner** or **Can edit** +/// permissions in the Google Developers Console project. /// /// A builder for the *diagnostics.list* method supported by a *beacon* resource. /// It is not used directly, but through a `BeaconMethods` instance. @@ -3969,10 +4842,10 @@ impl<'a, C, A> BeaconRegisterCall<'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.beacons().diagnostics_list("beaconName") -/// .project_id("elitr") -/// .page_token("amet") -/// .page_size(-60) -/// .alert_filter("labore") +/// .project_id("no") +/// .page_token("labore") +/// .page_size(-39) +/// .alert_filter("dolore") /// .doit(); /// # } /// ``` @@ -4033,7 +4906,7 @@ impl<'a, C, A> BeaconDiagnosticListCall<'a, C, A> where C: BorrowMut BeaconDiagnosticListCall<'a, C, A> where C: BorrowMut BeaconDiagnosticListCall<'a, C, A> { self._project_id = Some(new_value.to_string()); self } - /// Requests results that occur after the `page_token`, obtained from the response to a previous request. Optional. + /// Requests results that occur after the `page_token`, obtained from the + /// response to a previous request. Optional. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> BeaconDiagnosticListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Specifies the maximum number of results to return. Defaults to 10. Maximum 1000. Optional. + /// Specifies the maximum number of results to return. Defaults to + /// 10. Maximum 1000. Optional. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> BeaconDiagnosticListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// Requests only beacons that have the given alert. For example, to find beacons that have low batteries use `alert_filter=LOW_BATTERY`. + /// Requests only beacons that have the given alert. For example, to find + /// beacons that have low batteries use `alert_filter=LOW_BATTERY`. /// /// Sets the *alert filter* query property to the given value. pub fn alert_filter(mut self, new_value: &str) -> BeaconDiagnosticListCall<'a, C, A> { @@ -4202,12 +5080,12 @@ impl<'a, C, A> BeaconDiagnosticListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconDiagnosticListCall<'a, C, A> @@ -4235,7 +5113,17 @@ impl<'a, C, A> BeaconDiagnosticListCall<'a, C, A> where C: BorrowMut BeaconDiagnosticListCall<'a, C, A> where C: BorrowMut BeaconAttachmentBatchDeleteCall<'a, C, A> where C: BorrowMut BeaconAttachmentBatchDeleteCall<'a, C, A> where C: BorrowMut BeaconAttachmentBatchDeleteCall<'a, C, A> where C: BorrowMut BeaconAttachmentBatchDeleteCall<'a, C, A> { self._project_id = Some(new_value.to_string()); self } - /// Specifies the namespace and type of attachments to delete in `namespace/type` format. Accepts `*/*` to specify "all types in all namespaces". Optional. + /// Specifies the namespace and type of attachments to delete in + /// `namespace/type` format. Accepts `*/*` to specify + /// "all types in all namespaces". + /// Optional. /// /// Sets the *namespaced type* query property to the given value. pub fn namespaced_type(mut self, new_value: &str) -> BeaconAttachmentBatchDeleteCall<'a, C, A> { @@ -4471,12 +5373,12 @@ impl<'a, C, A> BeaconAttachmentBatchDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconAttachmentBatchDeleteCall<'a, C, A> @@ -4504,7 +5406,10 @@ impl<'a, C, A> BeaconAttachmentBatchDeleteCall<'a, C, A> where C: BorrowMut BeaconinfoGetforobservedCall<'a, C, A> where C: BorrowMut BeaconinfoGetforobservedCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> BeaconinfoGetforobservedCall<'a, C, A> @@ -4721,7 +5626,13 @@ impl<'a, C, A> BeaconinfoGetforobservedCall<'a, C, A> where C: BorrowMut MethodGetEidparamCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/eidparams"; + let mut url = "https://proximitybeacon.googleapis.com/v1beta1/eidparams".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -4896,12 +5807,12 @@ impl<'a, C, A> MethodGetEidparamCall<'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) -> MethodGetEidparamCall<'a, C, A> @@ -4929,7 +5840,13 @@ impl<'a, C, A> MethodGetEidparamCall<'a, C, A> where C: BorrowMut } -/// Lists all attachment namespaces owned by your Google Developers Console project. Attachment data associated with a beacon must include a namespaced type, and the namespace must be owned by your project. Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) from a signed-in user with **viewer**, **Is owner** or **Can edit** permissions in the Google Developers Console project. +/// Lists all attachment namespaces owned by your Google Developers Console +/// project. Attachment data associated with a beacon must include a +/// namespaced type, and the namespace must be owned by your project. +/// +/// Authenticate using an [OAuth access token](https://developers.google.com/identity/protocols/OAuth2) +/// from a signed-in user with **viewer**, **Is owner** or **Can edit** +/// permissions in the Google Developers Console project. /// /// A builder for the *list* method supported by a *namespace* resource. /// It is not used directly, but through a `NamespaceMethods` instance. @@ -4956,7 +5873,7 @@ impl<'a, C, A> MethodGetEidparamCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.namespaces().list() -/// .project_id("aliquyam") +/// .project_id("Lorem") /// .doit(); /// # } /// ``` @@ -5002,7 +5919,7 @@ impl<'a, C, A> NamespaceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/namespaces"; + let mut url = "https://proximitybeacon.googleapis.com/v1beta1/namespaces".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -5084,7 +6001,8 @@ impl<'a, C, A> NamespaceListCall<'a, C, A> where C: BorrowMut, A: } - /// The project id to list namespaces under. Optional. + /// The project id to list namespaces under. + /// Optional. /// /// Sets the *project id* query property to the given value. pub fn project_id(mut self, new_value: &str) -> NamespaceListCall<'a, C, A> { @@ -5116,12 +6034,12 @@ impl<'a, C, A> NamespaceListCall<'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) -> NamespaceListCall<'a, C, A> @@ -5149,7 +6067,8 @@ impl<'a, C, A> NamespaceListCall<'a, C, A> where C: BorrowMut, A: } -/// Updates the information about the specified namespace. Only the namespace visibility can be updated. +/// Updates the information about the specified namespace. Only the namespace +/// visibility can be updated. /// /// A builder for the *update* method supported by a *namespace* resource. /// It is not used directly, but through a `NamespaceMethods` instance. @@ -5182,7 +6101,7 @@ impl<'a, C, A> NamespaceListCall<'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.namespaces().update(req, "namespaceName") -/// .project_id("Lorem") +/// .project_id("et") /// .doit(); /// # } /// ``` @@ -5232,7 +6151,7 @@ impl<'a, C, A> NamespaceUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta1/{+namespaceName}"; + let mut url = "https://proximitybeacon.googleapis.com/v1beta1/{+namespaceName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::UserlocationBeaconRegistry.as_ref().to_string(), ()); } @@ -5362,7 +6281,8 @@ impl<'a, C, A> NamespaceUpdateCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// Resource name of this namespace. Namespaces names have the format: namespaces/namespace. + /// Resource name of this namespace. Namespaces names have the format: + /// namespaces/namespace. /// /// Sets the *namespace name* path property to the given value. /// @@ -5372,7 +6292,10 @@ impl<'a, C, A> NamespaceUpdateCall<'a, C, A> where C: BorrowMut, self._namespace_name = new_value.to_string(); self } - /// The project id of the namespace to update. If the project id is not specified then the project making the request is used. The project id must match the project that owns the beacon. Optional. + /// The project id of the namespace to update. If the project id is not + /// specified then the project making the request is used. The project id + /// must match the project that owns the beacon. + /// Optional. /// /// Sets the *project id* query property to the given value. pub fn project_id(mut self, new_value: &str) -> NamespaceUpdateCall<'a, C, A> { @@ -5404,12 +6327,12 @@ impl<'a, C, A> NamespaceUpdateCall<'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) -> NamespaceUpdateCall<'a, C, A> @@ -5437,3 +6360,4 @@ impl<'a, C, A> NamespaceUpdateCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/pubsub1-cli/Cargo.toml b/gen/pubsub1-cli/Cargo.toml index 799e524048..c97d86474a 100644 --- a/gen/pubsub1-cli/Cargo.toml +++ b/gen/pubsub1-cli/Cargo.toml @@ -4,9 +4,9 @@ [package] name = "google-pubsub1-cli" -version = "1.0.4+20161122" +version = "1.0.4+20170502" authors = ["Sebastian Thiel "] -description = "A complete library to interact with pubsub (protocol v1)" +description = "A complete library to interact with Pubsub (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1-cli" homepage = "https://cloud.google.com/pubsub/docs" documentation = "http://byron.github.io/google-apis-rs/google_pubsub1_cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-pubsub1] path = "../pubsub1" -version = "1.0.4+20161122" +version = "1.0.4+20170502" diff --git a/gen/pubsub1-cli/README.md b/gen/pubsub1-cli/README.md index 7fb3214b68..883086c05e 100644 --- a/gen/pubsub1-cli/README.md +++ b/gen/pubsub1-cli/README.md @@ -3,14 +3,14 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `pubsub1` command-line interface *(CLI)* allows to use most features of the *Google pubsub* service from the comfort of your terminal. +The `pubsub1` command-line interface *(CLI)* allows to use most features of the *Google Pubsub* 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 *pubsub* API can be found at the +Everything else about the *Pubsub* API can be found at the [official documentation site](https://cloud.google.com/pubsub/docs). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *pubsub* API at revision *20161122*. The CLI is at version *1.0.4*. +This documentation was generated from the *Pubsub* API at revision *20170502*. The CLI is at version *1.0.4*. ```bash pubsub1 [options] diff --git a/gen/pubsub1-cli/mkdocs.yml b/gen/pubsub1-cli/mkdocs.yml index d266bdd505..5bbf03c4c8 100644 --- a/gen/pubsub1-cli/mkdocs.yml +++ b/gen/pubsub1-cli/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: pubsub v1.0.4+20161122 +site_name: Pubsub v1.0.4+20170502 site_url: http://byron.github.io/google-apis-rs/google-pubsub1-cli -site_description: A complete library to interact with pubsub (protocol v1) +site_description: A complete library to interact with Pubsub (protocol v1) repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1-cli diff --git a/gen/pubsub1-cli/src/main.rs b/gen/pubsub1-cli/src/main.rs index d4a78eed6e..29916a2ee3 100644 --- a/gen/pubsub1-cli/src/main.rs +++ b/gen/pubsub1-cli/src/main.rs @@ -1879,8 +1879,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1904,8 +1903,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being specified. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1928,14 +1926,19 @@ fn main() { Some(false)), ]), ("snapshots-test-iam-permissions", - Some(r##"Returns permissions that a caller has on the specified resource."##), + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_snapshots-test-iam-permissions", vec![ (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy detail is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2093,8 +2096,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2240,8 +2242,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being specified. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2264,14 +2265,19 @@ fn main() { Some(false)), ]), ("subscriptions-test-iam-permissions", - Some(r##"Returns permissions that a caller has on the specified resource."##), + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_subscriptions-test-iam-permissions", vec![ (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy detail is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2385,8 +2391,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2464,8 +2469,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being specified. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2511,14 +2515,19 @@ fn main() { Some(false)), ]), ("topics-test-iam-permissions", - Some(r##"Returns permissions that a caller has on the specified resource."##), + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_cli/projects_topics-test-iam-permissions", vec![ (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy detail is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2546,7 +2555,7 @@ fn main() { let mut app = App::new("pubsub1") .author("Sebastian Thiel ") - .version("1.0.4+20161122") + .version("1.0.4+20170502") .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 04a00dc4e1..2dba53ffd0 100644 --- a/gen/pubsub1/Cargo.toml +++ b/gen/pubsub1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-pubsub1" -version = "1.0.4+20161122" +version = "1.0.4+20170502" authors = ["Sebastian Thiel "] -description = "A complete library to interact with pubsub (protocol v1)" +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.4+20161122" +documentation = "https://docs.rs/google-pubsub1/1.0.4+20170502" license = "MIT" keywords = ["pubsub", "google", "protocol", "web", "api"] diff --git a/gen/pubsub1/README.md b/gen/pubsub1/README.md index c0c50de48d..36218ab8db 100644 --- a/gen/pubsub1/README.md +++ b/gen/pubsub1/README.md @@ -3,18 +3,18 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-pubsub1` library allows access to all features of the *Google pubsub* service. +The `google-pubsub1` library allows access to all features of the *Google Pubsub* service. -This documentation was generated from *pubsub* crate version *1.0.4+20161122*, where *20161122* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Pubsub* crate version *1.0.4+20170502*, where *20170502* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. -Everything else about the *pubsub* *v1* API can be found at the +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.4+20161122/google_pubsub1/struct.Pubsub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.Pubsub.html) ... * projects - * [*snapshots get iam policy*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSnapshotGetIamPolicyCall.html), [*snapshots set iam policy*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSnapshotSetIamPolicyCall.html), [*snapshots test iam permissions*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSnapshotTestIamPermissionCall.html), [*subscriptions acknowledge*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/struct.ProjectTopicTestIamPermissionCall.html) + * [*snapshots get iam policy*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSnapshotGetIamPolicyCall.html), [*snapshots set iam policy*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSnapshotSetIamPolicyCall.html), [*snapshots test iam permissions*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSnapshotTestIamPermissionCall.html), [*subscriptions acknowledge*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1/1.0.4+20170502/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.4+20161122/google_pubsub1/struct.Pubsub.html)** +* **[Hub](https://docs.rs/google-pubsub1/1.0.4+20170502/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.4+20161122/google_pubsub1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pubsub1/1.0.4+20170502/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.4+20161122/google_pubsub1/trait.Part.html)** + * **[Parts](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-pubsub1/1.0.4+20161122/google_pubsub1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pubsub1/1.0.4+20170502/google_pubsub1/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/1.0.4+20161122/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.4+20170502/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.4+20161122/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.4+20170502/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.4+20161122/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.4+20170502/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.4+20161122/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.4+20170502/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")`. @@ -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/1.0.4+20161122/google_pubsub1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-pubsub1/1.0.4+20161122/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.4+20170502/google_pubsub1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pubsub1/1.0.4+20170502/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.4+20161122/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.4+20170502/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.4+20161122/google_pubsub1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-pubsub1/1.0.4+20161122/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.4+20170502/google_pubsub1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pubsub1/1.0.4+20170502/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.4+20161122/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.4+20170502/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.4+20161122/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.4+20170502/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.4+20161122/google_pubsub1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pubsub1/1.0.4+20170502/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 95c4959299..891ca52054 100644 --- a/gen/pubsub1/src/lib.rs +++ b/gen/pubsub1/src/lib.rs @@ -2,9 +2,9 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *pubsub* crate version *1.0.4+20161122*, where *20161122* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Pubsub* crate version *1.0.4+20170502*, where *20170502* is the exact revision of the *pubsub:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! -//! Everything else about the *pubsub* *v1* API can be found at the +//! Everything else about the *Pubsub* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/pubsub/docs). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1). //! # Features @@ -181,7 +181,7 @@ // 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 +// 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)] @@ -316,8 +316,6 @@ pub struct Pubsub { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Pubsub {} @@ -330,8 +328,6 @@ impl<'a, C, A> Pubsub client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://pubsub.googleapis.com/".to_string(), - _root_url: "https://pubsub.googleapis.com/".to_string(), } } @@ -348,26 +344,6 @@ impl<'a, C, A> Pubsub self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://pubsub.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://pubsub.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -491,10 +467,12 @@ impl RequestValue for AcknowledgeRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ModifyAckDeadlineRequest { /// The new ack deadline with respect to the time this request was sent to - /// the Pub/Sub system. Must be >= 0. For example, if the value is 10, the new + /// the Pub/Sub system. For example, if the value is 10, the new /// ack deadline will expire 10 seconds after the `ModifyAckDeadline` call /// was made. Specifying zero may immediately make the message available for /// another pull request. + /// The minimum deadline you can specify is 0 seconds. + /// The maximum deadline you can specify is 600 seconds (10 minutes). #[serde(rename="ackDeadlineSeconds")] pub ack_deadline_seconds: Option, /// List of acknowledgment IDs. @@ -719,11 +697,12 @@ impl ResponseResult for TestIamPermissionsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct PullRequest { - /// If this is specified as true the system will respond immediately even if - /// it is not able to return a message in the `Pull` response. Otherwise the - /// system is allowed to wait until at least one message is available rather - /// than returning no messages. The client may cancel the request if it does - /// not wish to wait any longer for the response. + /// If this field set to true, the system will respond immediately even if + /// it there are no messages available to return in the `Pull` response. + /// Otherwise, the system may wait (for a bounded amount of time) until at + /// least one message is available, rather than returning no messages. The + /// client may cancel the request if it does not wish to wait any longer for + /// the response. #[serde(rename="returnImmediately")] pub return_immediately: Option, /// The maximum number of messages returned for this request. The Pub/Sub @@ -747,11 +726,10 @@ pub struct PushConfig { /// 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 + /// use to change the format of the pushed message. This attribute /// indicates the version of the data expected by the endpoint. This - /// controls the shape of the envelope (i.e. its fields and metadata). - /// The endpoint version is based on the version of the Pub/Sub - /// API. + /// controls the shape of the pushed message (i.e., its fields and metadata). + /// The endpoint version is based on the version of the Pub/Sub API. /// /// If not present during the `CreateSubscription` call, it will default to /// the version of the API used to make such call. If not present during a @@ -1053,13 +1031,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. /// /// # Arguments /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn topics_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectTopicTestIamPermissionCall<'a, C, A> { ProjectTopicTestIamPermissionCall { hub: self.hub, @@ -1074,13 +1057,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. /// /// # Arguments /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn subscriptions_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectSubscriptionTestIamPermissionCall<'a, C, A> { ProjectSubscriptionTestIamPermissionCall { hub: self.hub, @@ -1095,13 +1083,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. /// /// # Arguments /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn snapshots_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectSnapshotTestIamPermissionCall<'a, C, A> { ProjectSnapshotTestIamPermissionCall { hub: self.hub, @@ -1170,8 +1163,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn snapshots_get_iam_policy(&self, resource: &str) -> ProjectSnapshotGetIamPolicyCall<'a, C, A> { ProjectSnapshotGetIamPolicyCall { hub: self.hub, @@ -1215,8 +1207,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn topics_get_iam_policy(&self, resource: &str) -> ProjectTopicGetIamPolicyCall<'a, C, A> { ProjectTopicGetIamPolicyCall { hub: self.hub, @@ -1284,8 +1275,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn subscriptions_get_iam_policy(&self, resource: &str) -> ProjectSubscriptionGetIamPolicyCall<'a, C, A> { ProjectSubscriptionGetIamPolicyCall { hub: self.hub, @@ -1365,8 +1355,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn topics_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectTopicSetIamPolicyCall<'a, C, A> { ProjectTopicSetIamPolicyCall { hub: self.hub, @@ -1442,8 +1431,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn snapshots_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSnapshotSetIamPolicyCall<'a, C, A> { ProjectSnapshotSetIamPolicyCall { hub: self.hub, @@ -1502,8 +1490,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn subscriptions_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSubscriptionSetIamPolicyCall<'a, C, A> { ProjectSubscriptionSetIamPolicyCall { hub: self.hub, @@ -1605,7 +1592,7 @@ impl<'a, C, A> ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + let mut url = "https://pubsub.googleapis.com/v1/{+resource}:testIamPermissions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2564,8 +2562,7 @@ impl<'a, C, A> ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro self } /// REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. /// /// Sets the *resource* path property to the given value. /// @@ -2634,6 +2631,12 @@ impl<'a, C, A> ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro /// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. /// /// A builder for the *snapshots.testIamPermissions* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -2711,7 +2714,7 @@ impl<'a, C, A> ProjectSnapshotTestIamPermissionCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resource}:testIamPermissions"; + let mut url = "https://pubsub.googleapis.com/v1/{+resource}:testIamPermissions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2842,8 +2845,7 @@ impl<'a, C, A> ProjectSnapshotTestIamPermissionCall<'a, C, A> where C: BorrowMut self } /// REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. /// /// Sets the *resource* path property to the given value. /// @@ -2992,7 +2994,7 @@ impl<'a, C, A> ProjectSubscriptionPullCall<'a, C, A> where C: BorrowMut ProjectSubscriptionModifyPushConfigCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+subscription}:modifyPushConfig"; + let mut url = "https://pubsub.googleapis.com/v1/{+subscription}:modifyPushConfig".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3546,7 +3548,7 @@ impl<'a, C, A> ProjectSnapshotGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSnapshotGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+subscription}:modifyAckDeadline"; + let mut url = "https://pubsub.googleapis.com/v1/{+subscription}:modifyAckDeadline".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4076,7 +4077,7 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSubscriptionAcknowledgeCall<'a, C, A> where C: BorrowMut ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resource}:getIamPolicy"; + let mut url = "https://pubsub.googleapis.com/v1/{+resource}:getIamPolicy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4965,8 +4965,7 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< /// REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. /// /// Sets the *resource* path property to the given value. /// @@ -5115,7 +5114,7 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+project}/topics"; + let mut url = "https://pubsub.googleapis.com/v1/{+project}/topics".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5386,7 +5385,7 @@ impl<'a, C, A> ProjectTopicPublishCall<'a, C, A> where C: BorrowMut ProjectTopicGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+topic}"; + let mut url = "https://pubsub.googleapis.com/v1/{+topic}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5910,7 +5909,7 @@ impl<'a, C, A> ProjectTopicSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut ProjectSnapshotSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSnapshotSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+resource}:setIamPolicy"; + let mut url = "https://pubsub.googleapis.com/v1/{+resource}:setIamPolicy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7657,8 +7654,7 @@ impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< self } /// REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. /// /// Sets the *resource* path property to the given value. /// @@ -7726,3 +7722,4 @@ impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< } + diff --git a/gen/pubsub1_beta2-cli/Cargo.toml b/gen/pubsub1_beta2-cli/Cargo.toml index a593308047..15712d90eb 100644 --- a/gen/pubsub1_beta2-cli/Cargo.toml +++ b/gen/pubsub1_beta2-cli/Cargo.toml @@ -4,9 +4,9 @@ [package] name = "google-pubsub1_beta2-cli" -version = "1.0.4+20161122" +version = "1.0.4+20170502" authors = ["Sebastian Thiel "] -description = "A complete library to interact with pubsub (protocol v1beta2)" +description = "A complete library to interact with Pubsub (protocol v1beta2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2-cli" homepage = "https://cloud.google.com/pubsub/docs" documentation = "http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-pubsub1_beta2] path = "../pubsub1_beta2" -version = "1.0.4+20161122" +version = "1.0.4+20170502" diff --git a/gen/pubsub1_beta2-cli/README.md b/gen/pubsub1_beta2-cli/README.md index 517f81d8fd..6362a64132 100644 --- a/gen/pubsub1_beta2-cli/README.md +++ b/gen/pubsub1_beta2-cli/README.md @@ -3,14 +3,14 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/cli/README.md.mako' DO NOT EDIT ! --> -The `pubsub1-beta2` command-line interface *(CLI)* allows to use most features of the *Google pubsub* service from the comfort of your terminal. +The `pubsub1-beta2` command-line interface *(CLI)* allows to use most features of the *Google Pubsub* 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 *pubsub* API can be found at the +Everything else about the *Pubsub* API can be found at the [official documentation site](https://cloud.google.com/pubsub/docs). # Installation and Source Code @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *pubsub* API at revision *20161122*. The CLI is at version *1.0.4*. +This documentation was generated from the *Pubsub* API at revision *20170502*. The CLI is at version *1.0.4*. ```bash pubsub1-beta2 [options] diff --git a/gen/pubsub1_beta2-cli/mkdocs.yml b/gen/pubsub1_beta2-cli/mkdocs.yml index 17e773844a..8d7ea150b5 100644 --- a/gen/pubsub1_beta2-cli/mkdocs.yml +++ b/gen/pubsub1_beta2-cli/mkdocs.yml @@ -1,6 +1,6 @@ -site_name: pubsub v1.0.4+20161122 +site_name: Pubsub v1.0.4+20170502 site_url: http://byron.github.io/google-apis-rs/google-pubsub1_beta2-cli -site_description: A complete library to interact with pubsub (protocol v1beta2) +site_description: A complete library to interact with Pubsub (protocol v1beta2) repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2-cli diff --git a/gen/pubsub1_beta2-cli/src/main.rs b/gen/pubsub1_beta2-cli/src/main.rs index 1fec043267..455bc3646f 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()[..] { - "topic" => Some(("topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "ack-deadline-seconds" => Some(("ackDeadlineSeconds", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "topic" => Some(("topic", JsonTypeInfo { jtype: JsonType::String, 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 })), @@ -1769,8 +1769,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1912,8 +1911,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being specified. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -1936,14 +1934,19 @@ fn main() { Some(false)), ]), ("subscriptions-test-iam-permissions", - Some(r##"Returns permissions that a caller has on the specified resource."##), + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_subscriptions-test-iam-permissions", vec![ (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy detail is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2055,8 +2058,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2132,8 +2134,7 @@ fn main() { (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy is being specified. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2178,14 +2179,19 @@ fn main() { Some(false)), ]), ("topics-test-iam-permissions", - Some(r##"Returns permissions that a caller has on the specified resource."##), + Some(r##"Returns permissions that a caller has on the specified resource. + If the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. + + Note: This operation is designed to be used for building permission-aware + UIs and command-line tools, not for authorization checking. This operation + may "fail open" without warning."##), "Details at http://byron.github.io/google-apis-rs/google_pubsub1_beta2_cli/projects_topics-test-iam-permissions", vec![ (Some(r##"resource"##), None, Some(r##"REQUIRED: The resource for which the policy detail is being requested. - `resource` is usually specified as a path. For example, a Project - resource is specified as `projects/{project}`."##), + See the operation documentation for the appropriate value for this field."##), Some(true), Some(false)), @@ -2213,7 +2219,7 @@ fn main() { let mut app = App::new("pubsub1-beta2") .author("Sebastian Thiel ") - .version("1.0.4+20161122") + .version("1.0.4+20170502") .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 7b4a14dc60..6696f248e9 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.4+20161122" +version = "1.0.4+20170502" authors = ["Sebastian Thiel "] -description = "A complete library to interact with pubsub (protocol v1beta2)" +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.4+20161122" +documentation = "https://docs.rs/google-pubsub1_beta2/1.0.4+20170502" license = "MIT" keywords = ["pubsub", "google", "protocol", "web", "api"] diff --git a/gen/pubsub1_beta2/README.md b/gen/pubsub1_beta2/README.md index f6dad7990c..6d67bcd53a 100644 --- a/gen/pubsub1_beta2/README.md +++ b/gen/pubsub1_beta2/README.md @@ -3,18 +3,18 @@ DO NOT EDIT ! This file was generated automatically from 'src/mako/api/README.md.mako' DO NOT EDIT ! --> -The `google-pubsub1_beta2` library allows access to all features of the *Google pubsub* service. +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.4+20161122*, where *20161122* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Pubsub* crate version *1.0.4+20170502*, where *20170502* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. -Everything else about the *pubsub* *v1_beta2* API can be found at the +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.4+20161122/google_pubsub1_beta2/struct.Pubsub.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.Pubsub.html) ... * projects - * [*subscriptions acknowledge*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/struct.ProjectTopicTestIamPermissionCall.html) + * [*subscriptions acknowledge*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionAcknowledgeCall.html), [*subscriptions create*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionCreateCall.html), [*subscriptions delete*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionDeleteCall.html), [*subscriptions get*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionGetCall.html), [*subscriptions get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionGetIamPolicyCall.html), [*subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionListCall.html), [*subscriptions modify ack deadline*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionModifyAckDeadlineCall.html), [*subscriptions modify push config*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionModifyPushConfigCall.html), [*subscriptions pull*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionPullCall.html), [*subscriptions set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionSetIamPolicyCall.html), [*subscriptions test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectSubscriptionTestIamPermissionCall.html), [*topics create*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectTopicCreateCall.html), [*topics delete*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectTopicDeleteCall.html), [*topics get*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectTopicGetCall.html), [*topics get iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectTopicGetIamPolicyCall.html), [*topics list*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectTopicListCall.html), [*topics publish*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectTopicPublishCall.html), [*topics set iam policy*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectTopicSetIamPolicyCall.html), [*topics subscriptions list*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/struct.ProjectTopicSubscriptionListCall.html) and [*topics test iam permissions*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/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.4+20161122/google_pubsub1_beta2/struct.Pubsub.html)** +* **[Hub](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/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.4+20161122/google_pubsub1_beta2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/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.4+20161122/google_pubsub1_beta2/trait.Part.html)** + * **[Parts](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/google_pubsub1_beta2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/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. @@ -125,17 +125,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/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.4+20170502/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.4+20161122/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.4+20170502/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.4+20161122/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.4+20170502/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.4+20161122/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.4+20170502/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")`. @@ -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-pubsub1_beta2/1.0.4+20161122/google_pubsub1_beta2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/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.4+20170502/google_pubsub1_beta2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/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.4+20161122/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.4+20170502/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.4+20161122/google_pubsub1_beta2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-pubsub1_beta2/1.0.4+20161122/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.4+20170502/google_pubsub1_beta2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/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.4+20161122/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.4+20170502/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.4+20161122/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.4+20170502/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.4+20161122/google_pubsub1_beta2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-pubsub1_beta2/1.0.4+20170502/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 41f44a2b38..78c7887f6e 100644 --- a/gen/pubsub1_beta2/src/lib.rs +++ b/gen/pubsub1_beta2/src/lib.rs @@ -2,9 +2,9 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *pubsub* crate version *1.0.4+20161122*, where *20161122* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Pubsub* crate version *1.0.4+20170502*, where *20170502* is the exact revision of the *pubsub:v1beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! -//! Everything else about the *pubsub* *v1_beta2* API can be found at the +//! Everything else about the *Pubsub* *v1_beta2* API can be found at the //! [official documentation site](https://cloud.google.com/pubsub/docs). //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/pubsub1_beta2). //! # Features @@ -180,7 +180,7 @@ // 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 +// 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)] @@ -225,18 +225,18 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// [authorization token](https://developers.google.com/youtube/v3/guides/authentication). #[derive(PartialEq, Eq, Hash)] pub enum Scope { - /// View and manage your data across Google Cloud Platform services - CloudPlatform, - /// View and manage Pub/Sub topics and subscriptions Full, + + /// 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", Scope::Full => "https://www.googleapis.com/auth/pubsub", + Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform", } } } @@ -315,8 +315,6 @@ pub struct Pubsub { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Pubsub {} @@ -329,8 +327,6 @@ impl<'a, C, A> Pubsub client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://pubsub.googleapis.com/".to_string(), - _root_url: "https://pubsub.googleapis.com/".to_string(), } } @@ -347,26 +343,6 @@ impl<'a, C, A> Pubsub self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://pubsub.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://pubsub.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -918,10 +894,6 @@ 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 @@ -942,6 +914,10 @@ 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. @@ -1071,13 +1047,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. /// /// # Arguments /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn topics_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectTopicTestIamPermissionCall<'a, C, A> { ProjectTopicTestIamPermissionCall { hub: self.hub, @@ -1160,8 +1141,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn topics_get_iam_policy(&self, resource: &str) -> ProjectTopicGetIamPolicyCall<'a, C, A> { ProjectTopicGetIamPolicyCall { hub: self.hub, @@ -1225,8 +1205,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn topics_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectTopicSetIamPolicyCall<'a, C, A> { ProjectTopicSetIamPolicyCall { hub: self.hub, @@ -1302,8 +1281,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// # Arguments /// /// * `resource` - REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn subscriptions_get_iam_policy(&self, resource: &str) -> ProjectSubscriptionGetIamPolicyCall<'a, C, A> { ProjectSubscriptionGetIamPolicyCall { hub: self.hub, @@ -1317,13 +1295,18 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// /// Returns permissions that a caller has on the specified resource. + /// If the resource does not exist, this will return an empty set of + /// permissions, not a NOT_FOUND error. + /// + /// Note: This operation is designed to be used for building permission-aware + /// UIs and command-line tools, not for authorization checking. This operation + /// may "fail open" without warning. /// /// # Arguments /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn subscriptions_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectSubscriptionTestIamPermissionCall<'a, C, A> { ProjectSubscriptionTestIamPermissionCall { hub: self.hub, @@ -1420,8 +1403,7 @@ impl<'a, C, A> ProjectMethods<'a, C, A> { /// /// * `request` - No description provided. /// * `resource` - REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. pub fn subscriptions_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSubscriptionSetIamPolicyCall<'a, C, A> { ProjectSubscriptionSetIamPolicyCall { hub: self.hub, @@ -1523,7 +1505,7 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta2/{+project}/topics"; + let mut url = "https://pubsub.googleapis.com/v1beta2/{+project}/topics".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1680,12 +1662,12 @@ impl<'a, C, A> ProjectTopicListCall<'a, C, A> where C: BorrowMut, /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectTopicListCall<'a, C, A> @@ -1794,7 +1776,7 @@ impl<'a, C, A> ProjectSubscriptionPullCall<'a, C, A> where C: BorrowMut ProjectSubscriptionPullCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionPullCall<'a, C, A> @@ -2070,7 +2052,7 @@ impl<'a, C, A> ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectTopicCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicCreateCall<'a, C, A> @@ -2274,6 +2256,12 @@ impl<'a, C, A> ProjectTopicCreateCall<'a, C, A> where C: BorrowMut ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut ProjectTopicTestIamPermissionCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicTestIamPermissionCall<'a, C, A> @@ -2634,7 +2621,7 @@ impl<'a, C, A> ProjectSubscriptionModifyPushConfigCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta2/{+subscription}:modifyPushConfig"; + let mut url = "https://pubsub.googleapis.com/v1beta2/{+subscription}:modifyPushConfig".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2799,12 +2786,12 @@ impl<'a, C, A> ProjectSubscriptionModifyPushConfigCall<'a, C, A> where C: Borrow /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectSubscriptionModifyPushConfigCall<'a, C, A> @@ -2912,7 +2899,7 @@ impl<'a, C, A> ProjectTopicPublishCall<'a, C, A> where C: BorrowMut ProjectTopicPublishCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicPublishCall<'a, C, A> @@ -3181,7 +3168,7 @@ impl<'a, C, A> ProjectTopicGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta2/{+topic}"; + let mut url = "https://pubsub.googleapis.com/v1beta2/{+topic}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3322,12 +3309,12 @@ impl<'a, C, A> ProjectTopicGetCall<'a, C, A> where C: BorrowMut, /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectTopicGetCall<'a, C, A> @@ -3428,7 +3415,7 @@ impl<'a, C, A> ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicGetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicGetIamPolicyCall<'a, C, A> @@ -3686,7 +3672,7 @@ impl<'a, C, A> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta2/{+subscription}:modifyAckDeadline"; + let mut url = "https://pubsub.googleapis.com/v1beta2/{+subscription}:modifyAckDeadline".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3851,12 +3837,12 @@ impl<'a, C, A> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> where C: Borro /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectSubscriptionModifyAckDeadlineCall<'a, C, A> @@ -3959,7 +3945,7 @@ impl<'a, C, A> ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut ProjectSubscriptionDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionDeleteCall<'a, C, A> @@ -4212,7 +4198,7 @@ impl<'a, C, A> ProjectTopicSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicSetIamPolicyCall<'a, C, A> where C: BorrowMut ProjectTopicSetIamPolicyCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicSetIamPolicyCall<'a, C, A> @@ -4496,7 +4481,7 @@ impl<'a, C, A> ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut ProjectSubscriptionCreateCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionCreateCall<'a, C, A> @@ -4783,7 +4768,7 @@ impl<'a, C, A> ProjectSubscriptionAcknowledgeCall<'a, C, A> where C: BorrowMut ProjectSubscriptionAcknowledgeCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionAcknowledgeCall<'a, C, A> @@ -5054,7 +5039,7 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta2/{+resource}:getIamPolicy"; + let mut url = "https://pubsub.googleapis.com/v1beta2/{+resource}:getIamPolicy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5161,8 +5146,7 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< /// REQUIRED: The resource for which the policy is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. /// /// Sets the *resource* path property to the given value. /// @@ -5197,12 +5181,12 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectSubscriptionGetIamPolicyCall<'a, C, A> @@ -5231,6 +5215,12 @@ impl<'a, C, A> ProjectSubscriptionGetIamPolicyCall<'a, C, A> where C: BorrowMut< /// Returns permissions that a caller has on the specified resource. +/// If the resource does not exist, this will return an empty set of +/// permissions, not a NOT_FOUND error. +/// +/// Note: This operation is designed to be used for building permission-aware +/// UIs and command-line tools, not for authorization checking. This operation +/// may "fail open" without warning. /// /// A builder for the *subscriptions.testIamPermissions* method supported by a *project* resource. /// It is not used directly, but through a `ProjectMethods` instance. @@ -5308,7 +5298,7 @@ impl<'a, C, A> ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta2/{+resource}:testIamPermissions"; + let mut url = "https://pubsub.googleapis.com/v1beta2/{+resource}:testIamPermissions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5439,8 +5429,7 @@ impl<'a, C, A> ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro self } /// REQUIRED: The resource for which the policy detail is being requested. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. /// /// Sets the *resource* path property to the given value. /// @@ -5475,12 +5464,12 @@ impl<'a, C, A> ProjectSubscriptionTestIamPermissionCall<'a, C, A> where C: Borro /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectSubscriptionTestIamPermissionCall<'a, C, A> @@ -5583,7 +5572,7 @@ impl<'a, C, A> ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut ProjectTopicDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicDeleteCall<'a, C, A> @@ -5828,7 +5817,7 @@ impl<'a, C, A> ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut ProjectSubscriptionGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionGetCall<'a, C, A> @@ -6083,7 +6072,7 @@ impl<'a, C, A> ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectTopicSubscriptionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectTopicSubscriptionListCall<'a, C, A> @@ -6354,7 +6343,7 @@ impl<'a, C, A> ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut ProjectSubscriptionListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ProjectSubscriptionListCall<'a, C, A> @@ -6623,7 +6612,7 @@ impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1beta2/{+resource}:setIamPolicy"; + let mut url = "https://pubsub.googleapis.com/v1beta2/{+resource}:setIamPolicy".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6754,8 +6743,7 @@ impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< self } /// REQUIRED: The resource for which the policy is being specified. - /// `resource` is usually specified as a path. For example, a Project - /// resource is specified as `projects/{project}`. + /// See the operation documentation for the appropriate value for this field. /// /// Sets the *resource* path property to the given value. /// @@ -6790,12 +6778,12 @@ impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. /// * *callback* (query-string) - JSONP /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param(mut self, name: T, value: T) -> ProjectSubscriptionSetIamPolicyCall<'a, C, A> @@ -6823,3 +6811,4 @@ impl<'a, C, A> ProjectSubscriptionSetIamPolicyCall<'a, C, A> where C: BorrowMut< } + diff --git a/gen/qpxexpress1-cli/Cargo.toml b/gen/qpxexpress1-cli/Cargo.toml index 65286a4ee7..bf61082259 100644 --- a/gen/qpxexpress1-cli/Cargo.toml +++ b/gen/qpxexpress1-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/qpxexpress1/src/lib.rs b/gen/qpxexpress1/src/lib.rs index 72d52958fb..13b7f14447 100644 --- a/gen/qpxexpress1/src/lib.rs +++ b/gen/qpxexpress1/src/lib.rs @@ -176,7 +176,7 @@ // 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 +// 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)] @@ -285,8 +285,6 @@ pub struct QPXExpress { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for QPXExpress {} @@ -299,8 +297,6 @@ impl<'a, C, A> QPXExpress client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/qpxExpress/v1/trips/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -317,26 +313,6 @@ impl<'a, C, A> QPXExpress self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/qpxExpress/v1/trips/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1081,7 +1057,7 @@ impl<'a, C, A> TripSearchCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "search"; + let mut url = "https://www.googleapis.com/qpxExpress/v1/trips/search".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1218,3 +1194,4 @@ impl<'a, C, A> TripSearchCall<'a, C, A> where C: BorrowMut, A: oa } + diff --git a/gen/replicapool1_beta2-cli/Cargo.toml b/gen/replicapool1_beta2-cli/Cargo.toml index f7d54ed23a..1b0acd6887 100644 --- a/gen/replicapool1_beta2-cli/Cargo.toml +++ b/gen/replicapool1_beta2-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/replicapool1_beta2/src/lib.rs b/gen/replicapool1_beta2/src/lib.rs index d10fc45cf8..ff7a31de19 100644 --- a/gen/replicapool1_beta2/src/lib.rs +++ b/gen/replicapool1_beta2/src/lib.rs @@ -184,7 +184,7 @@ // 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 +// 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)] @@ -324,8 +324,6 @@ pub struct Replicapool { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Replicapool {} @@ -338,8 +336,6 @@ impl<'a, C, A> Replicapool client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/replicapool/v1beta2/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -359,26 +355,6 @@ impl<'a, C, A> Replicapool self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/replicapool/v1beta2/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1213,7 +1189,7 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations"; + let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1483,7 +1459,7 @@ impl<'a, C, A> ZoneOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations/{operation}"; + let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/operations/{operation}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1749,7 +1725,7 @@ impl<'a, C, A> InstanceGroupManagerSetTargetPoolCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools"; + let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setTargetPools".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2045,7 +2021,7 @@ impl<'a, C, A> InstanceGroupManagerListCall<'a, C, A> where C: BorrowMut InstanceGroupManagerInsertCall<'a, C, A> where C: BorrowMut InstanceGroupManagerGetCall<'a, C, A> where C: BorrowMut InstanceGroupManagerAbandonInstanceCall<'a, C, A> where C: Borrow params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances"; + let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/abandonInstances".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3161,7 +3137,7 @@ impl<'a, C, A> InstanceGroupManagerRecreateInstanceCall<'a, C, A> where C: Borro params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances"; + let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/recreateInstances".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3444,7 +3420,7 @@ impl<'a, C, A> InstanceGroupManagerDeleteCall<'a, C, A> where C: BorrowMut InstanceGroupManagerSetInstanceTemplateCall<'a, C, A> where C: Bo params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate"; + let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/setInstanceTemplate".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3995,7 +3971,7 @@ impl<'a, C, A> InstanceGroupManagerResizeCall<'a, C, A> where C: BorrowMut InstanceGroupManagerDeleteInstanceCall<'a, C, A> where C: BorrowM params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances"; + let mut url = "https://www.googleapis.com/replicapool/v1beta2/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/deleteInstances".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4480,3 +4456,4 @@ impl<'a, C, A> InstanceGroupManagerDeleteInstanceCall<'a, C, A> where C: BorrowM } + diff --git a/gen/replicapoolupdater1_beta1-cli/Cargo.toml b/gen/replicapoolupdater1_beta1-cli/Cargo.toml index 440fd2f66c..244a4db06a 100644 --- a/gen/replicapoolupdater1_beta1-cli/Cargo.toml +++ b/gen/replicapoolupdater1_beta1-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/replicapoolupdater1_beta1/src/lib.rs b/gen/replicapoolupdater1_beta1/src/lib.rs index ecaa1098cb..5568244376 100644 --- a/gen/replicapoolupdater1_beta1/src/lib.rs +++ b/gen/replicapoolupdater1_beta1/src/lib.rs @@ -182,7 +182,7 @@ // 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 +// 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)] @@ -322,8 +322,6 @@ pub struct Replicapoolupdater { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Replicapoolupdater {} @@ -336,8 +334,6 @@ impl<'a, C, A> Replicapoolupdater client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -357,26 +353,6 @@ impl<'a, C, A> Replicapoolupdater self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/replicapoolupdater/v1beta1/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1174,7 +1150,7 @@ impl<'a, C, A> RollingUpdatePauseCall<'a, C, A> where C: BorrowMut RollingUpdateRollbackCall<'a, C, A> where C: BorrowMut RollingUpdateGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}"; + let mut url = "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ReplicapoolReadonly.as_ref().to_string(), ()); } @@ -1951,7 +1927,7 @@ impl<'a, C, A> RollingUpdateResumeCall<'a, C, A> where C: BorrowMut RollingUpdateListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/rollingUpdates"; + let mut url = "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ReplicapoolReadonly.as_ref().to_string(), ()); } @@ -2498,7 +2474,7 @@ impl<'a, C, A> RollingUpdateInsertCall<'a, C, A> where C: BorrowMut RollingUpdateListInstanceUpdateCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/instanceUpdates"; + let mut url = "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/rollingUpdates/{rollingUpdate}/instanceUpdates".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ReplicapoolReadonly.as_ref().to_string(), ()); } @@ -3066,7 +3042,7 @@ impl<'a, C, A> RollingUpdateCancelCall<'a, C, A> where C: BorrowMut ZoneOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations/{operation}"; + let mut url = "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/operations/{operation}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3597,7 +3573,7 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations"; + let mut url = "https://www.googleapis.com/replicapoolupdater/v1beta1/projects/{project}/zones/{zone}/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3793,3 +3769,4 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut } + diff --git a/gen/reseller1_sandbox-cli/Cargo.toml b/gen/reseller1_sandbox-cli/Cargo.toml index 11f5d7039f..0272b659bf 100644 --- a/gen/reseller1_sandbox-cli/Cargo.toml +++ b/gen/reseller1_sandbox-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/reseller1_sandbox/src/lib.rs b/gen/reseller1_sandbox/src/lib.rs index fccea60087..7ef97292a5 100644 --- a/gen/reseller1_sandbox/src/lib.rs +++ b/gen/reseller1_sandbox/src/lib.rs @@ -186,7 +186,7 @@ // 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 +// 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)] @@ -320,8 +320,6 @@ pub struct Reseller { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Reseller {} @@ -334,8 +332,6 @@ impl<'a, C, A> Reseller client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/apps/reseller/v1sandbox/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -355,26 +351,6 @@ impl<'a, C, A> Reseller self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/apps/reseller/v1sandbox/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1157,7 +1133,7 @@ impl<'a, C, A> CustomerUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customers/{customerId}"; + let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers/{customerId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrder.as_ref().to_string(), ()); } @@ -1426,7 +1402,7 @@ impl<'a, C, A> CustomerInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customers"; + let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrder.as_ref().to_string(), ()); } @@ -1668,7 +1644,7 @@ impl<'a, C, A> CustomerPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customers/{customerId}"; + let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers/{customerId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrder.as_ref().to_string(), ()); } @@ -1927,7 +1903,7 @@ impl<'a, C, A> CustomerGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customers/{customerId}"; + let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers/{customerId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrderReadonly.as_ref().to_string(), ()); } @@ -2174,7 +2150,7 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionDeleteCall<'a, C, A> where C: BorrowMut SubscriptionGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customers/{customerId}/subscriptions/{subscriptionId}"; + let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers/{customerId}/subscriptions/{subscriptionId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrderReadonly.as_ref().to_string(), ()); } @@ -2958,7 +2934,7 @@ impl<'a, C, A> SubscriptionListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "subscriptions"; + let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/subscriptions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrderReadonly.as_ref().to_string(), ()); } @@ -3206,7 +3182,7 @@ impl<'a, C, A> SubscriptionChangeRenewalSettingCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings"; + let mut url = "https://www.googleapis.com/apps/reseller/v1sandbox/customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::AppOrder.as_ref().to_string(), ()); } @@ -3477,7 +3453,7 @@ impl<'a, C, A> SubscriptionStartPaidServiceCall<'a, C, A> where C: BorrowMut SubscriptionChangeSeatCall<'a, C, A> where C: BorrowMut SubscriptionSuspendCall<'a, C, A> where C: BorrowMut SubscriptionActivateCall<'a, C, A> where C: BorrowMut SubscriptionChangePlanCall<'a, C, A> where C: BorrowMut SubscriptionChangePlanCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Resourceviews {} @@ -348,8 +346,6 @@ impl<'a, C, A> Resourceviews client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/resourceviews/v1beta2/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -369,26 +365,6 @@ impl<'a, C, A> Resourceviews self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/resourceviews/v1beta2/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1201,7 +1177,7 @@ impl<'a, C, A> ZoneViewRemoveResourceCall<'a, C, A> where C: BorrowMut ZoneViewAddResourceCall<'a, C, A> where C: BorrowMut ZoneViewListResourceCall<'a, C, A> where C: BorrowMut ZoneViewGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/resourceViews/{resourceView}"; + let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -2360,7 +2336,7 @@ impl<'a, C, A> ZoneViewListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/resourceViews"; + let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -2628,7 +2604,7 @@ impl<'a, C, A> ZoneViewInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/resourceViews"; + let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2901,7 +2877,7 @@ impl<'a, C, A> ZoneViewDeleteCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/resourceViews/{resourceView}"; + let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/resourceViews/{resourceView}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3167,7 +3143,7 @@ impl<'a, C, A> ZoneViewSetServiceCall<'a, C, A> where C: BorrowMut ZoneViewGetServiceCall<'a, C, A> where C: BorrowMut ZoneOperationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations/{operation}"; + let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/operations/{operation}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -3993,7 +3969,7 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/zones/{zone}/operations"; + let mut url = "https://www.googleapis.com/resourceviews/v1beta2/projects/{project}/zones/{zone}/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ComputeReadonly.as_ref().to_string(), ()); } @@ -4189,3 +4165,4 @@ impl<'a, C, A> ZoneOperationListCall<'a, C, A> where C: BorrowMut } + diff --git a/gen/safebrowsing4-cli/Cargo.toml b/gen/safebrowsing4-cli/Cargo.toml index 4400f9fefd..3e873aeb07 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.4+20160520" +version = "1.0.4+20170509" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-safebrowsing4] path = "../safebrowsing4" -version = "1.0.4+20160520" +version = "1.0.4+20170509" diff --git a/gen/safebrowsing4-cli/README.md b/gen/safebrowsing4-cli/README.md index aa436c40e6..bc83e40503 100644 --- a/gen/safebrowsing4-cli/README.md +++ b/gen/safebrowsing4-cli/README.md @@ -25,10 +25,14 @@ 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 *20160520*. The CLI is at version *1.0.4*. +This documentation was generated from the *safebrowsing* API at revision *20170509*. The CLI is at version *1.0.4*. ```bash safebrowsing4 [options] + encoded-full-hashes + get [-p ]... [-o ] + encoded-updates + get [-p ]... [-o ] full-hashes find (-r )... [-p ]... [-o ] threat-list-updates diff --git a/gen/safebrowsing4-cli/mkdocs.yml b/gen/safebrowsing4-cli/mkdocs.yml index 6d93c672cf..e2f90d40dd 100644 --- a/gen/safebrowsing4-cli/mkdocs.yml +++ b/gen/safebrowsing4-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: safebrowsing v1.0.4+20160520 +site_name: safebrowsing v1.0.4+20170509 site_url: http://byron.github.io/google-apis-rs/google-safebrowsing4-cli site_description: A complete library to interact with safebrowsing (protocol v4) @@ -9,6 +9,8 @@ site_dir: build_html pages: - ['index.md', 'Home'] +- ['encoded-full-hashes_get.md', 'Encoded Full Hashes', 'Get'] +- ['encoded-updates_get.md', 'Encoded Updates', 'Get'] - ['full-hashes_find.md', 'Full Hashes', 'Find'] - ['threat-list-updates_fetch.md', 'Threat List Updates', 'Fetch'] - ['threat-lists_list.md', 'Threat Lists', 'List'] diff --git a/gen/safebrowsing4-cli/src/main.rs b/gen/safebrowsing4-cli/src/main.rs index 8a6b1027f3..1b24ff75ee 100644 --- a/gen/safebrowsing4-cli/src/main.rs +++ b/gen/safebrowsing4-cli/src/main.rs @@ -46,6 +46,118 @@ struct Engine<'n> { impl<'n> Engine<'n> { + fn _encoded_full_hashes_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.encoded_full_hashes().get(opt.value_of("encoded-request").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "client-version" => { + call = call.client_version(value.unwrap_or("")); + }, + "client-id" => { + call = call.client_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(["client-id", "client-version"].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 _encoded_updates_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.encoded_updates().get(opt.value_of("encoded-request").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "client-version" => { + call = call.client_version(value.unwrap_or("")); + }, + "client-id" => { + call = call.client_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(["client-id", "client-version"].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 _full_hashes_find(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -71,12 +183,14 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "client.client-version" => Some(("client.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "client.client-id" => Some(("client.clientId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "api-client.client-version" => Some(("apiClient.clientVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "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 })), "client-states" => Some(("clientStates", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["client", "client-id", "client-states", "client-version", "platform-types", "threat-entry-types", "threat-info", "threat-types"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["api-client", "client", "client-id", "client-states", "client-version", "platform-types", "threat-entry-types", "threat-info", "threat-types"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -356,6 +470,28 @@ impl<'n> Engine<'n> { let mut call_result: Result<(), DoitError> = Ok(()); let mut err_opt: Option = None; match self.opt.subcommand() { + ("encoded-full-hashes", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._encoded_full_hashes_get(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("encoded-full-hashes".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, + ("encoded-updates", Some(opt)) => { + match opt.subcommand() { + ("get", Some(opt)) => { + call_result = self._encoded_updates_get(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("encoded-updates".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("full-hashes", Some(opt)) => { match opt.subcommand() { ("find", Some(opt)) => { @@ -486,6 +622,56 @@ impl<'n> Engine<'n> { fn main() { let mut exit_status = 0i32; let arg_data = [ + ("encoded-full-hashes", "methods: 'get'", vec![ + ("get", + Some(r##""##), + "Details at http://byron.github.io/google-apis-rs/google_safebrowsing4_cli/encoded-full-hashes_get", + vec![ + (Some(r##"encoded-request"##), + None, + Some(r##"A serialized FindFullHashesRequest proto."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ("encoded-updates", "methods: 'get'", vec![ + ("get", + Some(r##""##), + "Details at http://byron.github.io/google-apis-rs/google_safebrowsing4_cli/encoded-updates_get", + vec![ + (Some(r##"encoded-request"##), + None, + Some(r##"A serialized FetchThreatListUpdatesRequest proto."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("full-hashes", "methods: 'find'", vec![ ("find", Some(r##"Finds the full hashes that match the requested hash prefixes."##), @@ -513,7 +699,8 @@ fn main() { ("threat-list-updates", "methods: 'fetch'", vec![ ("fetch", - Some(r##"Fetches the most recent threat list updates. A client can request updates for multiple lists at once."##), + Some(r##"Fetches the most recent threat list updates. A client can request updates + for multiple lists at once."##), "Details at http://byron.github.io/google-apis-rs/google_safebrowsing4_cli/threat-list-updates_fetch", vec![ (Some(r##"kv"##), @@ -584,8 +771,8 @@ fn main() { let mut app = App::new("safebrowsing4") .author("Sebastian Thiel ") - .version("1.0.4+20160520") - .about("Enables client applications to check web resources (most commonly URLs) against Google-generated lists of unsafe web resources.") + .version("1.0.4+20170509") + .about("The Safe Browsing API is an experimental API that allows client applications to check URLs against Google's constantly-updated blacklists of suspected phishing and malware pages. Your client application can use the API to download an encrypted table for local, client-side lookups of URLs.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_safebrowsing4_cli") .arg(Arg::with_name("folder") .long("config-dir") diff --git a/gen/safebrowsing4/Cargo.toml b/gen/safebrowsing4/Cargo.toml index 62c1aca0ef..8bac8ef613 100644 --- a/gen/safebrowsing4/Cargo.toml +++ b/gen/safebrowsing4/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-safebrowsing4" -version = "1.0.4+20160520" +version = "1.0.4+20170509" 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.4+20160520" +documentation = "https://docs.rs/google-safebrowsing4/1.0.4+20170509" license = "MIT" keywords = ["safebrowsing", "google", "protocol", "web", "api"] diff --git a/gen/safebrowsing4/README.md b/gen/safebrowsing4/README.md index f1c6f37605..3f965d0782 100644 --- a/gen/safebrowsing4/README.md +++ b/gen/safebrowsing4/README.md @@ -5,22 +5,26 @@ DO NOT EDIT ! --> The `google-safebrowsing4` library allows access to all features of the *Google safebrowsing* service. -This documentation was generated from *safebrowsing* crate version *1.0.4+20160520*, where *20160520* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *safebrowsing* crate version *1.0.4+20170509*, where *20170509* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20160520/google_safebrowsing4/struct.Safebrowsing.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/struct.Safebrowsing.html) ... +* encoded full hashes + * [*get*](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/struct.EncodedFullHasheGetCall.html) +* encoded updates + * [*get*](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/struct.EncodedUpdateGetCall.html) * full hashes - * [*find*](https://docs.rs/google-safebrowsing4/1.0.4+20160520/google_safebrowsing4/struct.FullHasheFindCall.html) + * [*find*](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/struct.FullHasheFindCall.html) * threat list updates - * [*fetch*](https://docs.rs/google-safebrowsing4/1.0.4+20160520/google_safebrowsing4/struct.ThreatListUpdateFetchCall.html) + * [*fetch*](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/struct.ThreatListUpdateFetchCall.html) * threat lists - * [*list*](https://docs.rs/google-safebrowsing4/1.0.4+20160520/google_safebrowsing4/struct.ThreatListListCall.html) + * [*list*](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/struct.ThreatListListCall.html) * threat matches - * [*find*](https://docs.rs/google-safebrowsing4/1.0.4+20160520/google_safebrowsing4/struct.ThreatMatcheFindCall.html) + * [*find*](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/struct.ThreatMatcheFindCall.html) @@ -29,17 +33,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-safebrowsing4/1.0.4+20160520/google_safebrowsing4/struct.Safebrowsing.html)** +* **[Hub](https://docs.rs/google-safebrowsing4/1.0.4+20170509/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.4+20160520/google_safebrowsing4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-safebrowsing4/1.0.4+20160520/google_safebrowsing4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-safebrowsing4/1.0.4+20160520/google_safebrowsing4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-safebrowsing4/1.0.4+20170509/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.4+20160520/google_safebrowsing4/trait.Part.html)** + * **[Parts](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-safebrowsing4/1.0.4+20160520/google_safebrowsing4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-safebrowsing4/1.0.4+20170509/google_safebrowsing4/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -54,6 +58,7 @@ Or specifically ... ```ignore let r = hub.full_hashes().find(...).doit() +let r = hub.encoded_full_hashes().get(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -78,7 +83,6 @@ google-safebrowsing4 = "*" extern crate hyper; extern crate yup_oauth2 as oauth2; extern crate google_safebrowsing4 as safebrowsing4; -use safebrowsing4::FindFullHashesRequest; use safebrowsing4::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -96,15 +100,12 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::new(), ::default(), None); let mut hub = Safebrowsing::new(hyper::Client::new(), auth); -// As the method needs a request, you would usually fill it with the desired information -// into the respective structure. Some of the parts shown here might not be applicable ! -// Values shown here are possibly random and not representative ! -let mut req = FindFullHashesRequest::default(); - // You can configure optional parameters by calling the respective setters at will, and // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! -let result = hub.full_hashes().find(req) +let result = hub.encoded_full_hashes().get("encodedRequest") + .client_version("sit") + .client_id("Stet") .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-safebrowsing4/1.0.4+20160520/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.4+20170509/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.4+20160520/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.4+20170509/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.4+20160520/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.4+20170509/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.4+20160520/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.4+20170509/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")`. @@ -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-safebrowsing4/1.0.4+20160520/google_safebrowsing4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-safebrowsing4/1.0.4+20160520/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.4+20170509/google_safebrowsing4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-safebrowsing4/1.0.4+20170509/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.4+20160520/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.4+20170509/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.4+20160520/google_safebrowsing4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-safebrowsing4/1.0.4+20160520/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.4+20170509/google_safebrowsing4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-safebrowsing4/1.0.4+20170509/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.4+20160520/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.4+20170509/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.4+20160520/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.4+20170509/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.4+20160520/google_safebrowsing4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-safebrowsing4/1.0.4+20170509/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 c4b06d6420..d6cd0774ba 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.4+20160520*, where *20160520* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *safebrowsing* crate version *1.0.4+20170509*, where *20170509* is the exact revision of the *safebrowsing:v4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *safebrowsing* *v4* API can be found at the //! [official documentation site](https://developers.google.com/safe-browsing/). @@ -11,6 +11,10 @@ //! //! Handle the following *Resources* with ease from the central [hub](struct.Safebrowsing.html) ... //! +//! * encoded full hashes +//! * [*get*](struct.EncodedFullHasheGetCall.html) +//! * encoded updates +//! * [*get*](struct.EncodedUpdateGetCall.html) //! * full hashes //! * [*find*](struct.FullHasheFindCall.html) //! * threat list updates @@ -54,6 +58,7 @@ //! //! ```ignore //! let r = hub.full_hashes().find(...).doit() +//! let r = hub.encoded_full_hashes().get(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -78,7 +83,6 @@ //! extern crate hyper; //! extern crate yup_oauth2 as oauth2; //! extern crate google_safebrowsing4 as safebrowsing4; -//! use safebrowsing4::FindFullHashesRequest; //! use safebrowsing4::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -97,15 +101,12 @@ //! hyper::Client::new(), //! ::default(), None); //! let mut hub = Safebrowsing::new(hyper::Client::new(), auth); -//! // As the method needs a request, you would usually fill it with the desired information -//! // into the respective structure. Some of the parts shown here might not be applicable ! -//! // Values shown here are possibly random and not representative ! -//! let mut req = FindFullHashesRequest::default(); -//! //! // You can configure optional parameters by calling the respective setters at will, and //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! -//! let result = hub.full_hashes().find(req) +//! let result = hub.encoded_full_hashes().get("encodedRequest") +//! .client_version("et") +//! .client_id("dolores") //! .doit(); //! //! match result { @@ -182,7 +183,7 @@ // 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 +// 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)] @@ -239,7 +240,6 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// extern crate hyper; /// extern crate yup_oauth2 as oauth2; /// extern crate google_safebrowsing4 as safebrowsing4; -/// use safebrowsing4::FindFullHashesRequest; /// use safebrowsing4::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -258,15 +258,12 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, /// hyper::Client::new(), /// ::default(), None); /// let mut hub = Safebrowsing::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = FindFullHashesRequest::default(); -/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.full_hashes().find(req) +/// let result = hub.encoded_full_hashes().get("encodedRequest") +/// .client_version("accusam") +/// .client_id("takimata") /// .doit(); /// /// match result { @@ -291,8 +288,6 @@ pub struct Safebrowsing { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Safebrowsing {} @@ -305,11 +300,15 @@ impl<'a, C, A> Safebrowsing client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://safebrowsing.googleapis.com/".to_string(), - _root_url: "https://safebrowsing.googleapis.com/".to_string(), } } + pub fn encoded_full_hashes(&'a self) -> EncodedFullHasheMethods<'a, C, A> { + EncodedFullHasheMethods { hub: &self } + } + pub fn encoded_updates(&'a self) -> EncodedUpdateMethods<'a, C, A> { + EncodedUpdateMethods { hub: &self } + } pub fn full_hashes(&'a self) -> FullHasheMethods<'a, C, A> { FullHasheMethods { hub: &self } } @@ -332,26 +331,6 @@ impl<'a, C, A> Safebrowsing self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://safebrowsing.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://safebrowsing.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -364,19 +343,20 @@ impl<'a, C, A> Safebrowsing /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListUpdateRequest { - /// The type of platform at risk by entries present in the list. - #[serde(rename="platformType")] - pub platform_type: Option, - /// The current state of the client for the requested list (the encrypted client state that was received from the last successful list update). - pub state: Option, - /// The types of entries present in the list. - #[serde(rename="threatEntryType")] - pub threat_entry_type: Option, /// The type of threat posed by entries present in the list. #[serde(rename="threatType")] pub threat_type: Option, + /// The types of entries present in the list. + #[serde(rename="threatEntryType")] + pub threat_entry_type: Option, + /// The type of platform at risk by entries present in the list. + #[serde(rename="platformType")] + pub platform_type: Option, /// The constraints associated with this request. pub constraints: Option, + /// The current state of the client for the requested list (the encrypted + /// client state that was received from the last successful list update). + pub state: Option, } impl Part for ListUpdateRequest {} @@ -388,23 +368,30 @@ impl Part for ListUpdateRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListUpdateResponse { - /// The type of response. This may indicate that an action is required by the client when the response is received. + /// The type of response. This may indicate that an action is required by the + /// client when the response is received. #[serde(rename="responseType")] pub response_type: Option, /// The threat type for which data is returned. #[serde(rename="threatType")] pub threat_type: Option, - /// A set of entries to remove from a local threat type's list. Repeated for the same reason as above. + /// A set of entries to remove from a local threat type's list. In practice, + /// this field is empty or contains exactly one ThreatEntrySet. pub removals: Option>, /// The new client state, in encrypted format. Opaque to clients. #[serde(rename="newClientState")] pub new_client_state: Option, - /// The expected SHA256 hash of the client state; that is, of the sorted list of all hashes present in the database after applying the provided update. If the client state doesn't match the expected state, the client must disregard this update and retry later. + /// The expected SHA256 hash of the client state; that is, of the sorted list + /// of all hashes present in the database after applying the provided update. + /// If the client state doesn't match the expected state, the client must + /// disregard this update and retry later. pub checksum: Option, /// The format of the threats. #[serde(rename="threatEntryType")] pub threat_entry_type: Option, - /// A set of entries to add to a local threat type's list. Repeated to allow for a combination of compressed and raw data to be sent in a single response. + /// A set of entries to add to a local threat type's list. Repeated to allow + /// for a combination of compressed and raw data to be sent in a single + /// response. pub additions: Option>, /// The platform type for which data is returned. #[serde(rename="platformType")] @@ -414,7 +401,8 @@ pub struct ListUpdateResponse { impl Part for ListUpdateResponse {} -/// The metadata associated with a specific threat entry. The client is expected to know the metadata key/value pairs associated with each threat type. +/// The metadata associated with a specific threat entry. The client is expected +/// to know the metadata key/value pairs associated with each threat type. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -433,35 +421,29 @@ impl Part for ThreatEntryMetadata {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Checksum { - /// The SHA256 hash of the client state; that is, of the sorted list of all hashes present in the database. + /// The SHA256 hash of the client state; that is, of the sorted list of all + /// hashes present in the database. pub sha256: Option, } impl Part for Checksum {} -/// Request to check entries against lists. +/// A set of raw indices to remove from a local list. /// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where this type is involved in. -/// The list links the activity name, along with information about where it is used (one of *request* and *response*). -/// -/// * [find threat matches](struct.ThreatMatcheFindCall.html) (request) +/// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct FindThreatMatchesRequest { - /// The client metadata. - pub client: Option, - /// The lists and entries to be checked for matches. - #[serde(rename="threatInfo")] - pub threat_info: Option, +pub struct RawIndices { + /// The indices to remove from a lexicographically-sorted local list. + pub indices: Option>, } -impl RequestValue for FindThreatMatchesRequest {} +impl Part for RawIndices {} -/// A set of threats that should be added or removed from a client's local database. +/// A set of threats that should be added or removed from a client's local +/// database. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -476,41 +458,52 @@ pub struct ThreatEntrySet { /// The raw SHA256-formatted entries. #[serde(rename="rawHashes")] pub raw_hashes: Option, - /// The encoded 4-byte prefixes of SHA256-formatted entries, using a Golomb-Rice encoding. - #[serde(rename="riceHashes")] - pub rice_hashes: Option, - /// The encoded local, lexicographically-sorted list indices, using a Golomb-Rice encoding. Used for sending compressed removal indices. + /// 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, } impl Part for ThreatEntrySet {} -/// The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or compressed removal indices. +/// The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or +/// compressed removal indices. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RiceDeltaEncoding { - /// The number of entries that are delta encoded in the encoded data. If only a single integer was encoded, this will be zero and the single value will be stored in `first_value`. + /// The number of entries that are delta encoded in the encoded data. If only a + /// single integer was encoded, this will be zero and the single value will be + /// stored in `first_value`. #[serde(rename="numEntries")] pub num_entries: Option, - /// The offset of the first entry in the encoded data, or, if only a single integer was encoded, that single integer's value. + /// The offset of the first entry in the encoded data, or, if only a single + /// integer was encoded, that single integer's value. #[serde(rename="firstValue")] pub first_value: Option, - /// The Golomb-Rice parameter, which is a number between 2 and 28. This field is missing (that is, zero) if `num_entries` is zero. - #[serde(rename="riceParameter")] - pub rice_parameter: Option, /// The encoded deltas that are encoded using the Golomb-Rice coder. #[serde(rename="encodedData")] pub encoded_data: Option, + /// The Golomb-Rice parameter, which is a number between 2 and 28. This field + /// is missing (that is, zero) if `num_entries` is zero. + #[serde(rename="riceParameter")] + pub rice_parameter: Option, } impl Part for RiceDeltaEncoding {} -/// The information regarding one or more threats that a client submits when checking for matches in threat lists. +/// 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. /// @@ -539,15 +532,21 @@ impl Part for ThreatInfo {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Constraints { - /// Sets the maximum number of entries that the client is willing to have in the local database. This should be a power of 2 between 2**10 and 2**20. If zero, no database size limit is set. + /// Sets the maximum number of entries that the client is willing to have + /// in the local database. This should be a power of 2 between 2**10 and + /// 2**20. If zero, no database size limit is set. #[serde(rename="maxDatabaseEntries")] pub max_database_entries: Option, - /// Requests the list for a specific geographic location. If not set the server may pick that value based on the user's IP address. Expects ISO 3166-1 alpha-2 format. + /// Requests the list for a specific geographic location. If not set the + /// server may pick that value based on the user's IP address. Expects ISO + /// 3166-1 alpha-2 format. pub region: Option, /// The compression types supported by the client. #[serde(rename="supportedCompressions")] pub supported_compressions: Option>, - /// The maximum size in number of entries. The update will not contain more entries than this value. This should be a power of 2 between 2**10 and 2**20. If zero, no update size limit is set. + /// The maximum size in number of entries. The update will not contain more + /// entries than this value. This should be a power of 2 between 2**10 and + /// 2**20. If zero, no update size limit is set. #[serde(rename="maxUpdateEntries")] pub max_update_entries: Option, } @@ -575,7 +574,8 @@ pub struct ThreatMatch { /// The platform type matching this threat. #[serde(rename="platformType")] pub platform_type: Option, - /// The cache lifetime for the returned match. Clients must not cache this response for more than this duration to avoid false positives. + /// The cache lifetime for the returned match. Clients must not cache this + /// response for more than this duration to avoid false positives. #[serde(rename="cacheDuration")] pub cache_duration: Option, } @@ -589,7 +589,8 @@ impl Part for ThreatMatch {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ClientInfo { - /// A client ID that (hopefully) uniquely identifies the client implementation of the Safe Browsing API. + /// 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. @@ -618,7 +619,9 @@ pub struct FindThreatMatchesResponse { impl ResponseResult for FindThreatMatchesResponse {} -/// Describes an individual threat list. A list is defined by three parameters: the type of threat posed, the type of platform targeted by the threat, and the type of entries in the list. +/// Describes an individual threat list. A list is defined by three parameters: +/// the type of threat posed, the type of platform targeted by the threat, and +/// the type of entries in the list. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -646,15 +649,19 @@ impl Part for ThreatListDescriptor {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [find full hashes](struct.FullHasheFindCall.html) (response) +/// * [get encoded full hashes](struct.EncodedFullHasheGetCall.html) (response) /// #[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. + /// 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 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. + /// 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. #[serde(rename="minimumWaitDuration")] pub minimum_wait_duration: Option, } @@ -662,7 +669,8 @@ pub struct FindFullHashesResponse { impl ResponseResult for FindFullHashesResponse {} -/// An individual threat; for example, a malicious URL or its hash representation. Only one of these fields should be set. +/// An individual threat; for example, a malicious URL or its hash +/// representation. Only one of these fields should be set. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -670,9 +678,12 @@ impl ResponseResult for FindFullHashesResponse {} pub struct ThreatEntry { /// A URL. pub url: Option, - /// A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 hash. This field is in binary format. + /// A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 + /// hash. This field is in binary format. For JSON requests, hashes are + /// base64-encoded. pub hash: Option, - /// The digest of an executable in SHA256 format. The API supports both binary and hex digests. + /// The digest of an executable in SHA256 format. The API supports both + /// binary and hex digests. For JSON requests, digests are base64-encoded. pub digest: Option, } @@ -685,10 +696,10 @@ impl Part for ThreatEntry {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct MetadataEntry { - /// The metadata entry key. - pub key: Option, - /// The metadata entry value. + /// 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 {} @@ -702,13 +713,15 @@ impl Part for MetadataEntry {} /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// /// * [fetch threat list updates](struct.ThreatListUpdateFetchCall.html) (response) +/// * [get encoded updates](struct.EncodedUpdateGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct FetchThreatListUpdatesResponse { /// The list updates requested by the clients. #[serde(rename="listUpdateResponses")] pub list_update_responses: Option>, - /// The minimum duration the client must wait before issuing any update request. If this field is not set clients may update as soon as they want. + /// The minimum duration the client must wait before issuing any update + /// request. If this field is not set clients may update as soon as they want. #[serde(rename="minimumWaitDuration")] pub minimum_wait_duration: Option, } @@ -735,20 +748,31 @@ pub struct ListThreatListsResponse { impl ResponseResult for ListThreatListsResponse {} -/// A set of raw indices to remove from a local list. +/// Request to check entries against lists. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [find threat matches](struct.ThreatMatcheFindCall.html) (request) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct RawIndices { - /// The indices to remove from a lexicographically-sorted local list. - pub indices: Option>, +pub struct FindThreatMatchesRequest { + /// The client metadata. + pub client: Option, + /// The lists and entries to be checked for matches. + #[serde(rename="threatInfo")] + pub threat_info: Option, } -impl Part for RawIndices {} +impl RequestValue for FindThreatMatchesRequest {} -/// Describes a Safe Browsing API update request. Clients can request updates for multiple lists in a single request. NOTE: Field index 2 is unused. NEXT: 4 +/// Describes a Safe Browsing API update request. Clients can request updates for +/// multiple lists in a single request. +/// NOTE: Field index 2 is unused. +/// NEXT: 5 /// /// # Activities /// @@ -769,16 +793,25 @@ pub struct FetchThreatListUpdatesRequest { impl RequestValue for FetchThreatListUpdatesRequest {} -/// 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 popular URL. Used for sending ThreatEntrySet to clients that do not support compression, or when sending non-4-byte hashes to clients that do support compression. +/// 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 +/// popular URL. +/// +/// Used for sending ThreatEntrySet to clients that do not support compression, +/// or when sending non-4-byte hashes to clients that do support compression. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct RawHashes { - /// The number of bytes for each prefix encoded below. This field can be anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). + /// The number of bytes for each prefix encoded below. This field can be + /// anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). #[serde(rename="prefixSize")] pub prefix_size: Option, - /// The hashes, all concatenated into one long string. Each hash has a prefix size of |prefix_size| above. Hashes are sorted in lexicographic order. + /// The hashes, in binary format, concatenated into one long string. Hashes are + /// sorted in lexicographic order. For JSON API users, hashes are + /// base64-encoded. #[serde(rename="rawHashes")] pub raw_hashes: Option, } @@ -799,6 +832,10 @@ impl Part for RawHashes {} pub struct FindFullHashesRequest { /// The client metadata. pub client: Option, + /// Client metadata associated with callers of higher-level APIs built on top + /// of the client's implementation. + #[serde(rename="apiClient")] + pub api_client: Option, /// The lists and hashes to be checked. #[serde(rename="threatInfo")] pub threat_info: Option, @@ -815,6 +852,239 @@ impl RequestValue for FindFullHashesRequest {} // MethodBuilders ### // ################# +/// A builder providing access to all methods supported on *encodedFullHashe* 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 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::new(), +/// ::default(), None); +/// let mut hub = Safebrowsing::new(hyper::Client::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.encoded_full_hashes(); +/// # } +/// ``` +pub struct EncodedFullHasheMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Safebrowsing, +} + +impl<'a, C, A> MethodsBuilder for EncodedFullHasheMethods<'a, C, A> {} + +impl<'a, C, A> EncodedFullHasheMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// + /// + /// # Arguments + /// + /// * `encodedRequest` - A serialized FindFullHashesRequest proto. + pub fn get(&self, encoded_request: &str) -> EncodedFullHasheGetCall<'a, C, A> { + EncodedFullHasheGetCall { + hub: self.hub, + _encoded_request: encoded_request.to_string(), + _client_version: Default::default(), + _client_id: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *fullHashe* 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 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::new(), +/// ::default(), None); +/// let mut hub = Safebrowsing::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `find(...)` +/// // to build up your call. +/// let rb = hub.full_hashes(); +/// # } +/// ``` +pub struct FullHasheMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Safebrowsing, +} + +impl<'a, C, A> MethodsBuilder for FullHasheMethods<'a, C, A> {} + +impl<'a, C, A> FullHasheMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Finds the full hashes that match the requested hash prefixes. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn find(&self, request: FindFullHashesRequest) -> FullHasheFindCall<'a, C, A> { + FullHasheFindCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *threatListUpdate* 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 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::new(), +/// ::default(), None); +/// let mut hub = Safebrowsing::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `fetch(...)` +/// // to build up your call. +/// let rb = hub.threat_list_updates(); +/// # } +/// ``` +pub struct ThreatListUpdateMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Safebrowsing, +} + +impl<'a, C, A> MethodsBuilder for ThreatListUpdateMethods<'a, C, A> {} + +impl<'a, C, A> ThreatListUpdateMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Fetches the most recent threat list updates. A client can request updates + /// for multiple lists at once. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn fetch(&self, request: FetchThreatListUpdatesRequest) -> ThreatListUpdateFetchCall<'a, C, A> { + ThreatListUpdateFetchCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + +/// A builder providing access to all methods supported on *encodedUpdate* 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 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::new(), +/// ::default(), None); +/// let mut hub = Safebrowsing::new(hyper::Client::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.encoded_updates(); +/// # } +/// ``` +pub struct EncodedUpdateMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Safebrowsing, +} + +impl<'a, C, A> MethodsBuilder for EncodedUpdateMethods<'a, C, A> {} + +impl<'a, C, A> EncodedUpdateMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// + /// + /// # Arguments + /// + /// * `encodedRequest` - A serialized FetchThreatListUpdatesRequest proto. + pub fn get(&self, encoded_request: &str) -> EncodedUpdateGetCall<'a, C, A> { + EncodedUpdateGetCall { + hub: self.hub, + _encoded_request: encoded_request.to_string(), + _client_version: Default::default(), + _client_id: Default::default(), + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *threatList* resources. /// It is not used directly, but through the `Safebrowsing` hub. /// @@ -924,130 +1194,16 @@ impl<'a, C, A> ThreatMatcheMethods<'a, C, A> { -/// A builder providing access to all methods supported on *threatListUpdate* 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 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::new(), -/// ::default(), None); -/// let mut hub = Safebrowsing::new(hyper::Client::new(), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `fetch(...)` -/// // to build up your call. -/// let rb = hub.threat_list_updates(); -/// # } -/// ``` -pub struct ThreatListUpdateMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Safebrowsing, -} - -impl<'a, C, A> MethodsBuilder for ThreatListUpdateMethods<'a, C, A> {} - -impl<'a, C, A> ThreatListUpdateMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Fetches the most recent threat list updates. A client can request updates for multiple lists at once. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn fetch(&self, request: FetchThreatListUpdatesRequest) -> ThreatListUpdateFetchCall<'a, C, A> { - ThreatListUpdateFetchCall { - hub: self.hub, - _request: request, - _delegate: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all methods supported on *fullHashe* 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 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::new(), -/// ::default(), None); -/// let mut hub = Safebrowsing::new(hyper::Client::new(), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `find(...)` -/// // to build up your call. -/// let rb = hub.full_hashes(); -/// # } -/// ``` -pub struct FullHasheMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Safebrowsing, -} - -impl<'a, C, A> MethodsBuilder for FullHasheMethods<'a, C, A> {} - -impl<'a, C, A> FullHasheMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Finds the full hashes that match the requested hash prefixes. - /// - /// # Arguments - /// - /// * `request` - No description provided. - pub fn find(&self, request: FindFullHashesRequest) -> FullHasheFindCall<'a, C, A> { - FullHasheFindCall { - hub: self.hub, - _request: request, - _delegate: Default::default(), - _additional_params: Default::default(), - } - } -} - - - // ################### // CallBuilders ### // ################# -/// Lists the Safe Browsing threat lists available for download. +/// /// -/// A builder for the *list* method supported by a *threatList* resource. -/// It is not used directly, but through a `ThreatListMethods` instance. +/// A builder for the *get* method supported by a *encodedFullHashe* resource. +/// It is not used directly, but through a `EncodedFullHasheMethods` instance. /// /// # Example /// @@ -1070,25 +1226,30 @@ impl<'a, C, A> FullHasheMethods<'a, C, A> { /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.threat_lists().list() +/// let result = hub.encoded_full_hashes().get("encodedRequest") +/// .client_version("amet.") +/// .client_id("erat") /// .doit(); /// # } /// ``` -pub struct ThreatListListCall<'a, C, A> +pub struct EncodedFullHasheGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Safebrowsing, + _encoded_request: String, + _client_version: Option, + _client_id: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, } -impl<'a, C, A> CallBuilder for ThreatListListCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for EncodedFullHasheGetCall<'a, C, A> {} -impl<'a, C, A> ThreatListListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> EncodedFullHasheGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ListThreatListsResponse)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, FindFullHashesResponse)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -1096,10 +1257,17 @@ impl<'a, C, A> ThreatListListCall<'a, C, A> where C: BorrowMut, A Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "safebrowsing.threatLists.list", + dlg.begin(MethodInfo { id: "safebrowsing.encodedFullHashes.get", 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() { + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("encodedRequest", self._encoded_request.to_string())); + if let Some(value) = self._client_version { + params.push(("clientVersion", value.to_string())); + } + if let Some(value) = self._client_id { + params.push(("clientId", value.to_string())); + } + for &field in ["alt", "encodedRequest", "clientVersion", "clientId"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -1111,7 +1279,7 @@ impl<'a, C, A> ThreatListListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v4/threatLists"; + let mut url = "https://safebrowsing.googleapis.com/v4/encodedFullHashes/{encodedRequest}".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1125,6 +1293,27 @@ impl<'a, C, A> ThreatListListCall<'a, C, A> where C: BorrowMut, A } } + for &(find_this, param_name) in [("{encodedRequest}", "encodedRequest")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["encodedRequest"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } if params.len() > 0 { url.push('?'); @@ -1188,221 +1377,29 @@ impl<'a, C, A> ThreatListListCall<'a, C, A> where C: BorrowMut, A } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. + /// A serialized FindFullHashesRequest proto. /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> ThreatListListCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> ThreatListListCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - -} - - -/// Finds the threat entries that match the Safe Browsing lists. -/// -/// A builder for the *find* method supported by a *threatMatche* resource. -/// It is not used directly, but through a `ThreatMatcheMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_safebrowsing4 as safebrowsing4; -/// use safebrowsing4::FindThreatMatchesRequest; -/// # #[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::new(), -/// # ::default(), None); -/// # let mut hub = Safebrowsing::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = FindThreatMatchesRequest::default(); -/// -/// // You can configure optional parameters by calling 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_matches().find(req) -/// .doit(); -/// # } -/// ``` -pub struct ThreatMatcheFindCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Safebrowsing, - _request: FindThreatMatchesRequest, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, -} - -impl<'a, C, A> CallBuilder for ThreatMatcheFindCall<'a, C, A> {} - -impl<'a, C, A> ThreatMatcheFindCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, FindThreatMatchesResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.threatMatches.find", - 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/threatMatches:find"; - - 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. + /// Sets the *encoded request* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn request(mut self, new_value: FindThreatMatchesRequest) -> ThreatMatcheFindCall<'a, C, A> { - self._request = new_value; + pub fn encoded_request(mut self, new_value: &str) -> EncodedFullHasheGetCall<'a, C, A> { + self._encoded_request = new_value.to_string(); + self + } + /// The version of the client implementation. + /// + /// Sets the *client version* query property to the given value. + pub fn client_version(mut self, new_value: &str) -> EncodedFullHasheGetCall<'a, C, A> { + self._client_version = Some(new_value.to_string()); + self + } + /// A client ID that (hopefully) uniquely identifies the client implementation + /// of the Safe Browsing API. + /// + /// Sets the *client id* query property to the given value. + pub fn client_id(mut self, new_value: &str) -> EncodedFullHasheGetCall<'a, C, A> { + self._client_id = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -1411,7 +1408,7 @@ impl<'a, C, A> ThreatMatcheFindCall<'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) -> ThreatMatcheFindCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> EncodedFullHasheGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -1425,10 +1422,10 @@ impl<'a, C, A> ThreatMatcheFindCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -1438,224 +1435,7 @@ impl<'a, C, A> ThreatMatcheFindCall<'a, C, A> where C: BorrowMut, /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. - pub fn param(mut self, name: T, value: T) -> ThreatMatcheFindCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - -} - - -/// Fetches the most recent threat list updates. A client can request updates for multiple lists at once. -/// -/// A builder for the *fetch* method supported by a *threatListUpdate* resource. -/// It is not used directly, but through a `ThreatListUpdateMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_safebrowsing4 as safebrowsing4; -/// use safebrowsing4::FetchThreatListUpdatesRequest; -/// # #[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::new(), -/// # ::default(), None); -/// # let mut hub = Safebrowsing::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = FetchThreatListUpdatesRequest::default(); -/// -/// // You can configure optional parameters by calling 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_list_updates().fetch(req) -/// .doit(); -/// # } -/// ``` -pub struct ThreatListUpdateFetchCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Safebrowsing, - _request: FetchThreatListUpdatesRequest, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, -} - -impl<'a, C, A> CallBuilder for ThreatListUpdateFetchCall<'a, C, A> {} - -impl<'a, C, A> ThreatListUpdateFetchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, FetchThreatListUpdatesResponse)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.threatListUpdates.fetch", - 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/threatListUpdates:fetch"; - - 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: FetchThreatListUpdatesRequest) -> ThreatListUpdateFetchCall<'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) -> ThreatListUpdateFetchCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> ThreatListUpdateFetchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> EncodedFullHasheGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -1738,7 +1518,7 @@ impl<'a, C, A> FullHasheFindCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v4/fullHashes:find"; + let mut url = "https://safebrowsing.googleapis.com/v4/fullHashes:find".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1859,10 +1639,10 @@ impl<'a, C, A> FullHasheFindCall<'a, C, A> where C: BorrowMut, A: /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -1881,3 +1661,869 @@ impl<'a, C, A> FullHasheFindCall<'a, C, A> where C: BorrowMut, A: } +/// Fetches the most recent threat list updates. A client can request updates +/// for multiple lists at once. +/// +/// A builder for the *fetch* method supported by a *threatListUpdate* resource. +/// It is not used directly, but through a `ThreatListUpdateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_safebrowsing4 as safebrowsing4; +/// use safebrowsing4::FetchThreatListUpdatesRequest; +/// # #[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::new(), +/// # ::default(), None); +/// # let mut hub = Safebrowsing::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = FetchThreatListUpdatesRequest::default(); +/// +/// // You can configure optional parameters by calling 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_list_updates().fetch(req) +/// .doit(); +/// # } +/// ``` +pub struct ThreatListUpdateFetchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Safebrowsing, + _request: FetchThreatListUpdatesRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for ThreatListUpdateFetchCall<'a, C, A> {} + +impl<'a, C, A> ThreatListUpdateFetchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, FetchThreatListUpdatesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.threatListUpdates.fetch", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://safebrowsing.googleapis.com/v4/threatListUpdates:fetch".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).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: FetchThreatListUpdatesRequest) -> ThreatListUpdateFetchCall<'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) -> ThreatListUpdateFetchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ThreatListUpdateFetchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// +/// +/// A builder for the *get* method supported by a *encodedUpdate* resource. +/// It is not used directly, but through a `EncodedUpdateMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # 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::new(), +/// # ::default(), None); +/// # let mut hub = Safebrowsing::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.encoded_updates().get("encodedRequest") +/// .client_version("sea") +/// .client_id("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct EncodedUpdateGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Safebrowsing, + _encoded_request: String, + _client_version: Option, + _client_id: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for EncodedUpdateGetCall<'a, C, A> {} + +impl<'a, C, A> EncodedUpdateGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, FetchThreatListUpdatesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.encodedUpdates.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("encodedRequest", self._encoded_request.to_string())); + if let Some(value) = self._client_version { + params.push(("clientVersion", value.to_string())); + } + if let Some(value) = self._client_id { + params.push(("clientId", value.to_string())); + } + for &field in ["alt", "encodedRequest", "clientVersion", "clientId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://safebrowsing.googleapis.com/v4/encodedUpdates/{encodedRequest}".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + for &(find_this, param_name) in [("{encodedRequest}", "encodedRequest")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["encodedRequest"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index 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 serialized FetchThreatListUpdatesRequest proto. + /// + /// Sets the *encoded request* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn encoded_request(mut self, new_value: &str) -> EncodedUpdateGetCall<'a, C, A> { + self._encoded_request = new_value.to_string(); + self + } + /// The version of the client implementation. + /// + /// Sets the *client version* query property to the given value. + pub fn client_version(mut self, new_value: &str) -> EncodedUpdateGetCall<'a, C, A> { + self._client_version = Some(new_value.to_string()); + self + } + /// A client ID that uniquely identifies the client implementation of the Safe + /// Browsing API. + /// + /// Sets the *client id* query property to the given value. + pub fn client_id(mut self, new_value: &str) -> EncodedUpdateGetCall<'a, C, A> { + self._client_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) -> EncodedUpdateGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> EncodedUpdateGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Lists the Safe Browsing threat lists available for download. +/// +/// A builder for the *list* method supported by a *threatList* resource. +/// It is not used directly, but through a `ThreatListMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # 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::new(), +/// # ::default(), None); +/// # let mut hub = Safebrowsing::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.threat_lists().list() +/// .doit(); +/// # } +/// ``` +pub struct ThreatListListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Safebrowsing, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for ThreatListListCall<'a, C, A> {} + +impl<'a, C, A> ThreatListListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ListThreatListsResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.threatLists.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 = "https://safebrowsing.googleapis.com/v4/threatLists".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + 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) -> ThreatListListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ThreatListListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + +} + + +/// Finds the threat entries that match the Safe Browsing lists. +/// +/// A builder for the *find* method supported by a *threatMatche* resource. +/// It is not used directly, but through a `ThreatMatcheMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_safebrowsing4 as safebrowsing4; +/// use safebrowsing4::FindThreatMatchesRequest; +/// # #[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::new(), +/// # ::default(), None); +/// # let mut hub = Safebrowsing::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = FindThreatMatchesRequest::default(); +/// +/// // You can configure optional parameters by calling 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_matches().find(req) +/// .doit(); +/// # } +/// ``` +pub struct ThreatMatcheFindCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Safebrowsing, + _request: FindThreatMatchesRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for ThreatMatcheFindCall<'a, C, A> {} + +impl<'a, C, A> ThreatMatcheFindCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, FindThreatMatchesResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.threatMatches.find", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://safebrowsing.googleapis.com/v4/threatMatches:find".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).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: FindThreatMatchesRequest) -> ThreatMatcheFindCall<'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) -> ThreatMatcheFindCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> ThreatMatcheFindCall<'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 new file mode 100644 index 0000000000..2dffcc848e --- /dev/null +++ b/gen/searchconsole1-cli/Cargo.toml @@ -0,0 +1,37 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-searchconsole1-cli" +version = "1.0.4+20170520" +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" +homepage = "https://developers.google.com/webmaster-tools/search-console-api/" +documentation = "http://byron.github.io/google-apis-rs/google_searchconsole1_cli" +license = "MIT" +keywords = ["searchconsole", "google", "cli"] + +[[bin]] +name = "searchconsole1" + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 0.9" +serde_json = "^ 0.9" +serde_derive = "^ 0.9" +yup-oauth2 = "^ 1.0" +strsim = "^0.5" +hyper-rustls = "^0.6" +yup-hyper-mock = "^2.0" +clap = "^2.0" + +[features] + + + +[dependencies.google-searchconsole1] +path = "../searchconsole1" +version = "1.0.4+20170520" diff --git a/gen/searchconsole1-cli/LICENSE.md b/gen/searchconsole1-cli/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/searchconsole1-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/searchconsole1-cli/README.md b/gen/searchconsole1-cli/README.md new file mode 100644 index 0000000000..3515b412de --- /dev/null +++ b/gen/searchconsole1-cli/README.md @@ -0,0 +1,110 @@ + +The `searchconsole1` command-line interface *(CLI)* allows to use most features of the *Google Search Console* 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 *Search Console* API can be found at the +[official documentation site](https://developers.google.com/webmaster-tools/search-console-api/). + +# Installation and Source Code + +Install the command-line interface with cargo using: + +```bash +cargo install google-searchconsole1-cli +``` + +Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/searchconsole1-cli). + +# Usage + +This documentation was generated from the *Search Console* API at revision *20170520*. The CLI is at version *1.0.4*. + +```bash +searchconsole1 [options] + url-testing-tools + mobile-friendly-test-run (-r )... [-p ]... [-o ] + searchconsole1 --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 `searchconsole1-`. 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/searchconsole1-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/searchconsole1-secret.json`, assuming that the required *searchconsole* 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. `searchconsole1 --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/searchconsole1-cli/mkdocs.yml b/gen/searchconsole1-cli/mkdocs.yml new file mode 100644 index 0000000000..302cd0f07b --- /dev/null +++ b/gen/searchconsole1-cli/mkdocs.yml @@ -0,0 +1,17 @@ +site_name: Search Console v1.0.4+20170520 +site_url: http://byron.github.io/google-apis-rs/google-searchconsole1-cli +site_description: A complete library to interact with Search Console (protocol v1) + +repo_url: https://github.com/Byron/google-apis-rs/tree/master/gen/searchconsole1-cli + +docs_dir: docs +site_dir: build_html + +pages: +- ['index.md', 'Home'] +- ['url-testing-tools_mobile-friendly-test-run.md', 'Url Testing Tools', 'Mobile Friendly Test Run'] + +theme: readthedocs + +copyright: Copyright © 2015-2016, `Sebastian Thiel` + diff --git a/gen/searchconsole1-cli/src/cmn.rs b/gen/searchconsole1-cli/src/cmn.rs new file mode 100644 index 0000000000..6cc030e9c4 --- /dev/null +++ b/gen/searchconsole1-cli/src/cmn.rs @@ -0,0 +1,747 @@ +// 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/searchconsole1-cli/src/main.rs b/gen/searchconsole1-cli/src/main.rs new file mode 100644 index 0000000000..739229dd1c --- /dev/null +++ b/gen/searchconsole1-cli/src/main.rs @@ -0,0 +1,351 @@ +// 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_searchconsole1 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::SearchConsole>, + gp: Vec<&'static str>, + gpm: Vec<(&'static str, &'static str)>, +} + + +impl<'n> Engine<'n> { + fn _url_testing_tools_mobile_friendly_test_run(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "url" => Some(("url", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "request-screenshot" => Some(("requestScreenshot", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["request-screenshot", "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::RunMobileFriendlyTestRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.url_testing_tools().mobile_friendly_test_run(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 _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() { + ("url-testing-tools", Some(opt)) => { + match opt.subcommand() { + ("mobile-friendly-test-run", Some(opt)) => { + call_result = self._url_testing_tools_mobile_friendly_test_run(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("url-testing-tools".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, "searchconsole1-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: "searchconsole1", + 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::SearchConsole::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 = [ + ("url-testing-tools", "methods: 'mobile-friendly-test-run'", vec![ + ("mobile-friendly-test-run", + Some(r##"Runs Mobile-Friendly Test for a given URL."##), + "Details at http://byron.github.io/google-apis-rs/google_searchconsole1_cli/url-testing-tools_mobile-friendly-test-run", + vec![ + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + + ]; + + let mut app = App::new("searchconsole1") + .author("Sebastian Thiel ") + .version("1.0.4+20170520") + .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") + .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/searchconsole1/Cargo.toml b/gen/searchconsole1/Cargo.toml new file mode 100644 index 0000000000..cc6861a594 --- /dev/null +++ b/gen/searchconsole1/Cargo.toml @@ -0,0 +1,28 @@ +# DO NOT EDIT ! +# This file was generated automatically from 'src/mako/Cargo.toml.mako' +# DO NOT EDIT ! +[package] + +name = "google-searchconsole1" +version = "1.0.4+20170520" +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.4+20170520" +license = "MIT" +keywords = ["searchconsole", "google", "protocol", "web", "api"] + + +[dependencies] +hyper = "^ 0.10" +mime = "^ 0.2.0" +serde = "^ 0.9" +serde_json = "^ 0.9" +serde_derive = "^ 0.9" +yup-oauth2 = "^ 1.0" +url = "= 0.5" + +[features] + + diff --git a/gen/searchconsole1/LICENSE.md b/gen/searchconsole1/LICENSE.md new file mode 100644 index 0000000000..ff523b4547 --- /dev/null +++ b/gen/searchconsole1/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/searchconsole1/README.md b/gen/searchconsole1/README.md new file mode 100644 index 0000000000..3b6ff005df --- /dev/null +++ b/gen/searchconsole1/README.md @@ -0,0 +1,179 @@ + +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.4+20170520*, where *20170520* is the exact revision of the *searchconsole:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. + +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.4+20170520/google_searchconsole1/struct.SearchConsole.html) ... + +* url testing tools + * [*mobile friendly test run*](https://docs.rs/google-searchconsole1/1.0.4+20170520/google_searchconsole1/struct.UrlTestingToolMobileFriendlyTestRunCall.html) + + + + +# Structure of this Library + +The API is structured into the following primary items: + +* **[Hub](https://docs.rs/google-searchconsole1/1.0.4+20170520/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.4+20170520/google_searchconsole1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-searchconsole1/1.0.4+20170520/google_searchconsole1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-searchconsole1/1.0.4+20170520/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.4+20170520/google_searchconsole1/trait.Part.html)** + * a collection of properties + * never directly used in *Activities* +* **[Activities](https://docs.rs/google-searchconsole1/1.0.4+20170520/google_searchconsole1/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.url_testing_tools().mobile_friendly_test_run(...).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-searchconsole1 = "*" +``` + +## A complete example + +```Rust +extern crate hyper; +extern crate yup_oauth2 as oauth2; +extern crate google_searchconsole1 as searchconsole1; +use searchconsole1::RunMobileFriendlyTestRequest; +use searchconsole1::{Result, Error}; +use std::default::Default; +use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +use searchconsole1::SearchConsole; + +// Get an ApplicationSecret instance by some means. It contains the `client_id` and +// `client_secret`, among other things. +let secret: ApplicationSecret = Default::default(); +// Instantiate the authenticator. It will choose a suitable authentication flow for you, +// unless you replace `None` with the desired Flow. +// Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +// what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +// retrieve them from storage. +let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, + hyper::Client::new(), + ::default(), None); +let mut hub = SearchConsole::new(hyper::Client::new(), auth); +// As the method needs a request, you would usually fill it with the desired information +// into the respective structure. Some of the parts shown here might not be applicable ! +// Values shown here are possibly random and not representative ! +let mut req = RunMobileFriendlyTestRequest::default(); + +// You can configure optional parameters by calling the respective setters at will, and +// execute the final call using `doit()`. +// Values shown here are possibly random and not representative ! +let result = hub.url_testing_tools().mobile_friendly_test_run(req) + .doit(); + +match result { + Err(e) => match e { + // The Error enum provides details about what exactly happened. + // You can also just use its `Debug`, `Display` or `Error` traits + Error::HttpError(_) + |Error::MissingAPIKey + |Error::MissingToken(_) + |Error::Cancelled + |Error::UploadSizeLimitExceeded(_, _) + |Error::Failure(_) + |Error::BadRequest(_) + |Error::FieldClash(_) + |Error::JsonDecodeError(_, _) => println!("{}", e), + }, + Ok(res) => println!("Success: {:?}", res), +} + +``` +## Handling Errors + +All errors produced by the system are provided either as [Result](https://docs.rs/google-searchconsole1/1.0.4+20170520/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.4+20170520/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.4+20170520/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.4+20170520/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")`. + +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-searchconsole1/1.0.4+20170520/google_searchconsole1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-searchconsole1/1.0.4+20170520/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.4+20170520/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.4+20170520/google_searchconsole1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-searchconsole1/1.0.4+20170520/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.4+20170520/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.4+20170520/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.4+20170520/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. + +[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 **searchconsole1** 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/searchconsole1/src/cmn.rs b/gen/searchconsole1/src/cmn.rs new file mode 100644 index 0000000000..77d71c8896 --- /dev/null +++ b/gen/searchconsole1/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/searchconsole1/src/lib.rs b/gen/searchconsole1/src/lib.rs new file mode 100644 index 0000000000..22bd76214f --- /dev/null +++ b/gen/searchconsole1/src/lib.rs @@ -0,0 +1,731 @@ +// DO NOT EDIT ! +// 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.4+20170520*, where *20170520* is the exact revision of the *searchconsole:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! +//! 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/). +//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/searchconsole1). +//! # Features +//! +//! Handle the following *Resources* with ease from the central [hub](struct.SearchConsole.html) ... +//! +//! * url testing tools +//! * [*mobile friendly test run*](struct.UrlTestingToolMobileFriendlyTestRunCall.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.SearchConsole.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.url_testing_tools().mobile_friendly_test_run(...).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-searchconsole1 = "*" +//! ``` +//! +//! ## A complete example +//! +//! ```test_harness,no_run +//! extern crate hyper; +//! extern crate yup_oauth2 as oauth2; +//! extern crate google_searchconsole1 as searchconsole1; +//! use searchconsole1::RunMobileFriendlyTestRequest; +//! use searchconsole1::{Result, Error}; +//! # #[test] fn egal() { +//! use std::default::Default; +//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +//! use searchconsole1::SearchConsole; +//! +//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and +//! // `client_secret`, among other things. +//! let secret: ApplicationSecret = Default::default(); +//! // Instantiate the authenticator. It will choose a suitable authentication flow for you, +//! // unless you replace `None` with the desired Flow. +//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +//! // retrieve them from storage. +//! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +//! hyper::Client::new(), +//! ::default(), None); +//! let mut hub = SearchConsole::new(hyper::Client::new(), auth); +//! // As the method needs a request, you would usually fill it with the desired information +//! // into the respective structure. Some of the parts shown here might not be applicable ! +//! // Values shown here are possibly random and not representative ! +//! let mut req = RunMobileFriendlyTestRequest::default(); +//! +//! // You can configure optional parameters by calling the respective setters at will, and +//! // execute the final call using `doit()`. +//! // Values shown here are possibly random and not representative ! +//! let result = hub.url_testing_tools().mobile_friendly_test_run(req) +//! .doit(); +//! +//! match result { +//! Err(e) => match e { +//! // The Error enum provides details about what exactly happened. +//! // You can also just use its `Debug`, `Display` or `Error` traits +//! Error::HttpError(_) +//! |Error::MissingAPIKey +//! |Error::MissingToken(_) +//! |Error::Cancelled +//! |Error::UploadSizeLimitExceeded(_, _) +//! |Error::Failure(_) +//! |Error::BadRequest(_) +//! |Error::FieldClash(_) +//! |Error::JsonDecodeError(_, _) => println!("{}", e), +//! }, +//! Ok(res) => println!("Success: {:?}", res), +//! } +//! # } +//! ``` +//! ## Handling Errors +//! +//! All errors produced by the system are provided either as [Result](enum.Result.html) enumeration as return value of +//! the doit() methods, or handed as possibly intermediate results to either the +//! [Hub Delegate](trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +//! +//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This +//! makes the system potentially resilient to all kinds of errors. +//! +//! ## Uploads and Downloads +//! If a method supports downloads, the response body, which is part of the [Result](enum.Result.html), should be +//! read by you to obtain the media. +//! If such a method also supports a [Response Result](trait.ResponseResult.html), it will return that by default. +//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making +//! this call: `.param("alt", "media")`. +//! +//! Methods supporting uploads can do so using up to 2 different protocols: +//! *simple* and *resumable*. The distinctiveness of each is represented by customized +//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively. +//! +//! ## Customization and Callbacks +//! +//! You may alter the way an `doit()` method is called by providing a [delegate](trait.Delegate.html) to the +//! [Method Builder](trait.CallBuilder.html) before making the final `doit()` call. +//! Respective methods will be called to provide progress information, as well as determine whether the system should +//! retry on failure. +//! +//! The [delegate trait](trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +//! +//! ## Optional Parts in Server-Requests +//! +//! All structures provided by this library are made to be [enocodable](trait.RequestValue.html) and +//! [decodable](trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +//! are valid. +//! Most optionals are are considered [Parts](trait.Part.html) which are identifiable by name, which will be sent to +//! the server to indicate either the set parts of the request or the desired parts in the response. +//! +//! ## Builder Arguments +//! +//! Using [method builders](trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +//! These will always take a single argument, for which the following statements are true. +//! +//! * [PODs][wiki-pod] are handed by copy +//! * strings are passed as `&str` +//! * [request values](trait.RequestValue.html) are moved +//! +//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times. +//! +//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure +//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern +//! [google-go-api]: https://github.com/google/google-api-go-client +//! +//! + +// Unused attributes happen thanks to defined, but unused structures +// We don't warn about this, as depending on the API, some data structures or facilities are never used. +// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any +// unused imports in fully featured APIs. Same with unused_mut ... . +#![allow(unused_imports, unused_mut, dead_code)] + +// DO NOT EDIT ! +// This file was generated automatically from 'src/mako/api/lib.rs.mako' +// DO NOT EDIT ! + +#[macro_use] +extern crate serde_derive; + +extern crate hyper; +extern crate serde; +extern crate serde_json; +extern crate yup_oauth2 as oauth2; +extern crate mime; +extern crate url; + +mod cmn; + +use std::collections::HashMap; +use std::cell::RefCell; +use std::borrow::BorrowMut; +use std::default::Default; +use std::collections::BTreeMap; +use serde_json as json; +use std::io; +use std::fs; +use std::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 SearchConsole related resource activities +/// +/// # Examples +/// +/// Instantiate a new hub +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_searchconsole1 as searchconsole1; +/// use searchconsole1::RunMobileFriendlyTestRequest; +/// use searchconsole1::{Result, Error}; +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use searchconsole1::SearchConsole; +/// +/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and +/// // `client_secret`, among other things. +/// let secret: ApplicationSecret = Default::default(); +/// // Instantiate the authenticator. It will choose a suitable authentication flow for you, +/// // unless you replace `None` with the desired Flow. +/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about +/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and +/// // retrieve them from storage. +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = SearchConsole::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = RunMobileFriendlyTestRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.url_testing_tools().mobile_friendly_test_run(req) +/// .doit(); +/// +/// match result { +/// Err(e) => match e { +/// // The Error enum provides details about what exactly happened. +/// // You can also just use its `Debug`, `Display` or `Error` traits +/// Error::HttpError(_) +/// |Error::MissingAPIKey +/// |Error::MissingToken(_) +/// |Error::Cancelled +/// |Error::UploadSizeLimitExceeded(_, _) +/// |Error::Failure(_) +/// |Error::BadRequest(_) +/// |Error::FieldClash(_) +/// |Error::JsonDecodeError(_, _) => println!("{}", e), +/// }, +/// Ok(res) => println!("Success: {:?}", res), +/// } +/// # } +/// ``` +pub struct SearchConsole { + client: RefCell, + auth: RefCell, + _user_agent: String, +} + +impl<'a, C, A> Hub for SearchConsole {} + +impl<'a, C, A> SearchConsole + where C: BorrowMut, A: oauth2::GetToken { + + pub fn new(client: C, authenticator: A) -> SearchConsole { + SearchConsole { + client: RefCell::new(client), + auth: RefCell::new(authenticator), + _user_agent: "google-api-rust-client/1.0.4".to_string(), + } + } + + pub fn url_testing_tools(&'a self) -> UrlTestingToolMethods<'a, C, A> { + UrlTestingToolMethods { 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.4`. + /// + /// Returns the previously set user-agent. + pub fn user_agent(&mut self, agent_name: String) -> String { + let prev = self._user_agent.clone(); + self._user_agent = agent_name; + prev + } +} + + +// ############ +// SCHEMAS ### +// ########## +/// Information about a resource with issue. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ResourceIssue { + /// Describes a blocked resource issue. + #[serde(rename="blockedResource")] + pub blocked_resource: Option, +} + +impl Part for ResourceIssue {} + + +/// Final state of the test, including error details if necessary. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestStatus { + /// Status of the test. + pub status: Option, + /// Error details if applicable. + pub details: Option, +} + +impl Part for TestStatus {} + + +/// Mobile-friendly issue. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct MobileFriendlyIssue { + /// Rule violated. + pub rule: Option, +} + +impl Part for MobileFriendlyIssue {} + + +/// Mobile-friendly test 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*). +/// +/// * [mobile friendly test run url testing tools](struct.UrlTestingToolMobileFriendlyTestRunCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RunMobileFriendlyTestRequest { + /// URL for inspection. + pub url: Option, + /// Whether or not screenshot is requested. Default is false. + #[serde(rename="requestScreenshot")] + pub request_screenshot: Option, +} + +impl RequestValue for RunMobileFriendlyTestRequest {} + + +/// Mobile-friendly test response, including mobile-friendly issues and resource +/// issues. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [mobile friendly test run url testing tools](struct.UrlTestingToolMobileFriendlyTestRunCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct RunMobileFriendlyTestResponse { + /// Final state of the test, can be either complete or an error. + #[serde(rename="testStatus")] + pub test_status: Option, + /// Information about embedded resources issues. + #[serde(rename="resourceIssues")] + pub resource_issues: Option>, + /// Test verdict, whether the page is mobile friendly or not. + #[serde(rename="mobileFriendliness")] + pub mobile_friendliness: Option, + /// Screenshot of the requested URL. + pub screenshot: Option, + /// List of mobile-usability issues. + #[serde(rename="mobileFriendlyIssues")] + pub mobile_friendly_issues: Option>, +} + +impl ResponseResult for RunMobileFriendlyTestResponse {} + + +/// Describe image 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 Image { + /// The mime-type of the image data. + #[serde(rename="mimeType")] + pub mime_type: Option, + /// Image data in format determined by the mime type. Currently, the format + /// will always be "image/png", but this might change in the future. + pub data: Option, +} + +impl Part for Image {} + + +/// Blocked resource. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BlockedResource { + /// URL of the blocked resource. + pub url: Option, +} + +impl Part for BlockedResource {} + + + +// ################### +// MethodBuilders ### +// ################# + +/// A builder providing access to all methods supported on *urlTestingTool* resources. +/// It is not used directly, but through the `SearchConsole` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_searchconsole1 as searchconsole1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use searchconsole1::SearchConsole; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = SearchConsole::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `mobile_friendly_test_run(...)` +/// // to build up your call. +/// let rb = hub.url_testing_tools(); +/// # } +/// ``` +pub struct UrlTestingToolMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SearchConsole, +} + +impl<'a, C, A> MethodsBuilder for UrlTestingToolMethods<'a, C, A> {} + +impl<'a, C, A> UrlTestingToolMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Runs Mobile-Friendly Test for a given URL. + /// + /// # Arguments + /// + /// * `request` - No description provided. + pub fn mobile_friendly_test_run(&self, request: RunMobileFriendlyTestRequest) -> UrlTestingToolMobileFriendlyTestRunCall<'a, C, A> { + UrlTestingToolMobileFriendlyTestRunCall { + hub: self.hub, + _request: request, + _delegate: Default::default(), + _additional_params: Default::default(), + } + } +} + + + + + +// ################### +// CallBuilders ### +// ################# + +/// Runs Mobile-Friendly Test for a given URL. +/// +/// A builder for the *mobileFriendlyTest.run* method supported by a *urlTestingTool* resource. +/// It is not used directly, but through a `UrlTestingToolMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_searchconsole1 as searchconsole1; +/// use searchconsole1::RunMobileFriendlyTestRequest; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use searchconsole1::SearchConsole; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = SearchConsole::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = RunMobileFriendlyTestRequest::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.url_testing_tools().mobile_friendly_test_run(req) +/// .doit(); +/// # } +/// ``` +pub struct UrlTestingToolMobileFriendlyTestRunCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a SearchConsole, + _request: RunMobileFriendlyTestRequest, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, +} + +impl<'a, C, A> CallBuilder for UrlTestingToolMobileFriendlyTestRunCall<'a, C, A> {} + +impl<'a, C, A> UrlTestingToolMobileFriendlyTestRunCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, RunMobileFriendlyTestResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "searchconsole.urlTestingTools.mobileFriendlyTest.run", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + for &field in ["alt"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://searchconsole.googleapis.com/v1/urlTestingTools/mobileFriendlyTest:run".to_string(); + + let mut key = self.hub.auth.borrow_mut().api_key(); + if key.is_none() { + key = dlg.api_key(); + } + match key { + Some(value) => params.push(("key", value)), + None => { + dlg.finished(false); + return Err(Error::MissingAPIKey) + } + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).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: RunMobileFriendlyTestRequest) -> UrlTestingToolMobileFriendlyTestRunCall<'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) -> UrlTestingToolMobileFriendlyTestRunCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> UrlTestingToolMobileFriendlyTestRunCall<'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/serviceregistryalpha-cli/Cargo.toml b/gen/serviceregistryalpha-cli/Cargo.toml index a415be4e35..552f0a3ac2 100644 --- a/gen/serviceregistryalpha-cli/Cargo.toml +++ b/gen/serviceregistryalpha-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/serviceregistryalpha/src/lib.rs b/gen/serviceregistryalpha/src/lib.rs index 13656657e8..4cb12ff05c 100644 --- a/gen/serviceregistryalpha/src/lib.rs +++ b/gen/serviceregistryalpha/src/lib.rs @@ -181,7 +181,7 @@ // 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 +// 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)] @@ -322,8 +322,6 @@ pub struct ServiceRegistry { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for ServiceRegistry {} @@ -336,8 +334,6 @@ impl<'a, C, A> ServiceRegistry client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/serviceregistry/alpha/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -357,26 +353,6 @@ impl<'a, C, A> ServiceRegistry self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/serviceregistry/alpha/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -956,7 +932,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/operations/{operation}"; + let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/operations/{operation}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -1221,7 +1197,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/operations"; + let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::NdevCloudmanReadonly.as_ref().to_string(), ()); } @@ -1503,7 +1479,7 @@ impl<'a, C, A> EndpointInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/endpoints"; + let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -1764,7 +1740,7 @@ impl<'a, C, A> EndpointDeleteCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/endpoints/{endpoint}"; + let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints/{endpoint}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2018,7 +1994,7 @@ impl<'a, C, A> EndpointUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/endpoints/{endpoint}"; + let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints/{endpoint}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2296,7 +2272,7 @@ impl<'a, C, A> EndpointPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/endpoints/{endpoint}"; + let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints/{endpoint}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2585,7 +2561,7 @@ impl<'a, C, A> EndpointListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/endpoints"; + let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2862,7 +2838,7 @@ impl<'a, C, A> EndpointGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/global/endpoints/{endpoint}"; + let mut url = "https://www.googleapis.com/serviceregistry/alpha/projects/{project}/global/endpoints/{endpoint}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3037,3 +3013,4 @@ impl<'a, C, A> EndpointGetCall<'a, C, A> where C: BorrowMut, A: o } + diff --git a/gen/siteverification1-cli/Cargo.toml b/gen/siteverification1-cli/Cargo.toml index f1ce8e332d..7003225a01 100644 --- a/gen/siteverification1-cli/Cargo.toml +++ b/gen/siteverification1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-siteverification1-cli" -version = "1.0.4+20160228" +version = "1.0.4+20161114" authors = ["Sebastian Thiel "] description = "A complete library to interact with siteVerification (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/siteverification1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-siteverification1] path = "../siteverification1" -version = "1.0.4+20160228" +version = "1.0.4+20161114" diff --git a/gen/siteverification1-cli/README.md b/gen/siteverification1-cli/README.md index 5e656229fa..4a56983c62 100644 --- a/gen/siteverification1-cli/README.md +++ b/gen/siteverification1-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 *siteVerification* API at revision *20160228*. The CLI is at version *1.0.4*. +This documentation was generated from the *siteVerification* API at revision *20161114*. The CLI is at version *1.0.4*. ```bash siteverification1 [options] diff --git a/gen/siteverification1-cli/mkdocs.yml b/gen/siteverification1-cli/mkdocs.yml index 67192bd499..5870bd288e 100644 --- a/gen/siteverification1-cli/mkdocs.yml +++ b/gen/siteverification1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: siteVerification v1.0.4+20160228 +site_name: siteVerification v1.0.4+20161114 site_url: http://byron.github.io/google-apis-rs/google-siteverification1-cli site_description: A complete library to interact with siteVerification (protocol v1) diff --git a/gen/siteverification1-cli/src/main.rs b/gen/siteverification1-cli/src/main.rs index 532dd7af23..721d4c2fe9 100644 --- a/gen/siteverification1-cli/src/main.rs +++ b/gen/siteverification1-cli/src/main.rs @@ -828,7 +828,7 @@ fn main() { let mut app = App::new("siteverification1") .author("Sebastian Thiel ") - .version("1.0.4+20160228") + .version("1.0.4+20161114") .about("Verifies ownership of websites or domains with Google.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_siteverification1_cli") .arg(Arg::with_name("url") diff --git a/gen/siteverification1/Cargo.toml b/gen/siteverification1/Cargo.toml index efcb9d1d23..22e8ea8386 100644 --- a/gen/siteverification1/Cargo.toml +++ b/gen/siteverification1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-siteverification1" -version = "1.0.4+20160228" +version = "1.0.4+20161114" authors = ["Sebastian Thiel "] description = "A complete library to interact with siteVerification (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/siteverification1" homepage = "https://developers.google.com/site-verification/" -documentation = "https://docs.rs/google-siteverification1/1.0.4+20160228" +documentation = "https://docs.rs/google-siteverification1/1.0.4+20161114" license = "MIT" keywords = ["siteVerification", "google", "protocol", "web", "api"] diff --git a/gen/siteverification1/README.md b/gen/siteverification1/README.md index d0b74da12c..4d0b894cd4 100644 --- a/gen/siteverification1/README.md +++ b/gen/siteverification1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-siteverification1` library allows access to all features of the *Google siteVerification* service. -This documentation was generated from *siteVerification* crate version *1.0.4+20160228*, where *20160228* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *siteVerification* crate version *1.0.4+20161114*, where *20161114* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *siteVerification* *v1* API can be found at the [official documentation site](https://developers.google.com/site-verification/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/struct.SiteVerification.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/struct.SiteVerification.html) ... * web resource - * [*delete*](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/struct.WebResourceDeleteCall.html), [*get*](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/struct.WebResourceGetCall.html), [*get token*](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/struct.WebResourceGetTokenCall.html), [*insert*](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/struct.WebResourceInsertCall.html), [*list*](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/struct.WebResourceListCall.html), [*patch*](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/struct.WebResourcePatchCall.html) and [*update*](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/struct.WebResourceUpdateCall.html) + * [*delete*](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/struct.WebResourceDeleteCall.html), [*get*](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/struct.WebResourceGetCall.html), [*get token*](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/struct.WebResourceGetTokenCall.html), [*insert*](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/struct.WebResourceInsertCall.html), [*list*](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/struct.WebResourceListCall.html), [*patch*](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/struct.WebResourcePatchCall.html) and [*update*](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/struct.WebResourceUpdateCall.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-siteverification1/1.0.4+20160228/google_siteverification1/struct.SiteVerification.html)** +* **[Hub](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/struct.SiteVerification.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/trait.Part.html)** + * **[Parts](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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-siteverification1/1.0.4+20160228/google_siteverification1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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-siteverification1/1.0.4+20160228/google_siteverification1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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-siteverification1/1.0.4+20160228/google_siteverification1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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-siteverification1/1.0.4+20160228/google_siteverification1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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-siteverification1/1.0.4+20160228/google_siteverification1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/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-siteverification1/1.0.4+20161114/google_siteverification1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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-siteverification1/1.0.4+20160228/google_siteverification1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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-siteverification1/1.0.4+20160228/google_siteverification1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-siteverification1/1.0.4+20160228/google_siteverification1/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-siteverification1/1.0.4+20161114/google_siteverification1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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-siteverification1/1.0.4+20160228/google_siteverification1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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-siteverification1/1.0.4+20160228/google_siteverification1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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-siteverification1/1.0.4+20160228/google_siteverification1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-siteverification1/1.0.4+20161114/google_siteverification1/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/siteverification1/src/lib.rs b/gen/siteverification1/src/lib.rs index 7360659cee..75331c198c 100644 --- a/gen/siteverification1/src/lib.rs +++ b/gen/siteverification1/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 *siteVerification* crate version *1.0.4+20160228*, where *20160228* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *siteVerification* crate version *1.0.4+20161114*, where *20161114* is the exact revision of the *siteVerification:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *siteVerification* *v1* API can be found at the //! [official documentation site](https://developers.google.com/site-verification/). @@ -179,7 +179,7 @@ // 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 +// 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)] @@ -314,8 +314,6 @@ pub struct SiteVerification { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for SiteVerification {} @@ -328,8 +326,6 @@ impl<'a, C, A> SiteVerification client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/siteVerification/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -346,26 +342,6 @@ impl<'a, C, A> SiteVerification self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/siteVerification/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -733,7 +709,7 @@ impl<'a, C, A> WebResourceGetCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "webResource/{id}"; + let mut url = "https://www.googleapis.com/siteVerification/v1/webResource/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -975,7 +951,7 @@ impl<'a, C, A> WebResourcePatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "webResource/{id}"; + let mut url = "https://www.googleapis.com/siteVerification/v1/webResource/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1232,7 +1208,7 @@ impl<'a, C, A> WebResourceListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "webResource"; + let mut url = "https://www.googleapis.com/siteVerification/v1/webResource".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1435,7 +1411,7 @@ impl<'a, C, A> WebResourceDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "webResource/{id}"; + let mut url = "https://www.googleapis.com/siteVerification/v1/webResource/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1665,7 +1641,7 @@ impl<'a, C, A> WebResourceGetTokenCall<'a, C, A> where C: BorrowMut WebResourceUpdateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "webResource/{id}"; + let mut url = "https://www.googleapis.com/siteVerification/v1/webResource/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2166,7 +2142,7 @@ impl<'a, C, A> WebResourceInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "webResource"; + let mut url = "https://www.googleapis.com/siteVerification/v1/webResource".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2334,3 +2310,4 @@ impl<'a, C, A> WebResourceInsertCall<'a, C, A> where C: BorrowMut } + diff --git a/gen/slides1-cli/Cargo.toml b/gen/slides1-cli/Cargo.toml index e89ff9348c..a470598ca6 100644 --- a/gen/slides1-cli/Cargo.toml +++ b/gen/slides1-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-slides1-cli" -version = "1.0.4+20161213" +version = "1.0.4+20170509" authors = ["Sebastian Thiel "] description = "A complete library to interact with Slides (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/slides1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-slides1] path = "../slides1" -version = "1.0.4+20161213" +version = "1.0.4+20170509" diff --git a/gen/slides1/Cargo.toml b/gen/slides1/Cargo.toml index 342bbf6a22..29d81976dc 100644 --- a/gen/slides1/Cargo.toml +++ b/gen/slides1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-slides1" -version = "1.0.4+20161213" +version = "1.0.4+20170509" authors = ["Sebastian Thiel "] description = "A complete library to interact with Slides (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/slides1" homepage = "https://developers.google.com/slides/" -documentation = "https://docs.rs/google-slides1/1.0.4+20161213" +documentation = "https://docs.rs/google-slides1/1.0.4+20170509" license = "MIT" keywords = ["slides", "google", "protocol", "web", "api"] diff --git a/gen/slides1/README.md b/gen/slides1/README.md index 22d12f8c0c..2aa96dd17d 100644 --- a/gen/slides1/README.md +++ b/gen/slides1/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-slides1` library allows access to all features of the *Google Slides* service. -This documentation was generated from *Slides* crate version *1.0.4+20161213*, where *20161213* is the exact revision of the *slides:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Slides* crate version *1.0.4+20170509*, where *20170509* is the exact revision of the *slides:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *Slides* *v1* API can be found at the [official documentation site](https://developers.google.com/slides/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/struct.Slides.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/struct.Slides.html) ... -* [presentations](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/struct.Presentation.html) - * [*batch update*](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/struct.PresentationBatchUpdateCall.html), [*create*](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/struct.PresentationCreateCall.html), [*get*](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/struct.PresentationGetCall.html) and [*pages get*](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/struct.PresentationPageGetCall.html) +* [presentations](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/struct.Presentation.html) + * [*batch update*](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/struct.PresentationBatchUpdateCall.html), [*create*](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/struct.PresentationCreateCall.html), [*get*](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/struct.PresentationGetCall.html), [*pages get*](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/struct.PresentationPageGetCall.html) and [*pages get thumbnail*](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/struct.PresentationPageGetThumbnailCall.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-slides1/1.0.4+20161213/google_slides1/struct.Slides.html)** +* **[Hub](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/struct.Slides.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/trait.Part.html)** + * **[Parts](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -51,6 +51,7 @@ let r = hub.presentations().create(...).doit() let r = hub.presentations().get(...).doit() let r = hub.presentations().batch_update(...).doit() let r = hub.presentations().pages_get(...).doit() +let r = hub.presentations().pages_get_thumbnail(...).doit() ``` The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -75,7 +76,6 @@ google-slides1 = "*" extern crate hyper; extern crate yup_oauth2 as oauth2; extern crate google_slides1 as slides1; -use slides1::BatchUpdatePresentationRequest; use slides1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -93,15 +93,12 @@ let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::new(), ::default(), None); let mut hub = Slides::new(hyper::Client::new(), auth); -// As the method needs a request, you would usually fill it with the desired information -// into the respective structure. Some of the parts shown here might not be applicable ! -// Values shown here are possibly random and not representative ! -let mut req = BatchUpdatePresentationRequest::default(); - // You can configure optional parameters by calling the respective setters at will, and // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! -let result = hub.presentations().batch_update(req, "presentationId") +let result = hub.presentations().pages_get_thumbnail("presentationId", "pageObjectId") + .thumbnail_properties_thumbnail_size("Stet") + .thumbnail_properties_mime_type("sed") .doit(); match result { @@ -124,17 +121,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/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-slides1/1.0.4+20161213/google_slides1/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/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-slides1/1.0.4+20161213/google_slides1/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/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-slides1/1.0.4+20161213/google_slides1/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/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 +141,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/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-slides1/1.0.4+20170509/google_slides1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/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-slides1/1.0.4+20161213/google_slides1/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/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-slides1/1.0.4+20161213/google_slides1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-slides1/1.0.4+20161213/google_slides1/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-slides1/1.0.4+20170509/google_slides1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/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-slides1/1.0.4+20161213/google_slides1/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/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-slides1/1.0.4+20161213/google_slides1/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/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-slides1/1.0.4+20161213/google_slides1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-slides1/1.0.4+20170509/google_slides1/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/slides1/src/lib.rs b/gen/slides1/src/lib.rs index ed42158b9f..f9593c9b5d 100644 --- a/gen/slides1/src/lib.rs +++ b/gen/slides1/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 *Slides* crate version *1.0.4+20161213*, where *20161213* is the exact revision of the *slides:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Slides* crate version *1.0.4+20170509*, where *20170509* is the exact revision of the *slides:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *Slides* *v1* API can be found at the //! [official documentation site](https://developers.google.com/slides/). @@ -12,7 +12,7 @@ //! Handle the following *Resources* with ease from the central [hub](struct.Slides.html) ... //! //! * [presentations](struct.Presentation.html) -//! * [*batch update*](struct.PresentationBatchUpdateCall.html), [*create*](struct.PresentationCreateCall.html), [*get*](struct.PresentationGetCall.html) and [*pages get*](struct.PresentationPageGetCall.html) +//! * [*batch update*](struct.PresentationBatchUpdateCall.html), [*create*](struct.PresentationCreateCall.html), [*get*](struct.PresentationGetCall.html), [*pages get*](struct.PresentationPageGetCall.html) and [*pages get thumbnail*](struct.PresentationPageGetThumbnailCall.html) //! //! //! @@ -51,6 +51,7 @@ //! let r = hub.presentations().get(...).doit() //! let r = hub.presentations().batch_update(...).doit() //! let r = hub.presentations().pages_get(...).doit() +//! let r = hub.presentations().pages_get_thumbnail(...).doit() //! ``` //! //! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities` @@ -75,7 +76,6 @@ //! extern crate hyper; //! extern crate yup_oauth2 as oauth2; //! extern crate google_slides1 as slides1; -//! use slides1::BatchUpdatePresentationRequest; //! use slides1::{Result, Error}; //! # #[test] fn egal() { //! use std::default::Default; @@ -94,15 +94,12 @@ //! hyper::Client::new(), //! ::default(), None); //! let mut hub = Slides::new(hyper::Client::new(), auth); -//! // As the method needs a request, you would usually fill it with the desired information -//! // into the respective structure. Some of the parts shown here might not be applicable ! -//! // Values shown here are possibly random and not representative ! -//! let mut req = BatchUpdatePresentationRequest::default(); -//! //! // You can configure optional parameters by calling the respective setters at will, and //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! -//! let result = hub.presentations().batch_update(req, "presentationId") +//! let result = hub.presentations().pages_get_thumbnail("presentationId", "pageObjectId") +//! .thumbnail_properties_thumbnail_size("kasd") +//! .thumbnail_properties_mime_type("accusam") //! .doit(); //! //! match result { @@ -179,7 +176,7 @@ // 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 +// 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)] @@ -278,7 +275,6 @@ impl Default for Scope { /// extern crate hyper; /// extern crate yup_oauth2 as oauth2; /// extern crate google_slides1 as slides1; -/// use slides1::BatchUpdatePresentationRequest; /// use slides1::{Result, Error}; /// # #[test] fn egal() { /// use std::default::Default; @@ -297,15 +293,12 @@ impl Default for Scope { /// hyper::Client::new(), /// ::default(), None); /// let mut hub = Slides::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = BatchUpdatePresentationRequest::default(); -/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.presentations().batch_update(req, "presentationId") +/// let result = hub.presentations().pages_get_thumbnail("presentationId", "pageObjectId") +/// .thumbnail_properties_thumbnail_size("amet.") +/// .thumbnail_properties_mime_type("erat") /// .doit(); /// /// match result { @@ -330,8 +323,6 @@ pub struct Slides { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Slides {} @@ -344,8 +335,6 @@ impl<'a, C, A> Slides client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://slides.googleapis.com/".to_string(), - _root_url: "https://slides.googleapis.com/".to_string(), } } @@ -362,26 +351,6 @@ impl<'a, C, A> Slides self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://slides.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://slides.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -414,6 +383,36 @@ pub struct ReplaceAllShapesWithImageRequest { impl Part for ReplaceAllShapesWithImageRequest {} +/// Replaces all shapes that match the given criteria with the provided Google +/// Sheets chart. The chart will be scaled and centered to fit within the bounds +/// of the original shape. +/// +/// NOTE: Replacing shapes with a chart requires at least one of the +/// spreadsheets.readonly, spreadsheets, drive.readonly, or drive OAuth scopes. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReplaceAllShapesWithSheetsChartRequest { + /// The ID of the Google Sheets spreadsheet that contains the chart. + #[serde(rename="spreadsheetId")] + pub spreadsheet_id: Option, + /// The ID of the specific chart in the Google Sheets spreadsheet. + #[serde(rename="chartId")] + pub chart_id: Option, + /// The mode with which the chart is linked to the source spreadsheet. When + /// not specified, the chart will be an image that is not linked. + #[serde(rename="linkingMode")] + pub linking_mode: Option, + /// The criteria that the shapes must match in order to be replaced. The + /// request will replace all of the shapes that contain the given text. + #[serde(rename="containsText")] + pub contains_text: Option, +} + +impl Part for ReplaceAllShapesWithSheetsChartRequest {} + + /// A PageElement kind representing a /// joined collection of PageElements. /// @@ -475,6 +474,32 @@ pub struct StretchedPictureFill { impl Part for StretchedPictureFill {} +/// Represents a font family and weight used to style a TextRun. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct WeightedFontFamily { + /// The font family of the text. + /// + /// The font family can be any font from the Font menu in Slides or from + /// [Google Fonts] (https://fonts.google.com/). If the font name is + /// unrecognized, the text is rendered in `Arial`. + #[serde(rename="fontFamily")] + pub font_family: Option, + /// The rendered weight of the text. This field can have any value that is a + /// multiple of `100` between `100` and `900`, inclusive. This range + /// corresponds to the numerical values described in the CSS 2.1 + /// Specification, [section 15.6](https://www.w3.org/TR/CSS21/fonts.html#font-boldness), + /// with non-numerical values disallowed. Weights greater than or equal to + /// `700` are considered bold, and weights less than `700`are not bold. The + /// default value is `400` ("normal"). + pub weight: Option, +} + +impl Part for WeightedFontFamily {} + + /// Creates an image. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -585,16 +610,16 @@ pub struct CropProperties { /// The rotation angle of the crop window around its center, in radians. /// Rotation angle is applied after the offset. pub angle: Option, - /// The offset specifies the bottom edge of the crop rectangle that is located - /// above the original bounding rectangle bottom edge, relative to the object's - /// original height. - #[serde(rename="bottomOffset")] - pub bottom_offset: Option, /// The offset specifies the right edge of the crop rectangle that is located /// to the left of the original bounding rectangle right edge, relative to the /// object's original width. #[serde(rename="rightOffset")] pub right_offset: Option, + /// The offset specifies the bottom edge of the crop rectangle that is located + /// above the original bounding rectangle bottom edge, relative to the object's + /// original height. + #[serde(rename="bottomOffset")] + pub bottom_offset: Option, /// The offset specifies the top edge of the crop rectangle that is located /// below the original bounding rectangle top edge, relative to the object's /// original height. @@ -793,9 +818,6 @@ impl Part for SolidFill {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct InsertTableColumnsRequest { - /// The table to insert columns into. - #[serde(rename="tableObjectId")] - pub table_object_id: Option, /// Whether to insert new columns to the right of the reference cell location. /// /// - `True`: insert to the right. @@ -811,6 +833,9 @@ pub struct InsertTableColumnsRequest { /// column will be inserted to the left (or right) of the merged cell. #[serde(rename="cellLocation")] pub cell_location: Option, + /// The table to insert columns into. + #[serde(rename="tableObjectId")] + pub table_object_id: Option, } impl Part for InsertTableColumnsRequest {} @@ -928,8 +953,8 @@ pub struct Response { /// The result of creating an image. #[serde(rename="createImage")] pub create_image: Option, - /// The result of replacing all shapes containing the specified text with - /// an image. + /// The result of replacing all shapes matching some criteria with an + /// image. #[serde(rename="replaceAllShapesWithImage")] pub replace_all_shapes_with_image: Option, /// The result of duplicating an object. @@ -956,6 +981,10 @@ pub struct Response { /// The result of creating a slide. #[serde(rename="createSlide")] pub create_slide: Option, + /// The result of replacing all shapes matching some criteria with a Google + /// Sheets chart. + #[serde(rename="replaceAllShapesWithSheetsChart")] + pub replace_all_shapes_with_sheets_chart: Option, } impl Part for Response {} @@ -993,46 +1022,66 @@ impl Part for CreateTableResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ParagraphStyle { - /// The spacing mode for the paragraph. This property is read-only. + /// The spacing mode for the paragraph. #[serde(rename="spacingMode")] pub spacing_mode: Option, - /// The text direction of this paragraph. This property is read-only. + /// The text direction of this paragraph. If unset, the value defaults to + /// LEFT_TO_RIGHT since + /// text direction is not inherited. pub direction: Option, /// The amount of extra space above the paragraph. If unset, the value is - /// inherited from the parent. This property is read-only. + /// inherited from the parent. #[serde(rename="spaceBelow")] pub space_below: Option, /// The amount of space between lines, as a percentage of normal, where normal /// is represented as 100.0. If unset, the value is inherited from the parent. - /// This property is read-only. #[serde(rename="lineSpacing")] pub line_spacing: Option, /// The amount indentation for the paragraph on the side that corresponds to /// the start of the text, based on the current text direction. If unset, the - /// value is inherited from the parent. This property is read-only. + /// value is inherited from the parent. #[serde(rename="indentStart")] pub indent_start: Option, /// The amount of extra space above the paragraph. If unset, the value is - /// inherited from the parent. This property is read-only. + /// inherited from the parent. #[serde(rename="spaceAbove")] pub space_above: Option, /// The amount indentation for the paragraph on the side that corresponds to /// the end of the text, based on the current text direction. If unset, the - /// value is inherited from the parent. This property is read-only. + /// value is inherited from the parent. #[serde(rename="indentEnd")] pub indent_end: Option, /// The amount of indentation for the start of the first line of the paragraph. - /// If unset, the value is inherited from the parent. This property is - /// read-only. + /// If unset, the value is inherited from the parent. #[serde(rename="indentFirstLine")] pub indent_first_line: Option, - /// The text alignment for this paragraph. This property is read-only. + /// The text alignment for this paragraph. pub alignment: Option, } impl Part for ParagraphStyle {} +/// The properties of Page that are only +/// relevant for pages with page_type NOTES. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct NotesProperties { + /// The object ID of the shape on this notes page that contains the speaker + /// notes for the corresponding slide. + /// The actual shape may not always exist on the notes page. Inserting text + /// using this object ID will automatically create the shape. In this case, the + /// actual shape may have different object ID. The `GetPresentation` or + /// `GetPage` action will always return the latest object ID. + #[serde(rename="speakerNotesObjectId")] + pub speaker_notes_object_id: Option, +} + +impl Part for NotesProperties {} + + /// Describes the bullet of a paragraph. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1241,19 +1290,19 @@ impl Part for LineFill {} /// Creates an embedded Google Sheets chart. /// -/// NOTE: Chart creation requires at least one of the spreadsheets.readonly, +/// NOTE: Chart creation requires at least one of the spreadsheets.readonly, /// spreadsheets, drive.readonly, or drive OAuth scopes. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateSheetsChartRequest { - /// The ID of the specific chart in the Google Sheets spreadsheet. - #[serde(rename="chartId")] - pub chart_id: Option, /// The ID of the Google Sheets spreadsheet that contains the chart. #[serde(rename="spreadsheetId")] pub spreadsheet_id: Option, + /// The ID of the specific chart in the Google Sheets spreadsheet. + #[serde(rename="chartId")] + pub chart_id: Option, /// The mode with which the chart is linked to the source spreadsheet. When /// not specified, the chart will be an image that is not linked. #[serde(rename="linkingMode")] @@ -1301,6 +1350,17 @@ impl Part for ReplaceAllShapesWithImageResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SlideProperties { + /// The notes page that this slide is associated with. It defines the visual + /// appearance of a notes page when printing or exporting slides with speaker + /// notes. A notes page inherits properties from the + /// notes master. + /// The placeholder shape with type BODY on the notes page contains the speaker + /// notes for this slide. The ID of this shape is identified by the + /// speakerNotesObjectId field. + /// The notes page is read-only except for the text content and styles of the + /// speaker notes shape. + #[serde(rename="notesPage")] + pub notes_page: Option, /// The object ID of the layout that this slide is based on. #[serde(rename="layoutObjectId")] pub layout_object_id: Option, @@ -1329,11 +1389,28 @@ pub struct Page { /// The page elements rendered on the page. #[serde(rename="pageElements")] pub page_elements: Option>, + /// Notes specific properties. Only set if page_type = NOTES. + #[serde(rename="notesProperties")] + pub notes_properties: Option, /// The object ID for this page. Object IDs used by /// Page and /// PageElement share the same namespace. #[serde(rename="objectId")] pub object_id: Option, + /// The revision ID of the presentation containing this page. Can be used in + /// update requests to assert that the presentation revision hasn't changed + /// since the last read operation. Only populated if the user has edit access + /// to the presentation. + /// + /// The format of the revision ID may change over time, so it should be treated + /// opaquely. A returned revision ID is only guaranteed to be valid for 24 + /// hours after it has been returned and cannot be shared across users. If the + /// revision ID is unchanged between calls, then the presentation has not + /// changed. Conversely, a changed ID (for the same presentation and user) + /// usually means the presentation has been updated; however, a changed ID can + /// also be due to internal factors such as ID format changes. + #[serde(rename="revisionId")] + pub revision_id: Option, /// The properties of the page. #[serde(rename="pageProperties")] pub page_properties: Option, @@ -1455,12 +1532,6 @@ impl Part for PageElementProperties {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateVideoPropertiesRequest { - /// The video properties to update. - #[serde(rename="videoProperties")] - pub video_properties: Option, - /// The object ID of the video the updates are applied to. - #[serde(rename="objectId")] - pub object_id: Option, /// The fields that should be updated. /// /// At least one field must be specified. The root `videoProperties` is @@ -1473,6 +1544,12 @@ pub struct UpdateVideoPropertiesRequest { /// To reset a property to its default value, include its field name in the /// field mask but leave the field itself unset. pub fields: Option, + /// The object ID of the video the updates are applied to. + #[serde(rename="objectId")] + pub object_id: Option, + /// The video properties to update. + #[serde(rename="videoProperties")] + pub video_properties: Option, } impl Part for UpdateVideoPropertiesRequest {} @@ -1528,6 +1605,32 @@ pub struct TableRow { impl Part for TableRow {} +/// Deletes bullets from all of the paragraphs that overlap with the given text +/// index range. +/// +/// The nesting level of each paragraph will be visually preserved by adding +/// indent to the start of the corresponding paragraph. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct DeleteParagraphBulletsRequest { + /// The range of text to delete bullets from, based on TextElement indexes. + #[serde(rename="textRange")] + pub text_range: Option, + /// The object ID of the shape or table containing the text to delete bullets + /// from. + #[serde(rename="objectId")] + pub object_id: Option, + /// The optional table cell location if the text to be modified is in a table + /// cell. If present, the object_id must refer to a table. + #[serde(rename="cellLocation")] + pub cell_location: Option, +} + +impl Part for DeleteParagraphBulletsRequest {} + + /// A PageElement kind representing /// a linked chart embedded from Google Sheets. /// @@ -1535,13 +1638,13 @@ impl Part for TableRow {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SheetsChart { + /// The ID of the Google Sheets spreadsheet that contains the source chart. + #[serde(rename="spreadsheetId")] + pub spreadsheet_id: Option, /// The ID of the specific chart in the Google Sheets spreadsheet that is /// embedded. #[serde(rename="chartId")] pub chart_id: Option, - /// The ID of the Google Sheets spreadsheet that contains the source chart. - #[serde(rename="spreadsheetId")] - pub spreadsheet_id: Option, /// The properties of the Sheets chart. #[serde(rename="sheetsChartProperties")] pub sheets_chart_properties: Option, @@ -1668,19 +1771,18 @@ pub struct AffineTransform { impl Part for AffineTransform {} -/// A width and height. +/// The result of creating an embedded Google Sheets chart. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Size { - /// The width of the object. - pub width: Option, - /// The height of the object. - pub height: Option, +pub struct CreateSheetsChartResponse { + /// The object ID of the created chart. + #[serde(rename="objectId")] + pub object_id: Option, } -impl Part for Size {} +impl Part for CreateSheetsChartResponse {} /// Inserts text into a shape or a table cell. @@ -1752,8 +1854,8 @@ pub struct TextStyle { /// transparent, depending on if the `opaque_color` field in it is set. #[serde(rename="foregroundColor")] pub foreground_color: Option, - /// Whether or not the text is bold. - pub bold: Option, + /// Whether or not the text is italicized. + pub italic: Option, /// The text's vertical offset from its normal position. /// /// Text with `SUPERSCRIPT` or `SUBSCRIPT` baseline offsets is automatically @@ -1763,6 +1865,37 @@ pub struct TextStyle { pub baseline_offset: Option, /// Whether or not the text is struck through. pub strikethrough: Option, + /// The font family and rendered weight of the text. + /// + /// This field is an extension of `font_family` meant to support explicit font + /// weights without breaking backwards compatibility. As such, when reading the + /// style of a range of text, the value of `weighted_font_family#font_family` + /// will always be equal to that of `font_family`. However, when writing, if + /// both fields are included in the field mask (either explicitly or through + /// the wildcard `"*"`), their values are reconciled as follows: + /// + /// * If `font_family` is set and `weighted_font_family` is not, the value of + /// `font_family` is applied with weight `400` ("normal"). + /// * If both fields are set, the value of `font_family` must match that of + /// `weighted_font_family#font_family`. If so, the font family and weight of + /// `weighted_font_family` is applied. Otherwise, a 400 bad request error is + /// returned. + /// * If `weighted_font_family` is set and `font_family` is not, the font + /// family and weight of `weighted_font_family` is applied. + /// * If neither field is set, the font family and weight of the text inherit + /// from the parent. Note that these properties cannot inherit separately + /// from each other. + /// + /// If an update request specifies values for both `weighted_font_family` and + /// `bold`, the `weighted_font_family` is applied first, then `bold`. + /// + /// If `weighted_font_family#weight` is not set, it defaults to `400`. + /// + /// If `weighted_font_family` is set, then `weighted_font_family#font_family` + /// must also be set with a non-empty value. Otherwise, a 400 bad request error + /// is returned. + #[serde(rename="weightedFontFamily")] + pub weighted_font_family: Option, /// Whether or not the text is in small capital letters. #[serde(rename="smallCaps")] pub small_caps: Option, @@ -1777,6 +1910,14 @@ pub struct TextStyle { /// `bold` value is used. #[serde(rename="fontFamily")] pub font_family: Option, + /// The size of the text's font. When read, the `font_size` will specified in + /// points. + #[serde(rename="fontSize")] + pub font_size: Option, + /// The background color of the text. If set, the color is either opaque or + /// transparent, depending on if the `opaque_color` field in it is set. + #[serde(rename="backgroundColor")] + pub background_color: Option, /// The hyperlink destination of the text. If unset, there is no link. Links /// are not inherited from parent text. /// @@ -1798,18 +1939,10 @@ pub struct TextStyle { /// text is another link) unless different styles are being set in the same /// request. pub link: Option, - /// Whether or not the text is italicized. - pub italic: Option, - /// The size of the text's font. When read, the `font_size` will specified in - /// points. - #[serde(rename="fontSize")] - pub font_size: Option, /// Whether or not the text is underlined. pub underline: Option, - /// The background color of the text. If set, the color is either opaque or - /// transparent, depending on if the `opaque_color` field in it is set. - #[serde(rename="backgroundColor")] - pub background_color: Option, + /// Whether or not the text is rendered as bold. + pub bold: Option, } impl Part for TextStyle {} @@ -1913,53 +2046,51 @@ pub struct InsertTableRowsRequest { impl Part for InsertTableRowsRequest {} -/// A Google Slides presentation. +/// Provides control over how write requests are 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 WriteControl { + /// The revision ID of the presentation required for the write request. If + /// specified and the `required_revision_id` doesn't exactly match the + /// presentation's current `revision_id`, the request will not be processed and + /// will return a 400 bad request error. + #[serde(rename="requiredRevisionId")] + pub required_revision_id: Option, +} + +impl Part for WriteControl {} + + +/// The thumbnail of a 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*). /// -/// * [create presentations](struct.PresentationCreateCall.html) (request|response) -/// * [get presentations](struct.PresentationGetCall.html) (response) -/// * [batch update presentations](struct.PresentationBatchUpdateCall.html) (none) -/// * [pages get presentations](struct.PresentationPageGetCall.html) (none) +/// * [pages get thumbnail presentations](struct.PresentationPageGetThumbnailCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Presentation { - /// The slides in the presentation. - /// A slide inherits properties from a slide layout. - pub slides: Option>, - /// The ID of the presentation. - #[serde(rename="presentationId")] - pub presentation_id: Option, - /// The slide masters in the presentation. A slide master contains all common - /// page elements and the common properties for a set of layouts. They serve - /// three purposes: +pub struct Thumbnail { + /// The content URL of the thumbnail image. /// - /// - Placeholder shapes on a master contain the default text styles and shape - /// properties of all placeholder shapes on pages that use that master. - /// - The master page properties define the common page properties inherited by - /// its layouts. - /// - Any other shapes on the master slide will appear on all slides using that - /// master, regardless of their layout. - pub masters: Option>, - /// The size of pages in the presentation. - #[serde(rename="pageSize")] - pub page_size: Option, - /// The title of the presentation. - pub title: Option, - /// The locale of the presentation, as an IETF BCP 47 language tag. - pub locale: Option, - /// The layouts in the presentation. A layout is a template that determines - /// how content is arranged and styled on the slides that inherit from that - /// layout. - pub layouts: Option>, + /// The URL to the image has a default lifetime of 30 minutes. + /// This URL is tagged with the account of the requester. Anyone with the URL + /// effectively accesses the image as the original requester. Access to the + /// image may be lost if the presentation's sharing settings change. + /// The mime type of the thumbnail image is the same as specified in the + /// `GetPageThumbnailRequest`. + #[serde(rename="contentUrl")] + pub content_url: Option, + /// The positive width in pixels of the thumbnail image. + pub width: Option, + /// The positive height in pixels of the thumbnail image. + pub height: Option, } -impl RequestValue for Presentation {} -impl Resource for Presentation {} -impl ResponseResult for Presentation {} +impl ResponseResult for Thumbnail {} /// A PageElement kind representing @@ -2093,6 +2224,83 @@ pub struct DeleteTableRowRequest { impl Part for DeleteTableRowRequest {} +/// A Google Slides presentation. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 presentations](struct.PresentationCreateCall.html) (request|response) +/// * [get presentations](struct.PresentationGetCall.html) (response) +/// * [batch update presentations](struct.PresentationBatchUpdateCall.html) (none) +/// * [pages get presentations](struct.PresentationPageGetCall.html) (none) +/// * [pages get thumbnail presentations](struct.PresentationPageGetThumbnailCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Presentation { + /// The ID of the presentation. + #[serde(rename="presentationId")] + pub presentation_id: Option, + /// The slide masters in the presentation. A slide master contains all common + /// page elements and the common properties for a set of layouts. They serve + /// three purposes: + /// + /// - Placeholder shapes on a master contain the default text styles and shape + /// properties of all placeholder shapes on pages that use that master. + /// - The master page properties define the common page properties inherited by + /// its layouts. + /// - Any other shapes on the master slide will appear on all slides using that + /// master, regardless of their layout. + pub masters: Option>, + /// The size of pages in the presentation. + #[serde(rename="pageSize")] + pub page_size: Option, + /// The title of the presentation. + pub title: Option, + /// The locale of the presentation, as an IETF BCP 47 language tag. + pub locale: Option, + /// The revision ID of the presentation. Can be used in update requests + /// to assert that the presentation revision hasn't changed since the last + /// read operation. Only populated if the user has edit access to the + /// presentation. + /// + /// The format of the revision ID may change over time, so it should be treated + /// opaquely. A returned revision ID is only guaranteed to be valid for 24 + /// hours after it has been returned and cannot be shared across users. If the + /// revision ID is unchanged between calls, then the presentation has not + /// changed. Conversely, a changed ID (for the same presentation and user) + /// usually means the presentation has been updated; however, a changed ID can + /// also be due to internal factors such as ID format changes. + #[serde(rename="revisionId")] + pub revision_id: Option, + /// The notes master in the presentation. It serves three purposes: + /// + /// - Placeholder shapes on a notes master contain the default text styles and + /// shape properties of all placeholder shapes on notes pages. Specifically, + /// a `SLIDE_IMAGE` placeholder shape contains the slide thumbnail, and a + /// `BODY` placeholder shape contains the speaker notes. + /// - The notes master page properties define the common page properties + /// inherited by all notes pages. + /// - Any other shapes on the notes master will appear on all notes pages. + /// + /// The notes master is read-only. + #[serde(rename="notesMaster")] + pub notes_master: Option, + /// The slides in the presentation. + /// A slide inherits properties from a slide layout. + pub slides: Option>, + /// The layouts in the presentation. A layout is a template that determines + /// how content is arranged and styled on the slides that inherit from that + /// layout. + pub layouts: Option>, +} + +impl RequestValue for Presentation {} +impl Resource for Presentation {} +impl ResponseResult for Presentation {} + + /// The result of creating a video. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2136,6 +2344,43 @@ pub struct UpdateShapePropertiesRequest { impl Part for UpdateShapePropertiesRequest {} +/// Updates the styling for all of the paragraphs within a Shape or Table that +/// overlap with the given text index 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 UpdateParagraphStyleRequest { + /// The fields that should be updated. + /// + /// At least one field must be specified. The root `style` is implied and + /// should not be specified. A single `"*"` can be used as short-hand for + /// listing every field. + /// + /// For example, to update the paragraph alignment, set `fields` to + /// `"alignment"`. + /// + /// To reset a property to its default value, include its field name in the + /// field mask but leave the field itself unset. + pub fields: Option, + /// The paragraph's style. + pub style: Option, + /// The location of the cell in the table containing the paragraph(s) to + /// style. If `object_id` refers to a table, `cell_location` must have a value. + /// Otherwise, it must not. + #[serde(rename="cellLocation")] + pub cell_location: Option, + /// The object ID of the shape or table with the text to be styled. + #[serde(rename="objectId")] + pub object_id: Option, + /// The range of text containing the paragraph(s) to style. + #[serde(rename="textRange")] + pub text_range: Option, +} + +impl Part for UpdateParagraphStyleRequest {} + + /// A hypertext link. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2246,8 +2491,8 @@ pub struct Placeholder { /// not inherit properties from any other shape. #[serde(rename="parentObjectId")] pub parent_object_id: Option, - /// The index of the placeholder. If the same placeholder types are the present - /// in the same page, they would have different index values. + /// The index of the placeholder. If the same placeholder types are present in + /// the same page, they would have different index values. pub index: Option, /// The type of the placeholder. #[serde(rename="type")] @@ -2270,10 +2515,10 @@ pub struct UpdateTextStyleRequest { /// should not be specified. A single `"*"` can be used as short-hand for /// listing every field. /// - /// For example to update the text style to bold, set `fields` to `"bold"`. + /// For example, to update the text style to bold, set `fields` to `"bold"`. /// - /// To reset a property to its default value, - /// include its field name in the field mask but leave the field itself unset. + /// To reset a property to its default value, include its field name in the + /// field mask but leave the field itself unset. pub fields: Option, /// The style(s) to set on the text. /// @@ -2295,8 +2540,9 @@ pub struct UpdateTextStyleRequest { /// The object ID of the shape or table with the text to be styled. #[serde(rename="objectId")] pub object_id: Option, - /// The optional table cell location if the text to be styled is in a table - /// cell. If present, the object_id must refer to a table. + /// The location of the cell in the table containing the text to style. If + /// `object_id` refers to a table, `cell_location` must have a value. + /// Otherwise, it must not. #[serde(rename="cellLocation")] pub cell_location: Option, } @@ -2403,6 +2649,61 @@ pub struct CreateLineResponse { impl Part for CreateLineResponse {} +/// A List describes the look and feel of bullets belonging to paragraphs +/// associated with a list. A paragraph that is part of a list has an implicit +/// reference to that list's 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 List { + /// A map of nesting levels to the properties of bullets at the associated + /// level. A list has at most nine levels of nesting, so the possible values + /// for the keys of this map are 0 through 8, inclusive. + #[serde(rename="nestingLevel")] + pub nesting_level: Option>, + /// The ID of the list. + #[serde(rename="listId")] + pub list_id: Option, +} + +impl Part for List {} + + +/// The user-specified ID mapping for a placeholder that will be created on a +/// slide from a specified layout. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct LayoutPlaceholderIdMapping { + /// The placeholder on a layout that will be applied to a slide. Only type and index are needed. For example, a + /// predefined `TITLE_AND_BODY` layout may usually have a TITLE placeholder + /// with index 0 and a BODY placeholder with index 0. + #[serde(rename="layoutPlaceholder")] + pub layout_placeholder: Option, + /// A user-supplied object ID for the placeholder identified above that to be + /// created onto a slide. + /// + /// If you specify an ID, it must be unique among all pages and page elements + /// in the presentation. The ID must start with an alphanumeric character or an + /// underscore (matches regex `[a-zA-Z0-9_]`); remaining characters + /// may include those as well as a hyphen or colon (matches regex + /// `[a-zA-Z0-9_-:]`). + /// The length of the ID must not be less than 5 or greater than 50. + /// + /// If you don't specify an ID, a unique one is generated. + #[serde(rename="objectId")] + pub object_id: Option, + /// The object ID of the placeholder on a layout that will be applied + /// to a slide. + #[serde(rename="layoutPlaceholderObjectId")] + pub layout_placeholder_object_id: Option, +} + +impl Part for LayoutPlaceholderIdMapping {} + + /// A single kind of update to apply to a presentation. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -2424,6 +2725,9 @@ pub struct Request { /// Duplicates a slide or page element. #[serde(rename="duplicateObject")] pub duplicate_object: Option, + /// Updates the styling of paragraphs within a Shape or Table. + #[serde(rename="updateParagraphStyle")] + pub update_paragraph_style: Option, /// Refreshes a Google Sheets chart. #[serde(rename="refreshSheetsChart")] pub refresh_sheets_chart: Option, @@ -2454,6 +2758,9 @@ pub struct Request { /// Deletes a page or page element from the presentation. #[serde(rename="deleteObject")] pub delete_object: Option, + /// Replaces all shapes matching some criteria with a Google Sheets chart. + #[serde(rename="replaceAllShapesWithSheetsChart")] + pub replace_all_shapes_with_sheets_chart: Option, /// Creates an image. #[serde(rename="createImage")] pub create_image: Option, @@ -2466,76 +2773,47 @@ pub struct Request { /// Creates a new shape. #[serde(rename="createShape")] pub create_shape: Option, - /// Updates the transform of a page element. - #[serde(rename="updatePageElementTransform")] - pub update_page_element_transform: Option, + /// Inserts columns into a table. + #[serde(rename="insertTableColumns")] + pub insert_table_columns: Option, + /// Deletes bullets from paragraphs. + #[serde(rename="deleteParagraphBullets")] + pub delete_paragraph_bullets: Option, /// Creates bullets for paragraphs. #[serde(rename="createParagraphBullets")] pub create_paragraph_bullets: Option, - /// Updates the styling of text within a Shape or Table. - #[serde(rename="updateTextStyle")] - pub update_text_style: Option, + /// Updates the properties of a Line. + #[serde(rename="updateLineProperties")] + pub update_line_properties: Option, /// Deletes text from a shape or a table cell. #[serde(rename="deleteText")] pub delete_text: Option, /// Updates the properties of a Page. #[serde(rename="updatePageProperties")] pub update_page_properties: Option, - /// Updates the properties of a Line. - #[serde(rename="updateLineProperties")] - pub update_line_properties: Option, + /// Updates the styling of text within a Shape or Table. + #[serde(rename="updateTextStyle")] + pub update_text_style: Option, /// Updates the properties of a TableCell. #[serde(rename="updateTableCellProperties")] pub update_table_cell_properties: Option, /// Deletes a column from a table. #[serde(rename="deleteTableColumn")] pub delete_table_column: Option, - /// Inserts columns into a table. - #[serde(rename="insertTableColumns")] - pub insert_table_columns: Option, + /// Updates the transform of a page element. + #[serde(rename="updatePageElementTransform")] + pub update_page_element_transform: Option, } impl Part for Request {} -/// A List describes the look and feel of bullets belonging to paragraphs -/// associated with a list. A paragraph that is part of a list has an implicit -/// reference to that list's 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 List { - /// A map of nesting levels to the properties of bullets at the associated - /// level. A list has at most nine levels of nesting, so the possible values - /// for the keys of this map are 0 through 8, inclusive. - #[serde(rename="nestingLevel")] - pub nesting_level: Option>, - /// The ID of the list. - #[serde(rename="listId")] - pub list_id: Option, -} - -impl Part for List {} - - /// Update the properties of a TableCell. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateTableCellPropertiesRequest { - /// The table range representing the subset of the table to which the updates - /// are applied. If a table range is not specified, the updates will apply to - /// the entire table. - #[serde(rename="tableRange")] - pub table_range: Option, - /// The table cell properties to update. - #[serde(rename="tableCellProperties")] - pub table_cell_properties: Option, - /// The object ID of the table. - #[serde(rename="objectId")] - pub object_id: Option, /// The fields that should be updated. /// /// At least one field must be specified. The root `tableCellProperties` is @@ -2548,6 +2826,17 @@ pub struct UpdateTableCellPropertiesRequest { /// To reset a property to its default value, include its field name in the /// field mask but leave the field itself unset. pub fields: Option, + /// The table cell properties to update. + #[serde(rename="tableCellProperties")] + pub table_cell_properties: Option, + /// The object ID of the table. + #[serde(rename="objectId")] + pub object_id: Option, + /// The table range representing the subset of the table to which the updates + /// are applied. If a table range is not specified, the updates will apply to + /// the entire table. + #[serde(rename="tableRange")] + pub table_range: Option, } impl Part for UpdateTableCellPropertiesRequest {} @@ -2561,11 +2850,11 @@ impl Part for UpdateTableCellPropertiesRequest {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Range { /// The optional zero-based index of the end of the collection. - /// Required for `SPECIFIC_RANGE` delete mode. + /// Required for `FIXED_RANGE` ranges. #[serde(rename="endIndex")] pub end_index: Option, /// The optional zero-based index of the beginning of the collection. - /// Required for `SPECIFIC_RANGE` and `FROM_START_INDEX` ranges. + /// Required for `FIXED_RANGE` and `FROM_START_INDEX` ranges. #[serde(rename="startIndex")] pub start_index: Option, /// The type of range. @@ -2648,12 +2937,12 @@ impl Part for CreateShapeRequest {} pub struct ColorStop { /// The color of the gradient stop. pub color: Option, - /// The relative position of the color stop in the gradient band measured - /// in percentage. The value should be in the interval [0.0, 1.0]. - pub position: Option, /// The alpha value of this color in the gradient band. Defaults to 1.0, /// fully opaque. pub alpha: Option, + /// The relative position of the color stop in the gradient band measured + /// in percentage. The value should be in the interval [0.0, 1.0]. + pub position: Option, } impl Part for ColorStop {} @@ -2693,6 +2982,11 @@ pub struct CreateSlideRequest { /// predefined layout `BLANK`. #[serde(rename="slideLayoutReference")] pub slide_layout_reference: Option, + /// An optional list of object ID mappings from the placeholder(s) on the layout to the placeholder(s) + /// that will be created on the new slide from that specified layout. Can only + /// be used when `slide_layout_reference` is specified. + #[serde(rename="placeholderIdMappings")] + pub placeholder_id_mappings: Option>, /// A user-supplied object ID. /// /// If you specify an ID, it must be unique among all pages and page elements @@ -2721,10 +3015,6 @@ impl Part for CreateSlideRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct CreateTableRequest { - /// Number of columns in the table. - pub columns: Option, - /// Number of rows in the table. - pub rows: Option, /// A user-supplied object ID. /// /// If you specify an ID, it must be unique among all pages and page elements @@ -2737,6 +3027,10 @@ pub struct CreateTableRequest { /// If you don't specify an ID, a unique one is generated. #[serde(rename="objectId")] pub object_id: Option, + /// Number of rows in the table. + pub rows: Option, + /// Number of columns in the table. + pub columns: Option, /// The element properties for the table. /// /// The table will be created at the provided size, subject to a minimum size. @@ -2765,6 +3059,35 @@ pub struct OutlineFill { impl Part for OutlineFill {} +/// Updates the properties of a Page. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct UpdatePagePropertiesRequest { + /// The page properties to update. + #[serde(rename="pageProperties")] + pub page_properties: Option, + /// The fields that should be updated. + /// + /// At least one field must be specified. The root `pageProperties` is + /// implied and should not be specified. A single `"*"` can be used as + /// short-hand for listing every field. + /// + /// For example to update the page background solid fill color, set `fields` + /// to `"pageBackgroundFill.solidFill.color"`. + /// + /// To reset a property to its default value, include its field name in the + /// field mask but leave the field itself unset. + pub fields: Option, + /// The object ID of the page the update is applied to. + #[serde(rename="objectId")] + pub object_id: Option, +} + +impl Part for UpdatePagePropertiesRequest {} + + /// Deletes an object, either pages or /// page elements, from the /// presentation. @@ -2830,9 +3153,19 @@ impl Part for TableCellProperties {} #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Recolor { /// The recolor effect is represented by a gradient, which is a list of color - /// stops. This property is read-only. + /// stops. + /// + /// The colors in the gradient will replace the corresponding colors at + /// the same position in the color palette and apply to the image. This + /// property is read-only. #[serde(rename="recolorStops")] pub recolor_stops: Option>, + /// The name of the recolor effect. + /// + /// The name is determined from the `recolor_stops` by matching the gradient + /// against the colors in the page's current color scheme. This property is + /// read-only. + pub name: Option, } impl Part for Recolor {} @@ -2851,25 +3184,14 @@ impl Part for Recolor {} pub struct BatchUpdatePresentationRequest { /// A list of updates to apply to the presentation. pub requests: Option>, + /// Provides control over how write requests are executed. + #[serde(rename="writeControl")] + pub write_control: Option, } impl RequestValue for BatchUpdatePresentationRequest {} -/// The result of creating an embedded Google Sheets chart. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct CreateSheetsChartResponse { - /// The object ID of the created chart. - #[serde(rename="objectId")] - pub object_id: Option, -} - -impl Part for CreateSheetsChartResponse {} - - /// A PageElement kind representing a /// generic shape that does not have a more specific classification. /// @@ -2936,16 +3258,16 @@ pub struct CreateParagraphBulletsRequest { /// `BULLET_DISC_CIRCLE_SQUARE` preset. #[serde(rename="bulletPreset")] pub bullet_preset: Option, - /// The range of text to apply the bullet presets to, based on TextElement indexes. - #[serde(rename="textRange")] - pub text_range: Option, - /// The object ID of the shape or table containing the text to add bullets to. - #[serde(rename="objectId")] - pub object_id: Option, /// The optional table cell location if the text to be modified is in a table /// cell. If present, the object_id must refer to a table. #[serde(rename="cellLocation")] pub cell_location: Option, + /// The object ID of the shape or table containing the text to add bullets to. + #[serde(rename="objectId")] + pub object_id: Option, + /// The range of text to apply the bullet presets to, based on TextElement indexes. + #[serde(rename="textRange")] + pub text_range: Option, } impl Part for CreateParagraphBulletsRequest {} @@ -2985,6 +3307,20 @@ pub struct DeleteTextRequest { impl Part for DeleteTextRequest {} +/// The result of replacing shapes with a Google Sheets chart. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ReplaceAllShapesWithSheetsChartResponse { + /// The number of shapes replaced with charts. + #[serde(rename="occurrencesChanged")] + pub occurrences_changed: Option, +} + +impl Part for ReplaceAllShapesWithSheetsChartResponse {} + + /// Update the properties of an Image. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -3056,33 +3392,19 @@ pub struct ThemeColorPair { impl Part for ThemeColorPair {} -/// Updates the properties of a Page. +/// A width and height. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct UpdatePagePropertiesRequest { - /// The page properties to update. - #[serde(rename="pageProperties")] - pub page_properties: Option, - /// The fields that should be updated. - /// - /// At least one field must be specified. The root `pageProperties` is - /// implied and should not be specified. A single `"*"` can be used as - /// short-hand for listing every field. - /// - /// For example to update the page background solid fill color, set `fields` - /// to `"pageBackgroundFill.solidFill.color"`. - /// - /// To reset a property to its default value, include its field name in the - /// field mask but leave the field itself unset. - pub fields: Option, - /// The object ID of the page the update is applied to. - #[serde(rename="objectId")] - pub object_id: Option, +pub struct Size { + /// The width of the object. + pub width: Option, + /// The height of the object. + pub height: Option, } -impl Part for UpdatePagePropertiesRequest {} +impl Part for Size {} @@ -3113,7 +3435,7 @@ impl Part for UpdatePagePropertiesRequest {} /// ::default(), None); /// let mut hub = Slides::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `batch_update(...)`, `create(...)`, `get(...)` and `pages_get(...)` +/// // like `batch_update(...)`, `create(...)`, `get(...)`, `pages_get(...)` and `pages_get_thumbnail(...)` /// // to build up your call. /// let rb = hub.presentations(); /// # } @@ -3221,6 +3543,28 @@ impl<'a, C, A> PresentationMethods<'a, C, A> { _additional_params: Default::default(), } } + + /// Create a builder to help you perform the following task: + /// + /// Generates a thumbnail of the latest version of the specified page in the + /// presentation and returns a URL to the thumbnail image. + /// + /// # Arguments + /// + /// * `presentationId` - The ID of the presentation to retrieve. + /// * `pageObjectId` - The object ID of the page whose thumbnail to retrieve. + pub fn pages_get_thumbnail(&self, presentation_id: &str, page_object_id: &str) -> PresentationPageGetThumbnailCall<'a, C, A> { + PresentationPageGetThumbnailCall { + hub: self.hub, + _presentation_id: presentation_id.to_string(), + _page_object_id: page_object_id.to_string(), + _thumbnail_properties_thumbnail_size: Default::default(), + _thumbnail_properties_mime_type: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } } @@ -3308,7 +3652,7 @@ impl<'a, C, A> PresentationCreateCall<'a, C, A> where C: BorrowMut PresentationCreateCall<'a, C, A> where C: BorrowMut PresentationGetCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/presentations/{+presentationId}"; + let mut url = "https://slides.googleapis.com/v1/presentations/{+presentationId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::DriveReadonly.as_ref().to_string(), ()); } @@ -3679,10 +4023,10 @@ impl<'a, C, A> PresentationGetCall<'a, C, A> where C: BorrowMut, /// /// # Additional Parameters /// - /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *pp* (query-boolean) - Pretty-print response. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *bearer_token* (query-string) - OAuth bearer token. /// * *access_token* (query-string) - OAuth access token. /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. @@ -3814,7 +4158,7 @@ impl<'a, C, A> PresentationBatchUpdateCall<'a, C, A> where C: BorrowMut PresentationBatchUpdateCall<'a, C, A> where C: BorrowMut PresentationPageGetCall<'a, C, A> where C: BorrowMut PresentationPageGetCall<'a, C, A> where C: BorrowMut PresentationPageGetCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Slides::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.presentations().pages_get_thumbnail("presentationId", "pageObjectId") +/// .thumbnail_properties_thumbnail_size("aliquyam") +/// .thumbnail_properties_mime_type("ea") +/// .doit(); +/// # } +/// ``` +pub struct PresentationPageGetThumbnailCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Slides, + _presentation_id: String, + _page_object_id: String, + _thumbnail_properties_thumbnail_size: Option, + _thumbnail_properties_mime_type: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for PresentationPageGetThumbnailCall<'a, C, A> {} + +impl<'a, C, A> PresentationPageGetThumbnailCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Thumbnail)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "slides.presentations.pages.getThumbnail", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("presentationId", self._presentation_id.to_string())); + params.push(("pageObjectId", self._page_object_id.to_string())); + if let Some(value) = self._thumbnail_properties_thumbnail_size { + params.push(("thumbnailProperties.thumbnailSize", value.to_string())); + } + if let Some(value) = self._thumbnail_properties_mime_type { + params.push(("thumbnailProperties.mimeType", value.to_string())); + } + for &field in ["alt", "presentationId", "pageObjectId", "thumbnailProperties.thumbnailSize", "thumbnailProperties.mimeType"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://slides.googleapis.com/v1/presentations/{presentationId}/pages/{pageObjectId}/thumbnail".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::DriveReadonly.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{presentationId}", "presentationId"), ("{pageObjectId}", "pageObjectId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["pageObjectId", "presentationId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 presentation to retrieve. + /// + /// Sets the *presentation id* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn presentation_id(mut self, new_value: &str) -> PresentationPageGetThumbnailCall<'a, C, A> { + self._presentation_id = new_value.to_string(); + self + } + /// The object ID of the page whose thumbnail to retrieve. + /// + /// Sets the *page 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 page_object_id(mut self, new_value: &str) -> PresentationPageGetThumbnailCall<'a, C, A> { + self._page_object_id = new_value.to_string(); + self + } + /// The optional thumbnail image size. + /// + /// If you don't specify the size, the server chooses a default size of the + /// image. + /// + /// Sets the *thumbnail properties.thumbnail size* query property to the given value. + pub fn thumbnail_properties_thumbnail_size(mut self, new_value: &str) -> PresentationPageGetThumbnailCall<'a, C, A> { + self._thumbnail_properties_thumbnail_size = Some(new_value.to_string()); + self + } + /// The optional mime type of the thumbnail image. + /// + /// If you don't specify the mime type, the default mime type will be PNG. + /// + /// Sets the *thumbnail properties.mime type* query property to the given value. + pub fn thumbnail_properties_mime_type(mut self, new_value: &str) -> PresentationPageGetThumbnailCall<'a, C, A> { + self._thumbnail_properties_mime_type = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> PresentationPageGetThumbnailCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not 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) -> PresentationPageGetThumbnailCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::DriveReadonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> PresentationPageGetThumbnailCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + + diff --git a/gen/spectrum1_explorer-cli/Cargo.toml b/gen/spectrum1_explorer-cli/Cargo.toml index c0694f343f..d9cb1a1cff 100644 --- a/gen/spectrum1_explorer-cli/Cargo.toml +++ b/gen/spectrum1_explorer-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-spectrum1_explorer-cli" -version = "1.0.4+20161116" +version = "1.0.4+20170306" authors = ["Sebastian Thiel "] description = "A complete library to interact with spectrum (protocol v1explorer)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spectrum1_explorer-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-spectrum1_explorer] path = "../spectrum1_explorer" -version = "1.0.4+20161116" +version = "1.0.4+20170306" diff --git a/gen/spectrum1_explorer-cli/README.md b/gen/spectrum1_explorer-cli/README.md index 992fe32c52..cc3314fc7f 100644 --- a/gen/spectrum1_explorer-cli/README.md +++ b/gen/spectrum1_explorer-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 *spectrum* API at revision *20161116*. The CLI is at version *1.0.4*. +This documentation was generated from the *spectrum* API at revision *20170306*. The CLI is at version *1.0.4*. ```bash spectrum1-explorer [options] diff --git a/gen/spectrum1_explorer-cli/mkdocs.yml b/gen/spectrum1_explorer-cli/mkdocs.yml index cbcf6a05de..d9f26a7371 100644 --- a/gen/spectrum1_explorer-cli/mkdocs.yml +++ b/gen/spectrum1_explorer-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: spectrum v1.0.4+20161116 +site_name: spectrum v1.0.4+20170306 site_url: http://byron.github.io/google-apis-rs/google-spectrum1_explorer-cli site_description: A complete library to interact with spectrum (protocol v1explorer) diff --git a/gen/spectrum1_explorer-cli/src/main.rs b/gen/spectrum1_explorer-cli/src/main.rs index 1de0616a68..e981fc10ed 100644 --- a/gen/spectrum1_explorer-cli/src/main.rs +++ b/gen/spectrum1_explorer-cli/src/main.rs @@ -961,7 +961,7 @@ fn main() { let mut app = App::new("spectrum1-explorer") .author("Sebastian Thiel ") - .version("1.0.4+20161116") + .version("1.0.4+20170306") .about("API for spectrum-management functions.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_spectrum1_explorer_cli") .arg(Arg::with_name("folder") diff --git a/gen/spectrum1_explorer/Cargo.toml b/gen/spectrum1_explorer/Cargo.toml index 54498ec1c9..0a52829235 100644 --- a/gen/spectrum1_explorer/Cargo.toml +++ b/gen/spectrum1_explorer/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-spectrum1_explorer" -version = "1.0.4+20161116" +version = "1.0.4+20170306" authors = ["Sebastian Thiel "] description = "A complete library to interact with spectrum (protocol v1explorer)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/spectrum1_explorer" homepage = "http://developers.google.com/spectrum" -documentation = "https://docs.rs/google-spectrum1_explorer/1.0.4+20161116" +documentation = "https://docs.rs/google-spectrum1_explorer/1.0.4+20170306" license = "MIT" keywords = ["spectrum", "google", "protocol", "web", "api"] diff --git a/gen/spectrum1_explorer/README.md b/gen/spectrum1_explorer/README.md index 8e7b652321..5746573c1d 100644 --- a/gen/spectrum1_explorer/README.md +++ b/gen/spectrum1_explorer/README.md @@ -5,16 +5,16 @@ DO NOT EDIT ! --> The `google-spectrum1_explorer` library allows access to all features of the *Google spectrum* service. -This documentation was generated from *spectrum* crate version *1.0.4+20161116*, where *20161116* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *spectrum* crate version *1.0.4+20170306*, where *20170306* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *spectrum* *v1_explorer* API can be found at the [official documentation site](http://developers.google.com/spectrum). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/struct.Spectrum.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/struct.Spectrum.html) ... * paws - * [*get spectrum*](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/struct.PawGetSpectrumCall.html), [*get spectrum batch*](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/struct.PawGetSpectrumBatchCall.html), [*init*](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/struct.PawInitCall.html), [*notify spectrum use*](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/struct.PawNotifySpectrumUseCall.html), [*register*](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/struct.PawRegisterCall.html) and [*verify device*](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/struct.PawVerifyDeviceCall.html) + * [*get spectrum*](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/struct.PawGetSpectrumCall.html), [*get spectrum batch*](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/struct.PawGetSpectrumBatchCall.html), [*init*](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/struct.PawInitCall.html), [*notify spectrum use*](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/struct.PawNotifySpectrumUseCall.html), [*register*](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/struct.PawRegisterCall.html) and [*verify device*](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/struct.PawVerifyDeviceCall.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-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/struct.Spectrum.html)** +* **[Hub](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/struct.Spectrum.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.Part.html)** + * **[Parts](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -121,17 +121,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/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-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/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-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/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-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/trait.ResponseResult.html), it will return that by default. You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making this call: `.param("alt", "media")`. @@ -141,29 +141,29 @@ Methods supporting uploads can do so using up to 2 different protocols: ## Customization and Callbacks -You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/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-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/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-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/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-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.RequestValue.html) and -[decodable](https://docs.rs/google-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/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-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/trait.RequestValue.html) and +[decodable](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/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-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/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-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/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-spectrum1_explorer/1.0.4+20161116/google_spectrum1_explorer/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-spectrum1_explorer/1.0.4+20170306/google_spectrum1_explorer/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/spectrum1_explorer/src/lib.rs b/gen/spectrum1_explorer/src/lib.rs index 3b4db37314..09ee4159a7 100644 --- a/gen/spectrum1_explorer/src/lib.rs +++ b/gen/spectrum1_explorer/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 *spectrum* crate version *1.0.4+20161116*, where *20161116* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *spectrum* crate version *1.0.4+20170306*, where *20170306* is the exact revision of the *spectrum:v1explorer* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *spectrum* *v1_explorer* API can be found at the //! [official documentation site](http://developers.google.com/spectrum). @@ -176,7 +176,7 @@ // 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 +// 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)] @@ -285,8 +285,6 @@ pub struct Spectrum { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Spectrum {} @@ -299,8 +297,6 @@ impl<'a, C, A> Spectrum client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/spectrum/v1explorer/paws/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -317,26 +313,6 @@ impl<'a, C, A> Spectrum self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/spectrum/v1explorer/paws/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1405,7 +1381,7 @@ impl<'a, C, A> PawNotifySpectrumUseCall<'a, C, A> where C: BorrowMut PawRegisterCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "register"; + let mut url = "https://www.googleapis.com/spectrum/v1explorer/paws/register".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1827,7 +1803,7 @@ impl<'a, C, A> PawGetSpectrumCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "getSpectrum"; + let mut url = "https://www.googleapis.com/spectrum/v1explorer/paws/getSpectrum".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2038,7 +2014,7 @@ impl<'a, C, A> PawInitCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "init"; + let mut url = "https://www.googleapis.com/spectrum/v1explorer/paws/init".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2249,7 +2225,7 @@ impl<'a, C, A> PawGetSpectrumBatchCall<'a, C, A> where C: BorrowMut PawVerifyDeviceCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "verifyDevice"; + let mut url = "https://www.googleapis.com/spectrum/v1explorer/paws/verifyDevice".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -2597,3 +2573,4 @@ impl<'a, C, A> PawVerifyDeviceCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/sqladmin1_beta4-cli/Cargo.toml b/gen/sqladmin1_beta4-cli/Cargo.toml index d17370162c..7b8261e89f 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.4+20161213" +version = "1.0.4+20170502" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-sqladmin1_beta4] path = "../sqladmin1_beta4" -version = "1.0.4+20161213" +version = "1.0.4+20170502" diff --git a/gen/sqladmin1_beta4-cli/README.md b/gen/sqladmin1_beta4-cli/README.md index bf3a30888e..f63061d8b6 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 *20161213*. The CLI is at version *1.0.4*. +This documentation was generated from the *SQL Admin* API at revision *20170502*. The CLI is at version *1.0.4*. ```bash sqladmin1-beta4 [options] @@ -59,7 +59,7 @@ sqladmin1-beta4 [options] restore-backup (-r )... [-p ]... [-o ] start-replica [-p ]... [-o ] stop-replica [-p ]... [-o ] - truncate-log [-p ]... [-o ] + truncate-log (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] operations get [-p ]... [-o ] diff --git a/gen/sqladmin1_beta4-cli/mkdocs.yml b/gen/sqladmin1_beta4-cli/mkdocs.yml index 04ec995df6..4513d21d47 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.4+20161213 +site_name: SQL Admin v1.0.4+20170502 site_url: http://byron.github.io/google-apis-rs/google-sqladmin1_beta4-cli site_description: A complete library to interact with SQL Admin (protocol v1beta4) diff --git a/gen/sqladmin1_beta4-cli/src/main.rs b/gen/sqladmin1_beta4-cli/src/main.rs index d2087d5cdd..3b1bcc7e9e 100644 --- a/gen/sqladmin1_beta4-cli/src/main.rs +++ b/gen/sqladmin1_beta4-cli/src/main.rs @@ -745,6 +745,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 { + "database-version" => { + call = call.database_version(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -758,6 +761,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["database-version"].iter().map(|v|*v)); v } )); } } @@ -1305,6 +1309,7 @@ impl<'n> Engine<'n> { "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.kind" => Some(("settings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.data-disk-type" => Some(("settings.dataDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.availability-type" => Some(("settings.availabilityType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.maintenance-window.kind" => Some(("settings.maintenanceWindow.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.maintenance-window.update-track" => Some(("settings.maintenanceWindow.updateTrack", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.maintenance-window.day" => Some(("settings.maintenanceWindow.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1320,6 +1325,7 @@ impl<'n> Engine<'n> { "settings.crash-safe-replication-enabled" => Some(("settings.crashSafeReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.database-replication-enabled" => Some(("settings.databaseReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.replication-type" => Some(("settings.replicationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.storage-auto-resize-limit" => Some(("settings.storageAutoResizeLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.tier" => Some(("settings.tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.pricing-plan" => Some(("settings.pricingPlan", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.settings-version" => Some(("settings.settingsVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1344,7 +1350,7 @@ impl<'n> Engine<'n> { "replica-configuration.mysql-replica-configuration.client-key" => Some(("replicaConfiguration.mysqlReplicaConfiguration.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "suspension-reason", "tier", "update-track", "username", "verify-server-certificate", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "username", "verify-server-certificate", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1416,6 +1422,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "filter" => { + call = call.filter(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1429,7 +1438,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(["filter", "page-token", "max-results"].iter().map(|v|*v)); v } )); } } @@ -1517,6 +1526,7 @@ impl<'n> Engine<'n> { "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.kind" => Some(("settings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.data-disk-type" => Some(("settings.dataDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.availability-type" => Some(("settings.availabilityType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.maintenance-window.kind" => Some(("settings.maintenanceWindow.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.maintenance-window.update-track" => Some(("settings.maintenanceWindow.updateTrack", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.maintenance-window.day" => Some(("settings.maintenanceWindow.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -1532,6 +1542,7 @@ impl<'n> Engine<'n> { "settings.crash-safe-replication-enabled" => Some(("settings.crashSafeReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.database-replication-enabled" => Some(("settings.databaseReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.replication-type" => Some(("settings.replicationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.storage-auto-resize-limit" => Some(("settings.storageAutoResizeLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.tier" => Some(("settings.tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.pricing-plan" => Some(("settings.pricingPlan", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.settings-version" => Some(("settings.settingsVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1556,7 +1567,7 @@ impl<'n> Engine<'n> { "replica-configuration.mysql-replica-configuration.client-key" => Some(("replicaConfiguration.mysqlReplicaConfiguration.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "suspension-reason", "tier", "update-track", "username", "verify-server-certificate", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "username", "verify-server-certificate", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -1965,7 +1976,41 @@ impl<'n> Engine<'n> { fn _instances_truncate_log(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { - let mut call = self.hub.instances().truncate_log(opt.value_of("project").unwrap_or(""), opt.value_of("instance").unwrap_or(""), opt.value_of("log-type").unwrap_or("")); + + let mut field_cursor = FieldCursor::default(); + let mut object = json::value::Value::Object(Default::default()); + + for kvarg in opt.values_of("kv").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let last_errc = err.issues.len(); + let (key, value) = parse_kv_arg(&*kvarg, err, false); + let mut temp_cursor = field_cursor.clone(); + if let Err(field_err) = temp_cursor.set(&*key) { + err.issues.push(field_err); + } + if value.is_none() { + field_cursor = temp_cursor.clone(); + if err.issues.len() > last_errc { + err.issues.remove(last_errc); + } + continue; + } + + let type_info: Option<(&'static str, JsonTypeInfo)> = + match &temp_cursor.to_string()[..] { + "truncate-log-context.log-type" => Some(("truncateLogContext.logType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "truncate-log-context.kind" => Some(("truncateLogContext.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["kind", "log-type", "truncate-log-context"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::InstancesTruncateLogRequest = json::value::from_value(object).unwrap(); + let mut call = self.hub.instances().truncate_log(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 { @@ -2069,6 +2114,7 @@ impl<'n> Engine<'n> { "region" => Some(("region", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.kind" => Some(("settings.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.data-disk-type" => Some(("settings.dataDiskType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.availability-type" => Some(("settings.availabilityType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.maintenance-window.kind" => Some(("settings.maintenanceWindow.kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.maintenance-window.update-track" => Some(("settings.maintenanceWindow.updateTrack", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.maintenance-window.day" => Some(("settings.maintenanceWindow.day", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -2084,6 +2130,7 @@ impl<'n> Engine<'n> { "settings.crash-safe-replication-enabled" => Some(("settings.crashSafeReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.database-replication-enabled" => Some(("settings.databaseReplicationEnabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "settings.replication-type" => Some(("settings.replicationType", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "settings.storage-auto-resize-limit" => Some(("settings.storageAutoResizeLimit", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.tier" => Some(("settings.tier", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.pricing-plan" => Some(("settings.pricingPlan", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "settings.settings-version" => Some(("settings.settingsVersion", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -2108,7 +2155,7 @@ impl<'n> Engine<'n> { "replica-configuration.mysql-replica-configuration.client-key" => Some(("replicaConfiguration.mysqlReplicaConfiguration.clientKey", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "suspension-reason", "tier", "update-track", "username", "verify-server-certificate", "zone"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["activation-policy", "authorized-gae-applications", "availability-type", "available", "backend-type", "backup-configuration", "binary-log-enabled", "ca-certificate", "cert", "cert-serial-number", "client-certificate", "client-key", "common-name", "connect-retry-interval", "connection-name", "crash-safe-replication-enabled", "create-time", "current-disk-size", "data-disk-size-gb", "data-disk-type", "database-replication-enabled", "database-version", "day", "dump-file-path", "enabled", "etag", "expiration-time", "failover-replica", "failover-target", "follow-gae-application", "host-port", "hour", "instance", "instance-type", "ip-configuration", "ipv4-enabled", "ipv6-address", "kind", "location-preference", "maintenance-window", "master-heartbeat-period", "master-instance-name", "max-disk-size", "mysql-replica-configuration", "name", "on-premises-configuration", "password", "pricing-plan", "project", "region", "replica-configuration", "replica-names", "replication-type", "require-ssl", "self-link", "server-ca-cert", "service-account-email-address", "settings", "settings-version", "sha1-fingerprint", "ssl-cipher", "start-time", "state", "storage-auto-resize", "storage-auto-resize-limit", "suspension-reason", "tier", "update-track", "username", "verify-server-certificate", "zone"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -4046,11 +4093,11 @@ fn main() { Some(true), Some(false)), - (Some(r##"log-type"##), - None, - Some(r##"The type of Log Table to truncate. Valid values are MYSQL_GENERAL_TABLE and MYSQL_SLOW_TABLE"##), + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), Some(true), - Some(false)), + Some(true)), (Some(r##"v"##), Some(r##"p"##), @@ -4506,7 +4553,7 @@ fn main() { let mut app = App::new("sqladmin1-beta4") .author("Sebastian Thiel ") - .version("1.0.4+20161213") + .version("1.0.4+20170502") .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 5e93e2de23..b6a1bcdb8e 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.4+20161213" +version = "1.0.4+20170502" 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.4+20161213" +documentation = "https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502" license = "MIT" keywords = ["sqladmin", "google", "protocol", "web", "api"] diff --git a/gen/sqladmin1_beta4/README.md b/gen/sqladmin1_beta4/README.md index 54f67836a1..6acba49d8b 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.4+20161213*, where *20161213* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *SQL Admin* crate version *1.0.4+20170502*, where *20170502* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161213/google_sqladmin1_beta4/struct.SQLAdmin.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.SQLAdmin.html) ... -* [backup runs](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.BackupRun.html) - * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.BackupRunDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.BackupRunGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.BackupRunInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.BackupRunListCall.html) -* [databases](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.Database.html) - * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.DatabaseDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.DatabaseGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.DatabaseInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.DatabaseListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.DatabasePatchCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.DatabaseUpdateCall.html) -* [flags](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.Flag.html) - * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.FlagListCall.html) +* [backup runs](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.BackupRun.html) + * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.BackupRunDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.BackupRunGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.BackupRunInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.BackupRunListCall.html) +* [databases](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.Database.html) + * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.DatabaseDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.DatabaseGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.DatabaseInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.DatabaseListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.DatabasePatchCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.DatabaseUpdateCall.html) +* [flags](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.Flag.html) + * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.FlagListCall.html) * instances - * [*clone*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceCloneCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceDeleteCall.html), [*export*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceExportCall.html), [*failover*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceFailoverCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceGetCall.html), [*import*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceImportCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstancePatchCall.html), [*promote replica*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstancePromoteReplicaCall.html), [*reset ssl config*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceResetSslConfigCall.html), [*restart*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceRestartCall.html), [*restore backup*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceRestoreBackupCall.html), [*start replica*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceStartReplicaCall.html), [*stop replica*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceStopReplicaCall.html), [*truncate log*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceTruncateLogCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.InstanceUpdateCall.html) -* [operations](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.Operation.html) - * [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.OperationListCall.html) -* [ssl certs](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.SslCert.html) - * [*create ephemeral*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.SslCertCreateEphemeralCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.SslCertDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.SslCertGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.SslCertInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.SslCertListCall.html) -* [tiers](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.Tier.html) - * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.TierListCall.html) -* [users](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.User.html) - * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.UserDeleteCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.UserInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.UserListCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/struct.UserUpdateCall.html) + * [*clone*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceCloneCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceDeleteCall.html), [*export*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceExportCall.html), [*failover*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceFailoverCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceGetCall.html), [*import*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceImportCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceListCall.html), [*patch*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstancePatchCall.html), [*promote replica*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstancePromoteReplicaCall.html), [*reset ssl config*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceResetSslConfigCall.html), [*restart*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceRestartCall.html), [*restore backup*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceRestoreBackupCall.html), [*start replica*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceStartReplicaCall.html), [*stop replica*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceStopReplicaCall.html), [*truncate log*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceTruncateLogCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.InstanceUpdateCall.html) +* [operations](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.Operation.html) + * [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.OperationGetCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.OperationListCall.html) +* [ssl certs](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.SslCert.html) + * [*create ephemeral*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.SslCertCreateEphemeralCall.html), [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.SslCertDeleteCall.html), [*get*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.SslCertGetCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.SslCertInsertCall.html) and [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.SslCertListCall.html) +* [tiers](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.Tier.html) + * [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.TierListCall.html) +* [users](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.User.html) + * [*delete*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.UserDeleteCall.html), [*insert*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.UserInsertCall.html), [*list*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/struct.UserListCall.html) and [*update*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/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.4+20161213/google_sqladmin1_beta4/struct.SQLAdmin.html)** +* **[Hub](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/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.4+20161213/google_sqladmin1_beta4/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/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.4+20161213/google_sqladmin1_beta4/trait.Part.html)** + * **[Parts](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/google_sqladmin1_beta4/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/google_sqladmin1_beta4/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/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. @@ -161,17 +161,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/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.4+20170502/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.4+20161213/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.4+20170502/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.4+20161213/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.4+20170502/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.4+20161213/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.4+20170502/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")`. @@ -181,29 +181,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.4+20161213/google_sqladmin1_beta4/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/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.4+20170502/google_sqladmin1_beta4/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/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.4+20161213/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.4+20170502/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.4+20161213/google_sqladmin1_beta4/trait.RequestValue.html) and -[decodable](https://docs.rs/google-sqladmin1_beta4/1.0.4+20161213/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.4+20170502/google_sqladmin1_beta4/trait.RequestValue.html) and +[decodable](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/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.4+20161213/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.4+20170502/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.4+20161213/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.4+20170502/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.4+20161213/google_sqladmin1_beta4/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-sqladmin1_beta4/1.0.4+20170502/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 81c0d5c246..4be9ceb541 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.4+20161213*, where *20161213* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *SQL Admin* crate version *1.0.4+20170502*, where *20170502* is the exact revision of the *sqladmin:v1beta4* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! 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). @@ -216,7 +216,7 @@ // 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 +// 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)] @@ -351,8 +351,6 @@ pub struct SQLAdmin { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for SQLAdmin {} @@ -365,8 +363,6 @@ impl<'a, C, A> SQLAdmin client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/sql/v1beta4/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -404,26 +400,6 @@ impl<'a, C, A> SQLAdmin self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/sql/v1beta4/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -948,6 +924,22 @@ pub struct Flag { impl Resource for Flag {} +/// Database Instance truncate log 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 TruncateLogContext { + /// The type of log to truncate. Valid values are MYSQL_GENERAL_TABLE and MYSQL_SLOW_TABLE. + #[serde(rename="logType")] + pub log_type: Option, + /// This is always sql#truncateLogContext. + pub kind: Option, +} + +impl Part for TruncateLogContext {} + + /// A Cloud SQL user resource. /// /// # Activities @@ -1146,6 +1138,11 @@ impl Part for MySqlReplicaConfiguration {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Settings { + /// Reserved for future use. + #[serde(rename="availabilityType")] + pub availability_type: Option, + /// Reserved for future use. + pub labels: Option>, /// The activation policy specifies when the instance is activated; it is applicable only when the instance state is RUNNABLE. The activation policy cannot be updated together with other settings for Second Generation instances. Valid values: /// ALWAYS: The instance is on; it is not deactivated by inactivity. /// NEVER: The instance is off; it is not activated, even if a connection request arrives. @@ -1189,6 +1186,9 @@ pub struct Settings { /// The daily backup configuration for the instance. #[serde(rename="backupConfiguration")] pub backup_configuration: Option, + /// The maximum size to which storage capacity can be automatically increased. The default value is 0, which specifies that there is no limit. Applies only to Second Generation instances. + #[serde(rename="storageAutoResizeLimit")] + pub storage_auto_resize_limit: Option, /// Configuration specific to read replica instances. Indicates whether database flags for crash-safe replication are enabled. This property is only applicable to First Generation instances. #[serde(rename="crashSafeReplicationEnabled")] pub crash_safe_replication_enabled: Option, @@ -1299,6 +1299,25 @@ pub struct SslCertsCreateEphemeralRequest { impl RequestValue for SslCertsCreateEphemeralRequest {} +/// Instance truncate log 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*). +/// +/// * [truncate log instances](struct.InstanceTruncateLogCall.html) (request) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct InstancesTruncateLogRequest { + /// Contains details about the truncate log operation. + #[serde(rename="truncateLogContext")] + pub truncate_log_context: Option, +} + +impl RequestValue for InstancesTruncateLogRequest {} + + /// Maintenance window. This specifies when a v2 Cloud SQL instance should preferably be restarted for system maintenance puruposes. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1361,6 +1380,21 @@ pub struct InstancesExportRequest { impl RequestValue for InstancesExportRequest {} +/// Reserved for future use. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Labels { + /// Reserved for future use. + pub key: Option, + /// Reserved for future use. + pub value: Option, +} + +impl Part for Labels {} + + /// User list response. /// /// # Activities @@ -1615,7 +1649,7 @@ pub struct Operation { /// The time this operation was enqueued in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. #[serde(rename="insertTime")] pub insert_time: Option, - /// The URI of the instance related to the operation. + /// no description provided #[serde(rename="targetLink")] pub target_link: Option, /// The time this operation actually started in UTC timezone in RFC 3339 format, for example 2012-11-15T16:19:00.094Z. @@ -2005,15 +2039,15 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { /// /// # Arguments /// + /// * `request` - No description provided. /// * `project` - Project ID of the Cloud SQL project. /// * `instance` - Cloud SQL instance ID. This does not include the project ID. - /// * `logType` - The type of Log Table to truncate. Valid values are MYSQL_GENERAL_TABLE and MYSQL_SLOW_TABLE - pub fn truncate_log(&self, project: &str, instance: &str, log_type: &str) -> InstanceTruncateLogCall<'a, C, A> { + pub fn truncate_log(&self, request: InstancesTruncateLogRequest, project: &str, instance: &str) -> InstanceTruncateLogCall<'a, C, A> { InstanceTruncateLogCall { hub: self.hub, + _request: request, _project: project.to_string(), _instance: instance.to_string(), - _log_type: log_type.to_string(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2229,6 +2263,7 @@ impl<'a, C, A> InstanceMethods<'a, C, A> { _project: project.to_string(), _page_token: Default::default(), _max_results: Default::default(), + _filter: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2385,6 +2420,7 @@ impl<'a, C, A> FlagMethods<'a, C, A> { pub fn list(&self) -> FlagListCall<'a, C, A> { FlagListCall { hub: self.hub, + _database_version: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2920,7 +2956,7 @@ impl<'a, C, A> OperationListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/operations"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/operations".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3181,7 +3217,7 @@ impl<'a, C, A> OperationGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/operations/{operation}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/operations/{operation}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3426,7 +3462,7 @@ impl<'a, C, A> TierListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/tiers"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/tiers".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3663,7 +3699,7 @@ impl<'a, C, A> UserListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/users".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3914,7 +3950,7 @@ impl<'a, C, A> UserDeleteCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/users".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4192,7 +4228,7 @@ impl<'a, C, A> UserUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/users".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4490,7 +4526,7 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/users"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/users".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -4702,6 +4738,7 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_sqladmin1_beta4 as sqladmin1_beta4; +/// use sqladmin1_beta4::InstancesTruncateLogRequest; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -4712,10 +4749,15 @@ impl<'a, C, A> UserInsertCall<'a, C, A> where C: BorrowMut, A: oa /// # hyper::Client::new(), /// # ::default(), None); /// # let mut hub = SQLAdmin::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = InstancesTruncateLogRequest::default(); +/// /// // You can configure optional parameters by calling 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().truncate_log("project", "instance", "logType") +/// let result = hub.instances().truncate_log(req, "project", "instance") /// .doit(); /// # } /// ``` @@ -4723,9 +4765,9 @@ pub struct InstanceTruncateLogCall<'a, C, A> where C: 'a, A: 'a { hub: &'a SQLAdmin, + _request: InstancesTruncateLogRequest, _project: String, _instance: String, - _log_type: String, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4750,8 +4792,7 @@ impl<'a, C, A> InstanceTruncateLogCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((5 + self._additional_params.len())); params.push(("project", self._project.to_string())); params.push(("instance", self._instance.to_string())); - params.push(("logType", self._log_type.to_string())); - for &field in ["alt", "project", "instance", "logType"].iter() { + for &field in ["alt", "project", "instance"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4763,7 +4804,7 @@ impl<'a, C, A> InstanceTruncateLogCall<'a, C, A> where C: BorrowMut InstanceTruncateLogCall<'a, C, A> where C: BorrowMut InstanceTruncateLogCall<'a, C, A> where C: BorrowMut InstanceTruncateLogCall<'a, C, A> where C: BorrowMut InstanceTruncateLogCall<'a, C, A> { + self._request = new_value; + self + } /// Project ID of the Cloud SQL project. /// /// Sets the *project* path property to the given value. @@ -4886,16 +4951,6 @@ impl<'a, C, A> InstanceTruncateLogCall<'a, C, A> where C: BorrowMut InstanceTruncateLogCall<'a, C, A> { - self._log_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. /// @@ -5027,7 +5082,7 @@ impl<'a, C, A> InstanceFailoverCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/failover"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/failover".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5298,7 +5353,7 @@ impl<'a, C, A> InstanceResetSslConfigCall<'a, C, A> where C: BorrowMut InstancePromoteReplicaCall<'a, C, A> where C: BorrowMut InstanceGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6046,7 +6101,7 @@ impl<'a, C, A> InstancePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6324,7 +6379,7 @@ impl<'a, C, A> InstanceCloneCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/clone"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/clone".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6595,7 +6650,7 @@ impl<'a, C, A> InstanceDeleteCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6842,7 +6897,7 @@ impl<'a, C, A> InstanceStopReplicaCall<'a, C, A> where C: BorrowMut InstanceStartReplicaCall<'a, C, A> where C: BorrowMut InstanceInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7557,8 +7612,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("et") -/// .max_results(55) +/// .page_token("sanctus") +/// .max_results(79) +/// .filter("amet") /// .doit(); /// # } /// ``` @@ -7569,6 +7625,7 @@ pub struct InstanceListCall<'a, C, A> _project: String, _page_token: Option, _max_results: Option, + _filter: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -7590,7 +7647,7 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "sql.instances.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(("project", self._project.to_string())); if let Some(value) = self._page_token { params.push(("pageToken", value.to_string())); @@ -7598,7 +7655,10 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._max_results { params.push(("maxResults", value.to_string())); } - for &field in ["alt", "project", "pageToken", "maxResults"].iter() { + if let Some(value) = self._filter { + params.push(("filter", value.to_string())); + } + for &field in ["alt", "project", "pageToken", "maxResults", "filter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7610,7 +7670,7 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7737,6 +7797,13 @@ impl<'a, C, A> InstanceListCall<'a, C, A> where C: BorrowMut, A: self._max_results = Some(new_value); self } + /// Reserved for future use. + /// + /// Sets the *filter* query property to the given value. + pub fn filter(mut self, new_value: &str) -> InstanceListCall<'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. /// @@ -7868,7 +7935,7 @@ impl<'a, C, A> InstanceImportCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/import"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/import".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8146,7 +8213,7 @@ impl<'a, C, A> InstanceUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8417,7 +8484,7 @@ impl<'a, C, A> InstanceRestartCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/restart"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/restart".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8671,7 +8738,7 @@ impl<'a, C, A> InstanceExportCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/export"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/export".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8949,7 +9016,7 @@ impl<'a, C, A> InstanceRestoreBackupCall<'a, C, A> where C: BorrowMut InstanceRestoreBackupCall<'a, C, A> where C: BorrowMut where C: 'a, A: 'a { hub: &'a SQLAdmin, + _database_version: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -9203,8 +9272,11 @@ impl<'a, C, A> FlagListCall<'a, C, A> where C: BorrowMut, A: oaut }; dlg.begin(MethodInfo { id: "sql.flags.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() { + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + if let Some(value) = self._database_version { + params.push(("databaseVersion", value.to_string())); + } + for &field in ["alt", "databaseVersion"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9216,7 +9288,7 @@ impl<'a, C, A> FlagListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "flags"; + let mut url = "https://www.googleapis.com/sql/v1beta4/flags".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9298,6 +9370,13 @@ impl<'a, C, A> FlagListCall<'a, C, A> where C: BorrowMut, A: oaut } + /// Database version for flag retrieval. Flags are specific to the database version. + /// + /// Sets the *database version* query property to the given value. + pub fn database_version(mut self, new_value: &str) -> FlagListCall<'a, C, A> { + self._database_version = 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. /// @@ -9424,7 +9503,7 @@ impl<'a, C, A> DatabaseDeleteCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9690,7 +9769,7 @@ impl<'a, C, A> DatabasePatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9971,7 +10050,7 @@ impl<'a, C, A> DatabaseListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10225,7 +10304,7 @@ impl<'a, C, A> DatabaseInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10498,7 +10577,7 @@ impl<'a, C, A> DatabaseGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -10764,7 +10843,7 @@ impl<'a, C, A> DatabaseUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/databases/{database}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/databases/{database}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11052,7 +11131,7 @@ impl<'a, C, A> SslCertInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11325,7 +11404,7 @@ impl<'a, C, A> SslCertDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11584,7 +11663,7 @@ impl<'a, C, A> SslCertGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts/{sha1Fingerprint}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11848,7 +11927,7 @@ impl<'a, C, A> SslCertCreateEphemeralCall<'a, C, A> where C: BorrowMut SslCertListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/sslCerts"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/sslCerts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12321,8 +12400,8 @@ impl<'a, C, A> 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("ea") -/// .max_results(-95) +/// .page_token("sadipscing") +/// .max_results(-66) /// .doit(); /// # } /// ``` @@ -12376,7 +12455,7 @@ impl<'a, C, A> BackupRunListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12639,7 +12718,7 @@ impl<'a, C, A> BackupRunGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns/{id}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12898,7 +12977,7 @@ impl<'a, C, A> BackupRunDeleteCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns/{id}"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13162,7 +13241,7 @@ impl<'a, C, A> BackupRunInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "projects/{project}/instances/{instance}/backupRuns"; + let mut url = "https://www.googleapis.com/sql/v1beta4/projects/{project}/instances/{instance}/backupRuns".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -13361,3 +13440,4 @@ impl<'a, C, A> BackupRunInsertCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/storage1-cli/Cargo.toml b/gen/storage1-cli/Cargo.toml index 95675c923a..1ecc1bbdf2 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.4+20161123" +version = "1.0.4+20170504" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-storage1] path = "../storage1" -version = "1.0.4+20161123" +version = "1.0.4+20170504" diff --git a/gen/storage1-cli/README.md b/gen/storage1-cli/README.md index ff6f16f72c..5f1cc019d8 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 *20161123*. The CLI is at version *1.0.4*. +This documentation was generated from the *storage* API at revision *20170504*. The CLI is at version *1.0.4*. ```bash storage1 [options] @@ -39,9 +39,12 @@ storage1 [options] buckets delete [-p ]... get [-p ]... [-o ] + get-iam-policy [-p ]... [-o ] insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] + set-iam-policy (-r )... [-p ]... [-o ] + test-iam-permissions ... [-p ]... [-o ] update (-r )... [-p ]... [-o ] channels stop (-r )... [-p ]... @@ -52,6 +55,11 @@ storage1 [options] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] update (-r )... [-p ]... [-o ] + notifications + delete [-p ]... + get [-p ]... [-o ] + insert (-r )... [-p ]... [-o ] + list [-p ]... [-o ] object-access-controls delete [-p ]... get [-p ]... [-o ] @@ -64,12 +72,17 @@ storage1 [options] copy (-r )... [-p ]... [-o ] delete [-p ]... get [-p ]... [-o ] + get-iam-policy [-p ]... [-o ] insert (-r )... (-u (simple|resumable) -f [-m ]) [-p ]... [-o ] list [-p ]... [-o ] patch (-r )... [-p ]... [-o ] rewrite (-r )... [-p ]... [-o ] + set-iam-policy (-r )... [-p ]... [-o ] + test-iam-permissions ... [-p ]... [-o ] update (-r )... [-p ]... [-o ] watch-all (-r )... [-p ]... [-o ] + projects + service-account-get [-p ]... [-o ] storage1 --help Configuration: diff --git a/gen/storage1-cli/mkdocs.yml b/gen/storage1-cli/mkdocs.yml index 97c9bfc6f0..bedc9836d8 100644 --- a/gen/storage1-cli/mkdocs.yml +++ b/gen/storage1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: storage v1.0.4+20161123 +site_name: storage v1.0.4+20170504 site_url: http://byron.github.io/google-apis-rs/google-storage1-cli site_description: A complete library to interact with storage (protocol v1) @@ -17,9 +17,12 @@ pages: - ['bucket-access-controls_update.md', 'Bucket Access Controls', 'Update'] - ['buckets_delete.md', 'Buckets', 'Delete'] - ['buckets_get.md', 'Buckets', 'Get'] +- ['buckets_get-iam-policy.md', 'Buckets', 'Get Iam Policy'] - ['buckets_insert.md', 'Buckets', 'Insert'] - ['buckets_list.md', 'Buckets', 'List'] - ['buckets_patch.md', 'Buckets', 'Patch'] +- ['buckets_set-iam-policy.md', 'Buckets', 'Set Iam Policy'] +- ['buckets_test-iam-permissions.md', 'Buckets', 'Test Iam Permissions'] - ['buckets_update.md', 'Buckets', 'Update'] - ['channels_stop.md', 'Channels', 'Stop'] - ['default-object-access-controls_delete.md', 'Default Object Access Controls', 'Delete'] @@ -28,6 +31,10 @@ pages: - ['default-object-access-controls_list.md', 'Default Object Access Controls', 'List'] - ['default-object-access-controls_patch.md', 'Default Object Access Controls', 'Patch'] - ['default-object-access-controls_update.md', 'Default Object Access Controls', 'Update'] +- ['notifications_delete.md', 'Notifications', 'Delete'] +- ['notifications_get.md', 'Notifications', 'Get'] +- ['notifications_insert.md', 'Notifications', 'Insert'] +- ['notifications_list.md', 'Notifications', 'List'] - ['object-access-controls_delete.md', 'Object Access Controls', 'Delete'] - ['object-access-controls_get.md', 'Object Access Controls', 'Get'] - ['object-access-controls_insert.md', 'Object Access Controls', 'Insert'] @@ -38,12 +45,16 @@ pages: - ['objects_copy.md', 'Objects', 'Copy'] - ['objects_delete.md', 'Objects', 'Delete'] - ['objects_get.md', 'Objects', 'Get'] +- ['objects_get-iam-policy.md', 'Objects', 'Get Iam Policy'] - ['objects_insert.md', 'Objects', 'Insert'] - ['objects_list.md', 'Objects', 'List'] - ['objects_patch.md', 'Objects', 'Patch'] - ['objects_rewrite.md', 'Objects', 'Rewrite'] +- ['objects_set-iam-policy.md', 'Objects', 'Set Iam Policy'] +- ['objects_test-iam-permissions.md', 'Objects', 'Test Iam Permissions'] - ['objects_update.md', 'Objects', 'Update'] - ['objects_watch-all.md', 'Objects', 'Watch All'] +- ['projects_service-account-get.md', 'Projects', 'Service Account Get'] theme: readthedocs diff --git a/gen/storage1-cli/src/main.rs b/gen/storage1-cli/src/main.rs index 7a1b2515f6..838a3251a9 100644 --- a/gen/storage1-cli/src/main.rs +++ b/gen/storage1-cli/src/main.rs @@ -52,6 +52,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -65,6 +68,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -96,6 +100,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -109,6 +116,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -192,6 +200,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -205,6 +216,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -244,6 +256,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -257,6 +272,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -340,6 +356,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -353,6 +372,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -436,6 +456,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -449,6 +472,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -488,6 +512,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "if-metageneration-not-match" => { call = call.if_metageneration_not_match(value.unwrap_or("")); }, @@ -507,7 +534,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-metageneration-not-match", "if-metageneration-match"].iter().map(|v|*v)); + v.extend(["if-metageneration-not-match", "user-project", "if-metageneration-match"].iter().map(|v|*v)); v } )); } } @@ -539,6 +566,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -561,7 +591,63 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-metageneration-match", "if-metageneration-not-match", "projection"].iter().map(|v|*v)); + v.extend(["if-metageneration-match", "if-metageneration-not-match", "user-project", "projection"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _buckets_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.buckets().get_iam_policy(opt.value_of("bucket").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -620,24 +706,26 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "website.not-found-page" => Some(("website.notFoundPage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "website.main-page-suffix" => Some(("website.mainPageSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "updated" => Some(("updated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "billing.requester-pays" => Some(("billing.requesterPays", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "logging.log-object-prefix" => Some(("logging.logObjectPrefix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "logging.log-bucket" => Some(("logging.logBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-created" => Some(("timeCreated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "project-number" => Some(("projectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metageneration" => Some(("metageneration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["enabled", "entity", "entity-id", "etag", "id", "kind", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "enabled", "entity", "entity-id", "etag", "id", "kind", "labels", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -797,24 +885,26 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "website.not-found-page" => Some(("website.notFoundPage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "website.main-page-suffix" => Some(("website.mainPageSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "updated" => Some(("updated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "billing.requester-pays" => Some(("billing.requesterPays", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "logging.log-object-prefix" => Some(("logging.logObjectPrefix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "logging.log-bucket" => Some(("logging.logBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-created" => Some(("timeCreated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "project-number" => Some(("projectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metageneration" => Some(("metageneration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["enabled", "entity", "entity-id", "etag", "id", "kind", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "enabled", "entity", "entity-id", "etag", "id", "kind", "labels", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -828,6 +918,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -856,7 +949,154 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-metageneration-match", "if-metageneration-not-match", "predefined-acl", "projection", "predefined-default-object-acl"].iter().map(|v|*v)); + v.extend(["projection", "if-metageneration-match", "user-project", "predefined-default-object-acl", "predefined-acl", "if-metageneration-not-match"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _buckets_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()[..] { + "resource-id" => Some(("resourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "kind", "resource-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::Policy = json::value::from_value(object).unwrap(); + let mut call = self.hub.buckets().set_iam_policy(request, opt.value_of("bucket").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _buckets_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.buckets().test_iam_permissions(opt.value_of("bucket").unwrap_or(""), &opt.values_of("permissions").map(|i|i.collect()).unwrap_or(Vec::new()).iter().map(|&v| v.to_string()).collect::>()); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -915,24 +1155,26 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "website.not-found-page" => Some(("website.notFoundPage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "website.main-page-suffix" => Some(("website.mainPageSuffix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "updated" => Some(("updated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "billing.requester-pays" => Some(("billing.requesterPays", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "logging.log-object-prefix" => Some(("logging.logObjectPrefix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "logging.log-bucket" => Some(("logging.logBucket", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "name" => Some(("name", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "time-created" => Some(("timeCreated", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "location" => Some(("location", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "labels" => Some(("labels", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), "project-number" => Some(("projectNumber", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "metageneration" => Some(("metageneration", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity-id" => Some(("owner.entityId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "owner.entity" => Some(("owner.entity", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), - "versioning.enabled" => Some(("versioning.enabled", JsonTypeInfo { jtype: JsonType::Boolean, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "storage-class" => Some(("storageClass", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["enabled", "entity", "entity-id", "etag", "id", "kind", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["billing", "enabled", "entity", "entity-id", "etag", "id", "kind", "labels", "location", "log-bucket", "log-object-prefix", "logging", "main-page-suffix", "metageneration", "name", "not-found-page", "owner", "project-number", "requester-pays", "self-link", "storage-class", "time-created", "updated", "versioning", "website"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -946,6 +1188,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -974,7 +1219,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-metageneration-match", "if-metageneration-not-match", "predefined-acl", "projection", "predefined-default-object-acl"].iter().map(|v|*v)); + v.extend(["projection", "if-metageneration-match", "user-project", "predefined-default-object-acl", "predefined-acl", "if-metageneration-not-match"].iter().map(|v|*v)); v } )); } } @@ -1100,6 +1345,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1113,6 +1361,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -1144,6 +1393,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1157,6 +1409,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -1242,6 +1495,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1255,6 +1511,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -1294,6 +1551,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "if-metageneration-not-match" => { call = call.if_metageneration_not_match(value.unwrap_or("")); }, @@ -1313,7 +1573,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-metageneration-not-match", "if-metageneration-match"].iter().map(|v|*v)); + v.extend(["if-metageneration-not-match", "user-project", "if-metageneration-match"].iter().map(|v|*v)); v } )); } } @@ -1399,6 +1659,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1412,6 +1675,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -1497,6 +1761,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, _ => { let mut found = false; for param in &self.gp { @@ -1510,6 +1777,264 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _notifications_delete(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.notifications().delete(opt.value_of("bucket").unwrap_or(""), opt.value_of("notification").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.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 _notifications_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.notifications().get(opt.value_of("bucket").unwrap_or(""), opt.value_of("notification").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _notifications_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 })), + "custom-attributes" => Some(("custom_attributes", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Map })), + "topic" => Some(("topic", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "event-types" => Some(("event_types", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "payload-format" => Some(("payload_format", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "object-name-prefix" => Some(("object_name_prefix", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "self-link" => Some(("selfLink", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["custom-attributes", "etag", "event-types", "id", "kind", "object-name-prefix", "payload-format", "self-link", "topic"]); + err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); + None + } + }; + if let Some((field_cursor_str, type_info)) = type_info { + FieldCursor::from(field_cursor_str).set_json_value(&mut object, value.unwrap(), type_info, err, &temp_cursor); + } + } + let mut request: api::Notification = json::value::from_value(object).unwrap(); + let mut call = self.hub.notifications().insert(request, opt.value_of("bucket").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _notifications_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.notifications().list(opt.value_of("bucket").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); + v.extend(["user-project"].iter().map(|v|*v)); v } )); } } @@ -1549,6 +2074,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "generation" => { call = call.generation(value.unwrap_or("")); }, @@ -1565,7 +2093,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(["generation"].iter().map(|v|*v)); + v.extend(["generation", "user-project"].iter().map(|v|*v)); v } )); } } @@ -1597,6 +2125,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "generation" => { call = call.generation(value.unwrap_or("")); }, @@ -1613,7 +2144,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(["generation"].iter().map(|v|*v)); + v.extend(["generation", "user-project"].iter().map(|v|*v)); v } )); } } @@ -1699,6 +2230,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "generation" => { call = call.generation(value.unwrap_or("")); }, @@ -1715,7 +2249,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(["generation"].iter().map(|v|*v)); + v.extend(["generation", "user-project"].iter().map(|v|*v)); v } )); } } @@ -1755,6 +2289,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "generation" => { call = call.generation(value.unwrap_or("")); }, @@ -1771,7 +2308,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(["generation"].iter().map(|v|*v)); + v.extend(["generation", "user-project"].iter().map(|v|*v)); v } )); } } @@ -1857,6 +2394,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "generation" => { call = call.generation(value.unwrap_or("")); }, @@ -1873,7 +2413,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(["generation"].iter().map(|v|*v)); + v.extend(["generation", "user-project"].iter().map(|v|*v)); v } )); } } @@ -1959,6 +2499,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "generation" => { call = call.generation(value.unwrap_or("")); }, @@ -1975,7 +2518,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(["generation"].iter().map(|v|*v)); + v.extend(["generation", "user-project"].iter().map(|v|*v)); v } )); } } @@ -2077,6 +2620,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "if-metageneration-match" => { call = call.if_metageneration_match(value.unwrap_or("")); }, @@ -2102,7 +2648,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-metageneration-match", "if-generation-match", "destination-predefined-acl"].iter().map(|v|*v)); + v.extend(["if-metageneration-match", "user-project", "destination-predefined-acl", "if-generation-match"].iter().map(|v|*v)); v } )); } } @@ -2208,6 +2754,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "source-generation" => { call = call.source_generation(value.unwrap_or("")); }, @@ -2257,7 +2806,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-source-generation-match", "projection", "if-source-metageneration-not-match", "if-metageneration-not-match", "source-generation", "destination-predefined-acl", "if-source-generation-not-match", "if-source-metageneration-match", "if-generation-match", "if-metageneration-match", "if-generation-not-match"].iter().map(|v|*v)); + v.extend(["if-source-generation-match", "projection", "if-source-metageneration-not-match", "if-metageneration-not-match", "user-project", "source-generation", "destination-predefined-acl", "if-source-generation-not-match", "if-source-metageneration-match", "if-generation-match", "if-metageneration-match", "if-generation-not-match"].iter().map(|v|*v)); v } )); } } @@ -2302,6 +2851,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "if-metageneration-not-match" => { call = call.if_metageneration_not_match(value.unwrap_or("")); }, @@ -2330,7 +2882,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(["generation", "if-metageneration-not-match", "if-generation-match", "if-metageneration-match", "if-generation-not-match"].iter().map(|v|*v)); + v.extend(["if-generation-not-match", "generation", "if-metageneration-not-match", "user-project", "if-generation-match", "if-metageneration-match"].iter().map(|v|*v)); v } )); } } @@ -2363,6 +2915,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -2397,7 +2952,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(["projection", "generation", "if-metageneration-match", "if-generation-match", "if-metageneration-not-match", "if-generation-not-match"].iter().map(|v|*v)); + v.extend(["projection", "generation", "if-metageneration-match", "user-project", "if-generation-match", "if-metageneration-not-match", "if-generation-not-match"].iter().map(|v|*v)); v } )); } } @@ -2436,6 +2991,65 @@ impl<'n> Engine<'n> { } } + fn _objects_get_iam_policy(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.objects().get_iam_policy(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); + match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, + "generation" => { + call = call.generation(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(["generation", "user-project"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + fn _objects_insert(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -2502,6 +3116,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -2539,7 +3156,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-generation-match", "if-generation-not-match", "content-encoding", "if-metageneration-match", "name", "predefined-acl", "if-metageneration-not-match", "projection"].iter().map(|v|*v)); + v.extend(["if-generation-match", "projection", "if-metageneration-match", "user-project", "content-encoding", "if-generation-not-match", "predefined-acl", "if-metageneration-not-match", "name"].iter().map(|v|*v)); v } )); } } @@ -2588,6 +3205,9 @@ impl<'n> Engine<'n> { "versions" => { call = call.versions(arg_from_str(value.unwrap_or("false"), err, "versions", "boolean")); }, + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -2616,7 +3236,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(["projection", "versions", "prefix", "max-results", "page-token", "delimiter"].iter().map(|v|*v)); + v.extend(["projection", "versions", "user-project", "delimiter", "max-results", "page-token", "prefix"].iter().map(|v|*v)); v } )); } } @@ -2716,6 +3336,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -2750,7 +3373,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-generation-match", "projection", "generation", "if-metageneration-match", "predefined-acl", "if-metageneration-not-match", "if-generation-not-match"].iter().map(|v|*v)); + v.extend(["if-generation-match", "projection", "generation", "if-metageneration-match", "user-project", "predefined-acl", "if-metageneration-not-match", "if-generation-not-match"].iter().map(|v|*v)); v } )); } } @@ -2850,6 +3473,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "source-generation" => { call = call.source_generation(value.unwrap_or("")); }, @@ -2902,7 +3528,160 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-source-generation-match", "if-generation-match", "projection", "if-source-metageneration-not-match", "if-metageneration-not-match", "source-generation", "max-bytes-rewritten-per-call", "if-source-generation-not-match", "destination-predefined-acl", "if-source-metageneration-match", "rewrite-token", "if-metageneration-match", "if-generation-not-match"].iter().map(|v|*v)); + v.extend(["if-source-generation-match", "if-generation-match", "projection", "if-source-metageneration-not-match", "if-metageneration-not-match", "user-project", "source-generation", "max-bytes-rewritten-per-call", "if-source-generation-not-match", "destination-predefined-acl", "if-source-metageneration-match", "rewrite-token", "if-metageneration-match", "if-generation-not-match"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _objects_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()[..] { + "resource-id" => Some(("resourceId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "etag" => Some(("etag", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + _ => { + let suggestion = FieldCursor::did_you_mean(key, &vec!["etag", "kind", "resource-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::Policy = json::value::from_value(object).unwrap(); + let mut call = self.hub.objects().set_iam_policy(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); + match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, + "generation" => { + call = call.generation(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(["generation", "user-project"].iter().map(|v|*v)); + v } )); + } + } + } + } + let protocol = CallType::Standard; + if dry_run { + Ok(()) + } else { + assert!(err.issues.len() == 0); + for scope in self.opt.values_of("url").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + call = call.add_scope(scope); + } + let mut ostream = match writer_from_opts(opt.value_of("out")) { + Ok(mut f) => f, + Err(io_err) => return Err(DoitError::IoError(opt.value_of("out").unwrap_or("-").to_string(), io_err)), + }; + match match protocol { + CallType::Standard => call.doit(), + _ => unreachable!() + } { + Err(api_err) => Err(DoitError::ApiError(api_err)), + Ok((mut response, output_schema)) => { + let mut value = json::value::to_value(&output_schema).expect("serde to work"); + remove_json_null_values(&mut value); + json::to_writer_pretty(&mut ostream, &value).unwrap(); + ostream.flush().unwrap(); + Ok(()) + } + } + } + } + + fn _objects_test_iam_permissions(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.objects().test_iam_permissions(opt.value_of("bucket").unwrap_or(""), opt.value_of("object").unwrap_or(""), &opt.values_of("permissions").map(|i|i.collect()).unwrap_or(Vec::new()).iter().map(|&v| v.to_string()).collect::>()); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, + "generation" => { + call = call.generation(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(["generation", "user-project"].iter().map(|v|*v)); v } )); } } @@ -3003,6 +3782,9 @@ impl<'n> Engine<'n> { for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { let (key, value) = parse_kv_arg(&*parg, err, false); match key { + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -3040,7 +3822,7 @@ impl<'n> Engine<'n> { err.issues.push(CLIError::UnknownParameter(key.to_string(), {let mut v = Vec::new(); v.extend(self.gp.iter().map(|v|*v)); - v.extend(["if-generation-match", "projection", "generation", "if-metageneration-match", "predefined-acl", "if-metageneration-not-match", "if-generation-not-match"].iter().map(|v|*v)); + v.extend(["if-generation-match", "projection", "generation", "if-metageneration-match", "user-project", "predefined-acl", "if-metageneration-not-match", "if-generation-not-match"].iter().map(|v|*v)); v } )); } } @@ -3130,6 +3912,9 @@ impl<'n> Engine<'n> { "versions" => { call = call.versions(arg_from_str(value.unwrap_or("false"), err, "versions", "boolean")); }, + "user-project" => { + call = call.user_project(value.unwrap_or("")); + }, "projection" => { call = call.projection(value.unwrap_or("")); }, @@ -3158,7 +3943,59 @@ 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(["projection", "versions", "prefix", "max-results", "page-token", "delimiter"].iter().map(|v|*v)); + v.extend(["projection", "versions", "user-project", "delimiter", "max-results", "page-token", "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 _projects_service_account_get(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.projects().service_account_get(opt.value_of("project-id").unwrap_or("")); + for parg in opt.values_of("v").map(|i|i.collect()).unwrap_or(Vec::new()).iter() { + let (key, value) = parse_kv_arg(&*parg, err, false); + match key { + _ => { + let mut found = false; + for param in &self.gp { + if key == *param { + found = true; + call = call.param(self.gpm.iter().find(|t| t.0 == key).unwrap_or(&("", key)).1, value.unwrap_or("unset")); + break; + } + } + if !found { + err.issues.push(CLIError::UnknownParameter(key.to_string(), + {let mut v = Vec::new(); + v.extend(self.gp.iter().map(|v|*v)); v } )); } } @@ -3231,6 +4068,9 @@ impl<'n> Engine<'n> { ("get", Some(opt)) => { call_result = self._buckets_get(opt, dry_run, &mut err); }, + ("get-iam-policy", Some(opt)) => { + call_result = self._buckets_get_iam_policy(opt, dry_run, &mut err); + }, ("insert", Some(opt)) => { call_result = self._buckets_insert(opt, dry_run, &mut err); }, @@ -3240,6 +4080,12 @@ impl<'n> Engine<'n> { ("patch", Some(opt)) => { call_result = self._buckets_patch(opt, dry_run, &mut err); }, + ("set-iam-policy", Some(opt)) => { + call_result = self._buckets_set_iam_policy(opt, dry_run, &mut err); + }, + ("test-iam-permissions", Some(opt)) => { + call_result = self._buckets_test_iam_permissions(opt, dry_run, &mut err); + }, ("update", Some(opt)) => { call_result = self._buckets_update(opt, dry_run, &mut err); }, @@ -3286,6 +4132,26 @@ impl<'n> Engine<'n> { } } }, + ("notifications", Some(opt)) => { + match opt.subcommand() { + ("delete", Some(opt)) => { + call_result = self._notifications_delete(opt, dry_run, &mut err); + }, + ("get", Some(opt)) => { + call_result = self._notifications_get(opt, dry_run, &mut err); + }, + ("insert", Some(opt)) => { + call_result = self._notifications_insert(opt, dry_run, &mut err); + }, + ("list", Some(opt)) => { + call_result = self._notifications_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("notifications".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("object-access-controls", Some(opt)) => { match opt.subcommand() { ("delete", Some(opt)) => { @@ -3326,6 +4192,9 @@ impl<'n> Engine<'n> { ("get", Some(opt)) => { call_result = self._objects_get(opt, dry_run, &mut err); }, + ("get-iam-policy", Some(opt)) => { + call_result = self._objects_get_iam_policy(opt, dry_run, &mut err); + }, ("insert", Some(opt)) => { call_result = self._objects_insert(opt, dry_run, &mut err); }, @@ -3338,6 +4207,12 @@ impl<'n> Engine<'n> { ("rewrite", Some(opt)) => { call_result = self._objects_rewrite(opt, dry_run, &mut err); }, + ("set-iam-policy", Some(opt)) => { + call_result = self._objects_set_iam_policy(opt, dry_run, &mut err); + }, + ("test-iam-permissions", Some(opt)) => { + call_result = self._objects_test_iam_permissions(opt, dry_run, &mut err); + }, ("update", Some(opt)) => { call_result = self._objects_update(opt, dry_run, &mut err); }, @@ -3350,6 +4225,17 @@ impl<'n> Engine<'n> { } } }, + ("projects", Some(opt)) => { + match opt.subcommand() { + ("service-account-get", Some(opt)) => { + call_result = self._projects_service_account_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(); @@ -3604,7 +4490,7 @@ fn main() { ]), ]), - ("buckets", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ + ("buckets", "methods: 'delete', 'get', 'get-iam-policy', 'insert', 'list', 'patch', 'set-iam-policy', 'test-iam-permissions' and 'update'", vec![ ("delete", Some(r##"Permanently deletes an empty bucket."##), "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/buckets_delete", @@ -3637,6 +4523,28 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get-iam-policy", + Some(r##"Returns an IAM policy for the specified bucket."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/buckets_get-iam-policy", + vec![ + (Some(r##"bucket"##), + None, + Some(r##"Name of a bucket."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3715,6 +4623,62 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-iam-policy", + Some(r##"Updates an IAM policy for the specified bucket."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/buckets_set-iam-policy", + vec![ + (Some(r##"bucket"##), + None, + Some(r##"Name of a bucket."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("test-iam-permissions", + Some(r##"Tests a set of permissions on the given bucket to see which, if any, are held by the caller."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/buckets_test-iam-permissions", + vec![ + (Some(r##"bucket"##), + None, + Some(r##"Name of a bucket."##), + Some(true), + Some(false)), + + (Some(r##"permissions"##), + None, + Some(r##"Permissions to test."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -3941,6 +4905,109 @@ fn main() { ]), ]), + ("notifications", "methods: 'delete', 'get', 'insert' and 'list'", vec![ + ("delete", + Some(r##"Permanently deletes a notification subscription."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/notifications_delete", + vec![ + (Some(r##"bucket"##), + None, + Some(r##"The parent bucket of the notification."##), + Some(true), + Some(false)), + + (Some(r##"notification"##), + None, + Some(r##"ID of the notification to delete."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + ]), + ("get", + Some(r##"View a notification configuration."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/notifications_get", + vec![ + (Some(r##"bucket"##), + None, + Some(r##"The parent bucket of the notification."##), + Some(true), + Some(false)), + + (Some(r##"notification"##), + None, + Some(r##"Notification 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##"Creates a notification subscription for a given bucket."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/notifications_insert", + vec![ + (Some(r##"bucket"##), + None, + Some(r##"The parent bucket of the notification."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(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 notification subscriptions for a given bucket."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/notifications_list", + vec![ + (Some(r##"bucket"##), + None, + Some(r##"Name of a GCS bucket."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("object-access-controls", "methods: 'delete', 'get', 'insert', 'list', 'patch' and 'update'", vec![ ("delete", Some(r##"Permanently deletes the ACL entry for the specified entity on the specified object."##), @@ -4148,7 +5215,7 @@ fn main() { ]), ]), - ("objects", "methods: 'compose', 'copy', 'delete', 'get', 'insert', 'list', 'patch', 'rewrite', 'update' and 'watch-all'", vec![ + ("objects", "methods: 'compose', 'copy', 'delete', 'get', 'get-iam-policy', 'insert', 'list', 'patch', 'rewrite', 'set-iam-policy', 'test-iam-permissions', 'update' and 'watch-all'", vec![ ("compose", Some(r##"Concatenates a list of existing objects into a new object in the same bucket."##), "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/objects_compose", @@ -4273,6 +5340,34 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("get-iam-policy", + Some(r##"Returns an IAM policy for the specified object."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/objects_get-iam-policy", + vec![ + (Some(r##"bucket"##), + None, + Some(r##"Name of the bucket in which the object resides."##), + Some(true), + Some(false)), + + (Some(r##"object"##), + None, + Some(r##"Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -4409,6 +5504,74 @@ fn main() { Some(false), Some(true)), + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("set-iam-policy", + Some(r##"Updates an IAM policy for the specified object."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/objects_set-iam-policy", + vec![ + (Some(r##"bucket"##), + None, + Some(r##"Name of the bucket in which the object resides."##), + Some(true), + Some(false)), + + (Some(r##"object"##), + None, + Some(r##"Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts."##), + Some(true), + Some(false)), + + (Some(r##"kv"##), + Some(r##"r"##), + Some(r##"Set various fields of the request structure, matching the key=value form"##), + Some(true), + Some(true)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ("test-iam-permissions", + Some(r##"Tests a set of permissions on the given object to see which, if any, are held by the caller."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/objects_test-iam-permissions", + vec![ + (Some(r##"bucket"##), + None, + Some(r##"Name of the bucket in which the object resides."##), + Some(true), + Some(false)), + + (Some(r##"object"##), + None, + Some(r##"Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts."##), + Some(true), + Some(false)), + + (Some(r##"permissions"##), + None, + Some(r##"Permissions to test."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + (Some(r##"out"##), Some(r##"o"##), Some(r##"Specify the file into which to write the program's output"##), @@ -4479,11 +5642,36 @@ fn main() { ]), ]), + ("projects", "methods: 'service-account-get'", vec![ + ("service-account-get", + Some(r##"Get the email address of this project's GCS service account."##), + "Details at http://byron.github.io/google-apis-rs/google_storage1_cli/projects_service-account-get", + vec![ + (Some(r##"project-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)), + ]), + ]), + ]; let mut app = App::new("storage1") .author("Sebastian Thiel ") - .version("1.0.4+20161123") + .version("1.0.4+20170504") .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 455c5f8d35..7fbbcef4bd 100644 --- a/gen/storage1/Cargo.toml +++ b/gen/storage1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-storage1" -version = "1.0.4+20161123" +version = "1.0.4+20170504" 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.4+20161123" +documentation = "https://docs.rs/google-storage1/1.0.4+20170504" license = "MIT" keywords = ["storage", "google", "protocol", "web", "api"] diff --git a/gen/storage1/README.md b/gen/storage1/README.md index a5fe1090cc..76e669254b 100644 --- a/gen/storage1/README.md +++ b/gen/storage1/README.md @@ -5,44 +5,48 @@ DO NOT EDIT ! --> The `google-storage1` library allows access to all features of the *Google storage* service. -This documentation was generated from *storage* crate version *1.0.4+20161123*, where *20161123* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *storage* crate version *1.0.4+20170504*, where *20170504* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161123/google_storage1/struct.Storage.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.Storage.html) ... -* [bucket access controls](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketAccessControl.html) - * [*delete*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketAccessControlUpdateCall.html) -* [buckets](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.Bucket.html) - * [*delete*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.BucketUpdateCall.html) -* [channels](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.Channel.html) - * [*stop*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ChannelStopCall.html) +* [bucket access controls](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketAccessControl.html) + * [*delete*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketAccessControlUpdateCall.html) +* [buckets](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.Bucket.html) + * [*delete*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketPatchCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketTestIamPermissionCall.html) and [*update*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.BucketUpdateCall.html) +* [channels](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.Channel.html) + * [*stop*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ChannelStopCall.html) * default object access controls - * [*delete*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.DefaultObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.DefaultObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.DefaultObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.DefaultObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.DefaultObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.DefaultObjectAccessControlUpdateCall.html) -* [object access controls](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectAccessControl.html) - * [*delete*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectAccessControlUpdateCall.html) -* [objects](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.Object.html) - * [*compose*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectComposeCall.html), [*copy*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectCopyCall.html), [*delete*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectPatchCall.html), [*rewrite*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectRewriteCall.html), [*update*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectUpdateCall.html) and [*watch all*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectWatchAllCall.html) + * [*delete*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.DefaultObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.DefaultObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.DefaultObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.DefaultObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.DefaultObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.DefaultObjectAccessControlUpdateCall.html) +* [notifications](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.Notification.html) + * [*delete*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.NotificationDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.NotificationGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.NotificationInsertCall.html) and [*list*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.NotificationListCall.html) +* [object access controls](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectAccessControl.html) + * [*delete*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectAccessControlDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectAccessControlGetCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectAccessControlInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectAccessControlListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectAccessControlPatchCall.html) and [*update*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectAccessControlUpdateCall.html) +* [objects](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.Object.html) + * [*compose*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectComposeCall.html), [*copy*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectCopyCall.html), [*delete*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectDeleteCall.html), [*get*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectGetCall.html), [*get iam policy*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectGetIamPolicyCall.html), [*insert*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectInsertCall.html), [*list*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectListCall.html), [*patch*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectPatchCall.html), [*rewrite*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectRewriteCall.html), [*set iam policy*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectSetIamPolicyCall.html), [*test iam permissions*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectTestIamPermissionCall.html), [*update*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectUpdateCall.html) and [*watch all*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectWatchAllCall.html) +* projects + * [*service account get*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ProjectServiceAccountGetCall.html) Upload supported by ... -* [*insert objects*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectInsertCall.html) +* [*insert objects*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectInsertCall.html) Download supported by ... -* [*get objects*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectGetCall.html) -* [*update objects*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectUpdateCall.html) -* [*insert objects*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectInsertCall.html) -* [*compose objects*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectComposeCall.html) -* [*copy objects*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectCopyCall.html) +* [*get objects*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectGetCall.html) +* [*update objects*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectUpdateCall.html) +* [*insert objects*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectInsertCall.html) +* [*compose objects*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectComposeCall.html) +* [*copy objects*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectCopyCall.html) Subscription supported by ... -* [*watch all objects*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectWatchAllCall.html) -* [*list objects*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.ObjectListCall.html) +* [*watch all objects*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectWatchAllCall.html) +* [*list objects*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/struct.ObjectListCall.html) @@ -50,17 +54,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/struct.Storage.html)** +* **[Hub](https://docs.rs/google-storage1/1.0.4+20170504/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.4+20161123/google_storage1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-storage1/1.0.4+20170504/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.4+20161123/google_storage1/trait.Part.html)** + * **[Parts](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-storage1/1.0.4+20161123/google_storage1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-storage1/1.0.4+20170504/google_storage1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -74,11 +78,14 @@ let r = hub.resource().activity(...).doit() Or specifically ... ```ignore +let r = hub.objects().get_iam_policy(...).doit() let r = hub.objects().list(...).doit() let r = hub.objects().rewrite(...).doit() +let r = hub.objects().test_iam_permissions(...).doit() let r = hub.objects().copy(...).doit() let r = hub.objects().watch_all(...).doit() let r = hub.objects().get(...).doit() +let r = hub.objects().set_iam_policy(...).doit() let r = hub.objects().insert(...).doit() let r = hub.objects().compose(...).doit() let r = hub.objects().update(...).doit() @@ -135,19 +142,20 @@ let mut req = Object::default(); // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! let result = hub.objects().rewrite(req, "sourceBucket", "sourceObject", "destinationBucket", "destinationObject") - .source_generation("et") - .rewrite_token("dolores") - .projection("kasd") - .max_bytes_rewritten_per_call("accusam") - .if_source_metageneration_not_match("takimata") - .if_source_metageneration_match("justo") - .if_source_generation_not_match("amet.") - .if_source_generation_match("erat") - .if_metageneration_not_match("labore") - .if_metageneration_match("sea") - .if_generation_not_match("nonumy") - .if_generation_match("dolores") - .destination_predefined_acl("gubergren") + .user_project("et") + .source_generation("dolores") + .rewrite_token("kasd") + .projection("accusam") + .max_bytes_rewritten_per_call("takimata") + .if_source_metageneration_not_match("justo") + .if_source_metageneration_match("amet.") + .if_source_generation_not_match("erat") + .if_source_generation_match("labore") + .if_metageneration_not_match("sea") + .if_metageneration_match("nonumy") + .if_generation_not_match("dolores") + .if_generation_match("gubergren") + .destination_predefined_acl("sadipscing") .doit(); match result { @@ -170,17 +178,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-storage1/1.0.4+20161123/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.4+20170504/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.4+20161123/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.4+20170504/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.4+20161123/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.4+20170504/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.4+20161123/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.4+20170504/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")`. @@ -190,29 +198,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.4+20161123/google_storage1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-storage1/1.0.4+20161123/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.4+20170504/google_storage1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-storage1/1.0.4+20170504/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.4+20161123/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.4+20170504/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.4+20161123/google_storage1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-storage1/1.0.4+20161123/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.4+20170504/google_storage1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-storage1/1.0.4+20170504/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.4+20161123/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.4+20170504/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.4+20161123/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.4+20170504/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.4+20161123/google_storage1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-storage1/1.0.4+20170504/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 cb22e730cd..176e10af77 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.4+20161123*, where *20161123* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *storage* crate version *1.0.4+20170504*, where *20170504* is the exact revision of the *storage:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *storage* *v1* API can be found at the //! [official documentation site](https://developers.google.com/storage/docs/json_api/). @@ -14,15 +14,19 @@ //! * [bucket access controls](struct.BucketAccessControl.html) //! * [*delete*](struct.BucketAccessControlDeleteCall.html), [*get*](struct.BucketAccessControlGetCall.html), [*insert*](struct.BucketAccessControlInsertCall.html), [*list*](struct.BucketAccessControlListCall.html), [*patch*](struct.BucketAccessControlPatchCall.html) and [*update*](struct.BucketAccessControlUpdateCall.html) //! * [buckets](struct.Bucket.html) -//! * [*delete*](struct.BucketDeleteCall.html), [*get*](struct.BucketGetCall.html), [*insert*](struct.BucketInsertCall.html), [*list*](struct.BucketListCall.html), [*patch*](struct.BucketPatchCall.html) and [*update*](struct.BucketUpdateCall.html) +//! * [*delete*](struct.BucketDeleteCall.html), [*get*](struct.BucketGetCall.html), [*get iam policy*](struct.BucketGetIamPolicyCall.html), [*insert*](struct.BucketInsertCall.html), [*list*](struct.BucketListCall.html), [*patch*](struct.BucketPatchCall.html), [*set iam policy*](struct.BucketSetIamPolicyCall.html), [*test iam permissions*](struct.BucketTestIamPermissionCall.html) and [*update*](struct.BucketUpdateCall.html) //! * [channels](struct.Channel.html) //! * [*stop*](struct.ChannelStopCall.html) //! * default object access controls //! * [*delete*](struct.DefaultObjectAccessControlDeleteCall.html), [*get*](struct.DefaultObjectAccessControlGetCall.html), [*insert*](struct.DefaultObjectAccessControlInsertCall.html), [*list*](struct.DefaultObjectAccessControlListCall.html), [*patch*](struct.DefaultObjectAccessControlPatchCall.html) and [*update*](struct.DefaultObjectAccessControlUpdateCall.html) +//! * [notifications](struct.Notification.html) +//! * [*delete*](struct.NotificationDeleteCall.html), [*get*](struct.NotificationGetCall.html), [*insert*](struct.NotificationInsertCall.html) and [*list*](struct.NotificationListCall.html) //! * [object access controls](struct.ObjectAccessControl.html) //! * [*delete*](struct.ObjectAccessControlDeleteCall.html), [*get*](struct.ObjectAccessControlGetCall.html), [*insert*](struct.ObjectAccessControlInsertCall.html), [*list*](struct.ObjectAccessControlListCall.html), [*patch*](struct.ObjectAccessControlPatchCall.html) and [*update*](struct.ObjectAccessControlUpdateCall.html) //! * [objects](struct.Object.html) -//! * [*compose*](struct.ObjectComposeCall.html), [*copy*](struct.ObjectCopyCall.html), [*delete*](struct.ObjectDeleteCall.html), [*get*](struct.ObjectGetCall.html), [*insert*](struct.ObjectInsertCall.html), [*list*](struct.ObjectListCall.html), [*patch*](struct.ObjectPatchCall.html), [*rewrite*](struct.ObjectRewriteCall.html), [*update*](struct.ObjectUpdateCall.html) and [*watch all*](struct.ObjectWatchAllCall.html) +//! * [*compose*](struct.ObjectComposeCall.html), [*copy*](struct.ObjectCopyCall.html), [*delete*](struct.ObjectDeleteCall.html), [*get*](struct.ObjectGetCall.html), [*get iam policy*](struct.ObjectGetIamPolicyCall.html), [*insert*](struct.ObjectInsertCall.html), [*list*](struct.ObjectListCall.html), [*patch*](struct.ObjectPatchCall.html), [*rewrite*](struct.ObjectRewriteCall.html), [*set iam policy*](struct.ObjectSetIamPolicyCall.html), [*test iam permissions*](struct.ObjectTestIamPermissionCall.html), [*update*](struct.ObjectUpdateCall.html) and [*watch all*](struct.ObjectWatchAllCall.html) +//! * projects +//! * [*service account get*](struct.ProjectServiceAccountGetCall.html) //! //! //! Upload supported by ... @@ -74,11 +78,14 @@ //! Or specifically ... //! //! ```ignore +//! let r = hub.objects().get_iam_policy(...).doit() //! let r = hub.objects().list(...).doit() //! let r = hub.objects().rewrite(...).doit() +//! let r = hub.objects().test_iam_permissions(...).doit() //! let r = hub.objects().copy(...).doit() //! let r = hub.objects().watch_all(...).doit() //! let r = hub.objects().get(...).doit() +//! let r = hub.objects().set_iam_policy(...).doit() //! let r = hub.objects().insert(...).doit() //! let r = hub.objects().compose(...).doit() //! let r = hub.objects().update(...).doit() @@ -136,19 +143,20 @@ //! // execute the final call using `doit()`. //! // Values shown here are possibly random and not representative ! //! let result = hub.objects().rewrite(req, "sourceBucket", "sourceObject", "destinationBucket", "destinationObject") -//! .source_generation("justo") -//! .rewrite_token("justo") -//! .projection("et") -//! .max_bytes_rewritten_per_call("et") -//! .if_source_metageneration_not_match("diam") -//! .if_source_metageneration_match("ipsum") -//! .if_source_generation_not_match("Lorem") -//! .if_source_generation_match("et") -//! .if_metageneration_not_match("duo") -//! .if_metageneration_match("aliquyam") -//! .if_generation_not_match("sea") -//! .if_generation_match("Lorem") -//! .destination_predefined_acl("eos") +//! .user_project("justo") +//! .source_generation("et") +//! .rewrite_token("et") +//! .projection("diam") +//! .max_bytes_rewritten_per_call("ipsum") +//! .if_source_metageneration_not_match("Lorem") +//! .if_source_metageneration_match("et") +//! .if_source_generation_not_match("duo") +//! .if_source_generation_match("aliquyam") +//! .if_metageneration_not_match("sea") +//! .if_metageneration_match("Lorem") +//! .if_generation_not_match("eos") +//! .if_generation_match("erat") +//! .destination_predefined_acl("sadipscing") //! .doit(); //! //! match result { @@ -225,7 +233,7 @@ // 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 +// 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)] @@ -348,19 +356,20 @@ impl Default for Scope { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().rewrite(req, "sourceBucket", "sourceObject", "destinationBucket", "destinationObject") -/// .source_generation("elitr") -/// .rewrite_token("amet") -/// .projection("no") -/// .max_bytes_rewritten_per_call("labore") -/// .if_source_metageneration_not_match("eirmod") -/// .if_source_metageneration_match("dolore") -/// .if_source_generation_not_match("invidunt") -/// .if_source_generation_match("aliquyam") -/// .if_metageneration_not_match("accusam") -/// .if_metageneration_match("Lorem") -/// .if_generation_not_match("sea") -/// .if_generation_match("et") -/// .destination_predefined_acl("duo") +/// .user_project("no") +/// .source_generation("labore") +/// .rewrite_token("eirmod") +/// .projection("dolore") +/// .max_bytes_rewritten_per_call("invidunt") +/// .if_source_metageneration_not_match("aliquyam") +/// .if_source_metageneration_match("accusam") +/// .if_source_generation_not_match("Lorem") +/// .if_source_generation_match("sea") +/// .if_metageneration_not_match("et") +/// .if_metageneration_match("duo") +/// .if_generation_not_match("et") +/// .if_generation_match("eirmod") +/// .destination_predefined_acl("sanctus") /// .doit(); /// /// match result { @@ -385,8 +394,6 @@ pub struct Storage { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Storage {} @@ -399,8 +406,6 @@ impl<'a, C, A> Storage client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/storage/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -416,12 +421,18 @@ impl<'a, C, A> Storage pub fn default_object_access_controls(&'a self) -> DefaultObjectAccessControlMethods<'a, C, A> { DefaultObjectAccessControlMethods { hub: &self } } + pub fn notifications(&'a self) -> NotificationMethods<'a, C, A> { + NotificationMethods { hub: &self } + } pub fn object_access_controls(&'a self) -> ObjectAccessControlMethods<'a, C, A> { ObjectAccessControlMethods { hub: &self } } pub fn objects(&'a self) -> ObjectMethods<'a, C, A> { ObjectMethods { hub: &self } } + pub fn projects(&'a self) -> ProjectMethods<'a, C, A> { + ProjectMethods { hub: &self } + } /// Set the user-agent header field to use in all requests to the server. /// It defaults to `google-api-rust-client/1.0.4`. @@ -432,32 +443,84 @@ impl<'a, C, A> Storage self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/storage/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // SCHEMAS ### // ########## +/// The action to take. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BucketLifecycleRuleAction { + /// Type of the action. Currently, only Delete and SetStorageClass are supported. + #[serde(rename="type")] + pub type_: Option, + /// Target storage class. Required iff the type of the action is SetStorageClass. + #[serde(rename="storageClass")] + pub storage_class: Option, +} + +impl NestedType for BucketLifecycleRuleAction {} +impl Part for BucketLifecycleRuleAction {} + + +/// Conditions that must be met for this operation to execute. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ComposeRequestSourceObjectsObjectPreconditions { + /// Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail. + #[serde(rename="ifGenerationMatch")] + pub if_generation_match: Option, +} + +impl NestedType for ComposeRequestSourceObjectsObjectPreconditions {} +impl Part for ComposeRequestSourceObjectsObjectPreconditions {} + + +/// The list of source objects that will be concatenated into a single object. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ComposeRequestSourceObjects { + /// The generation of this object to use as the source. + pub generation: Option, + /// The source object's name. The source object's bucket is implicitly the destination bucket. + pub name: Option, + /// Conditions that must be met for this operation to execute. + #[serde(rename="objectPreconditions")] + pub object_preconditions: Option, +} + +impl NestedType for ComposeRequestSourceObjects {} +impl Part for ComposeRequestSourceObjects {} + + +/// A subscription to receive Google PubSub notifications. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [service account get projects](struct.ProjectServiceAccountGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ServiceAccount { + /// The kind of item this is. For notifications, this is always storage#notification. + pub kind: Option, + /// The ID of the notification. + pub email_address: Option, +} + +impl ResponseResult for ServiceAccount {} + + /// An access-control list. /// /// # Activities @@ -478,6 +541,101 @@ pub struct BucketAccessControls { impl ResponseResult for BucketAccessControls {} +/// The bucket's Cross-Origin Resource Sharing (CORS) 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 BucketCors { + /// The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin". + pub origin: Option>, + /// The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains. + #[serde(rename="responseHeader")] + pub response_header: Option>, + /// The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method". + pub method: Option>, + /// The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses. + #[serde(rename="maxAgeSeconds")] + pub max_age_seconds: Option, +} + +impl NestedType for BucketCors {} +impl Part for BucketCors {} + + +/// A bucket. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 buckets](struct.BucketUpdateCall.html) (request|response) +/// * [test iam permissions buckets](struct.BucketTestIamPermissionCall.html) (none) +/// * [insert buckets](struct.BucketInsertCall.html) (request|response) +/// * [delete buckets](struct.BucketDeleteCall.html) (none) +/// * [set iam policy buckets](struct.BucketSetIamPolicyCall.html) (none) +/// * [get iam policy buckets](struct.BucketGetIamPolicyCall.html) (none) +/// * [patch buckets](struct.BucketPatchCall.html) (request|response) +/// * [list buckets](struct.BucketListCall.html) (none) +/// * [get buckets](struct.BucketGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Bucket { + /// The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information. + pub website: Option, + /// The URI of this bucket. + #[serde(rename="selfLink")] + pub self_link: Option, + /// The modification time of the bucket in RFC 3339 format. + pub updated: Option, + /// The creation time of the bucket in RFC 3339 format. + #[serde(rename="timeCreated")] + pub time_created: Option, + /// User-provided labels, in key/value pairs. + pub labels: Option>, + /// Default access controls to apply to new objects when no ACL is provided. + #[serde(rename="defaultObjectAcl")] + pub default_object_acl: Option>, + /// The metadata generation of this bucket. + pub metageneration: Option, + /// The bucket's Cross-Origin Resource Sharing (CORS) configuration. + pub cors: Option>, + /// The owner of the bucket. This is always the project team's owner group. + pub owner: Option, + /// Access controls on the bucket. + pub acl: Option>, + /// The ID of the bucket. For buckets, the id and name properities are the same. + pub id: Option, + /// The kind of item this is. For buckets, this is always storage#bucket. + pub kind: Option, + /// The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. + pub logging: Option, + /// The name of the bucket. + pub name: Option, + /// The bucket's billing configuration. + pub billing: Option, + /// The project number of the project the bucket belongs to. + #[serde(rename="projectNumber")] + pub project_number: Option, + /// HTTP 1.1 Entity tag for the bucket. + pub etag: Option, + /// The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes. + #[serde(rename="storageClass")] + pub storage_class: Option, + /// The bucket's lifecycle configuration. See lifecycle management for more information. + pub lifecycle: Option, + /// The bucket's versioning configuration. + pub versioning: Option, + /// The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list. + pub location: Option, +} + +impl RequestValue for Bucket {} +impl Resource for Bucket {} +impl ResponseResult for Bucket {} + + /// A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -494,6 +652,24 @@ impl NestedType for BucketLifecycleRule {} impl Part for BucketLifecycleRule {} +/// Metadata of customer-supplied encryption key, if the object is encrypted by such a key. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ObjectCustomerEncryption { + /// The encryption algorithm. + #[serde(rename="encryptionAlgorithm")] + pub encryption_algorithm: Option, + /// SHA256 hash value of the encryption key. + #[serde(rename="keySha256")] + pub key_sha256: Option, +} + +impl NestedType for ObjectCustomerEncryption {} +impl Part for ObjectCustomerEncryption {} + + /// The project team associated with the entity, if any. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -537,467 +713,33 @@ impl NestedType for BucketLifecycleRuleCondition {} impl Part for BucketLifecycleRuleCondition {} -/// The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BucketWebsite { - /// If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result. - #[serde(rename="notFoundPage")] - pub not_found_page: Option, - /// If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages. - #[serde(rename="mainPageSuffix")] - pub main_page_suffix: Option, -} - -impl NestedType for BucketWebsite {} -impl Part for BucketWebsite {} - - -/// An notification channel used to watch for resource changes. +/// A bucket/object IAM policy. /// /// # Activities /// /// This type is used in activities, which are methods you may call on this type or where this type is involved in. /// The list links the activity name, along with information about where it is used (one of *request* and *response*). /// -/// * [stop channels](struct.ChannelStopCall.html) (request) -/// * [watch all objects](struct.ObjectWatchAllCall.html) (request|response) +/// * [get iam policy objects](struct.ObjectGetIamPolicyCall.html) (response) +/// * [set iam policy buckets](struct.BucketSetIamPolicyCall.html) (request|response) +/// * [set iam policy objects](struct.ObjectSetIamPolicyCall.html) (request|response) +/// * [get iam policy buckets](struct.BucketGetIamPolicyCall.html) (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. +pub struct Policy { + /// The ID of the resource to which this policy belongs. Will be of the form buckets/bucket for buckets, and buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input. #[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 {} - - -/// The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BucketLogging { - /// A prefix for log object names. - #[serde(rename="logObjectPrefix")] - pub log_object_prefix: Option, - /// The destination bucket where the current bucket's logs should be placed. - #[serde(rename="logBucket")] - pub log_bucket: Option, -} - -impl NestedType for BucketLogging {} -impl Part for BucketLogging {} - - -/// The bucket's lifecycle configuration. See lifecycle management for more information. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BucketLifecycle { - /// A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken. - pub rule: Option>, -} - -impl NestedType for BucketLifecycle {} -impl Part for BucketLifecycle {} - - -/// The bucket's versioning 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 BucketVersioning { - /// While set to true, versioning is fully enabled for this bucket. - pub enabled: Option, -} - -impl NestedType for BucketVersioning {} -impl Part for BucketVersioning {} - - -/// An 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*). -/// -/// * [list objects](struct.ObjectListCall.html) (none) -/// * [rewrite objects](struct.ObjectRewriteCall.html) (request) -/// * [copy objects](struct.ObjectCopyCall.html) (request|response) -/// * [watch all objects](struct.ObjectWatchAllCall.html) (none) -/// * [get objects](struct.ObjectGetCall.html) (response) -/// * [insert objects](struct.ObjectInsertCall.html) (request|response) -/// * [compose objects](struct.ObjectComposeCall.html) (response) -/// * [update objects](struct.ObjectUpdateCall.html) (request|response) -/// * [delete objects](struct.ObjectDeleteCall.html) (none) -/// * [patch objects](struct.ObjectPatchCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Object { - /// The link to this object. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The modification time of the object metadata in RFC 3339 format. - pub updated: Option, - /// Content-Type of the object data. If contentType is not specified, object downloads will be served as application/octet-stream. - #[serde(rename="contentType")] - pub content_type: Option, - /// The creation time of the object in RFC 3339 format. - #[serde(rename="timeCreated")] - pub time_created: Option, - /// The content generation of this object. Used for object versioning. - pub generation: Option, - /// Metadata of customer-supplied encryption key, if the object is encrypted by such a key. - #[serde(rename="customerEncryption")] - pub customer_encryption: Option, - /// Number of underlying components that make up this object. Components are accumulated by compose operations. - #[serde(rename="componentCount")] - pub component_count: Option, - /// The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. - #[serde(rename="timeStorageClassUpdated")] - pub time_storage_class_updated: Option, - /// The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object. - pub metageneration: Option, - /// Media download link. - #[serde(rename="mediaLink")] - pub media_link: Option, - /// The owner of the object. This will always be the uploader of the object. - pub owner: Option, - /// Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600. - #[serde(rename="cacheControl")] - pub cache_control: Option, - /// Access controls on the object. - pub acl: Option>, - /// The ID of the object. - pub id: Option, - /// Content-Length of the data in bytes. - pub size: Option, - /// The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. - #[serde(rename="timeDeleted")] - pub time_deleted: Option, - /// The kind of item this is. For objects, this is always storage#object. - pub kind: Option, - /// Content-Language of the object data. - #[serde(rename="contentLanguage")] - pub content_language: Option, - /// The name of this object. Required if not specified by URL parameter. - pub name: Option, - /// MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. - #[serde(rename="md5Hash")] - pub md5_hash: Option, - /// The name of the bucket containing this object. - pub bucket: Option, - /// Content-Encoding of the object data. - #[serde(rename="contentEncoding")] - pub content_encoding: Option, - /// CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices. - pub crc32c: Option, - /// HTTP 1.1 Entity tag for the object. + /// An association between a role, which comes with a set of permissions, and members who may assume that role. + pub bindings: Option>, + /// HTTP 1.1 Entity tag for the policy. pub etag: Option, - /// Storage class of the object. - #[serde(rename="storageClass")] - pub storage_class: Option, - /// Content-Disposition of the object data. - #[serde(rename="contentDisposition")] - pub content_disposition: Option, - /// User-provided metadata, in key/value pairs. - pub metadata: Option>, -} - -impl RequestValue for Object {} -impl Resource for Object {} -impl ResponseResult for Object {} - - -/// A list of objects. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 objects](struct.ObjectListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Objects { - /// The continuation token, 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, - /// The list of items. - pub items: Option>, - /// The kind of item this is. For lists of objects, this is always storage#objects. - pub kind: Option, - /// The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter. - pub prefixes: Option>, -} - -impl ResponseResult for Objects {} - - -/// The bucket's Cross-Origin Resource Sharing (CORS) 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 BucketCors { - /// The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin". - pub origin: Option>, - /// The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains. - #[serde(rename="responseHeader")] - pub response_header: Option>, - /// The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list of methods, and means "any method". - pub method: Option>, - /// The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses. - #[serde(rename="maxAgeSeconds")] - pub max_age_seconds: Option, -} - -impl NestedType for BucketCors {} -impl Part for BucketCors {} - - -/// An access-control 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 object access controls](struct.ObjectAccessControlListCall.html) (response) -/// * [list default object access controls](struct.DefaultObjectAccessControlListCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ObjectAccessControls { - /// The list of items. - pub items: Option>, - /// The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls. + /// The kind of item this is. For policies, this is always storage#policy. This field is ignored on input. pub kind: Option, } -impl ResponseResult for ObjectAccessControls {} - - -/// The project team associated with the entity, if any. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BucketAccessControlProjectTeam { - /// The project number. - #[serde(rename="projectNumber")] - pub project_number: Option, - /// The team. - pub team: Option, -} - -impl NestedType for BucketAccessControlProjectTeam {} -impl Part for BucketAccessControlProjectTeam {} - - -/// Conditions that must be met for this operation to execute. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ComposeRequestSourceObjectsObjectPreconditions { - /// Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail. - #[serde(rename="ifGenerationMatch")] - pub if_generation_match: Option, -} - -impl NestedType for ComposeRequestSourceObjectsObjectPreconditions {} -impl Part for ComposeRequestSourceObjectsObjectPreconditions {} - - -/// The list of source objects that will be concatenated into a single object. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ComposeRequestSourceObjects { - /// The generation of this object to use as the source. - pub generation: Option, - /// The source object's name. The source object's bucket is implicitly the destination bucket. - pub name: Option, - /// Conditions that must be met for this operation to execute. - #[serde(rename="objectPreconditions")] - pub object_preconditions: Option, -} - -impl NestedType for ComposeRequestSourceObjects {} -impl Part for ComposeRequestSourceObjects {} - - -/// A bucket. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 buckets](struct.BucketUpdateCall.html) (request|response) -/// * [insert buckets](struct.BucketInsertCall.html) (request|response) -/// * [delete buckets](struct.BucketDeleteCall.html) (none) -/// * [patch buckets](struct.BucketPatchCall.html) (request|response) -/// * [list buckets](struct.BucketListCall.html) (none) -/// * [get buckets](struct.BucketGetCall.html) (response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct Bucket { - /// The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information. - pub website: Option, - /// The modification time of the bucket in RFC 3339 format. - pub updated: Option, - /// The creation time of the bucket in RFC 3339 format. - #[serde(rename="timeCreated")] - pub time_created: Option, - /// The bucket's versioning configuration. - pub versioning: Option, - /// Default access controls to apply to new objects when no ACL is provided. - #[serde(rename="defaultObjectAcl")] - pub default_object_acl: Option>, - /// The metadata generation of this bucket. - pub metageneration: Option, - /// The bucket's Cross-Origin Resource Sharing (CORS) configuration. - pub cors: Option>, - /// The owner of the bucket. This is always the project team's owner group. - pub owner: Option, - /// Access controls on the bucket. - pub acl: Option>, - /// The ID of the bucket. - pub id: Option, - /// The kind of item this is. For buckets, this is always storage#bucket. - pub kind: Option, - /// The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. - pub logging: Option, - /// The name of the bucket. - pub name: Option, - /// The project number of the project the bucket belongs to. - #[serde(rename="projectNumber")] - pub project_number: Option, - /// HTTP 1.1 Entity tag for the bucket. - pub etag: Option, - /// The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes. - #[serde(rename="storageClass")] - pub storage_class: Option, - /// The bucket's lifecycle configuration. See lifecycle management for more information. - pub lifecycle: Option, - /// The URI of this bucket. - #[serde(rename="selfLink")] - pub self_link: Option, - /// The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list. - pub location: Option, -} - -impl RequestValue for Bucket {} -impl Resource for Bucket {} -impl ResponseResult for Bucket {} - - -/// Metadata of customer-supplied encryption key, if the object is encrypted by such a key. -/// -/// This type is not used in any activity, and only used as *part* of another schema. -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ObjectCustomerEncryption { - /// The encryption algorithm. - #[serde(rename="encryptionAlgorithm")] - pub encryption_algorithm: Option, - /// SHA256 hash value of the encryption key. - #[serde(rename="keySha256")] - pub key_sha256: Option, -} - -impl NestedType for ObjectCustomerEncryption {} -impl Part for ObjectCustomerEncryption {} - - -/// An access-control entry. -/// -/// # Activities -/// -/// This type is used in activities, which are methods you may call on this type or where 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 bucket access controls](struct.BucketAccessControlListCall.html) (none) -/// * [patch bucket access controls](struct.BucketAccessControlPatchCall.html) (request|response) -/// * [delete bucket access controls](struct.BucketAccessControlDeleteCall.html) (none) -/// * [update bucket access controls](struct.BucketAccessControlUpdateCall.html) (request|response) -/// * [get bucket access controls](struct.BucketAccessControlGetCall.html) (response) -/// * [insert bucket access controls](struct.BucketAccessControlInsertCall.html) (request|response) -/// -#[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BucketAccessControl { - /// The domain associated with the entity, if any. - pub domain: Option, - /// The name of the bucket. - pub bucket: Option, - /// The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl. - pub kind: Option, - /// The entity holding the permission, in one of the following forms: - /// - user-userId - /// - user-email - /// - group-groupId - /// - group-email - /// - domain-domain - /// - project-team-projectId - /// - allUsers - /// - allAuthenticatedUsers Examples: - /// - The user liz@example.com would be user-liz@example.com. - /// - The group example@googlegroups.com would be group-example@googlegroups.com. - /// - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. - pub entity: Option, - /// The email address associated with the entity, if any. - pub email: Option, - /// HTTP 1.1 Entity tag for the access-control entry. - pub etag: Option, - /// The access permission for the entity. - pub role: Option, - /// The ID for the entity, if any. - #[serde(rename="entityId")] - pub entity_id: Option, - /// The project team associated with the entity, if any. - #[serde(rename="projectTeam")] - pub project_team: Option, - /// The ID of the access-control entry. - pub id: Option, - /// The link to this access-control entry. - #[serde(rename="selfLink")] - pub self_link: Option, -} - -impl RequestValue for BucketAccessControl {} -impl Resource for BucketAccessControl {} -impl ResponseResult for BucketAccessControl {} +impl RequestValue for Policy {} +impl ResponseResult for Policy {} /// An access-control entry. @@ -1098,56 +840,207 @@ pub struct RewriteResponse { impl ResponseResult for RewriteResponse {} -/// The owner of the object. This will always be the uploader of the object. +/// An access-control entry. /// -/// 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 bucket access controls](struct.BucketAccessControlListCall.html) (none) +/// * [patch bucket access controls](struct.BucketAccessControlPatchCall.html) (request|response) +/// * [delete bucket access controls](struct.BucketAccessControlDeleteCall.html) (none) +/// * [update bucket access controls](struct.BucketAccessControlUpdateCall.html) (request|response) +/// * [get bucket access controls](struct.BucketAccessControlGetCall.html) (response) +/// * [insert bucket access controls](struct.BucketAccessControlInsertCall.html) (request|response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ObjectOwner { - /// The ID for the entity. +pub struct BucketAccessControl { + /// The domain associated with the entity, if any. + pub domain: Option, + /// The name of the bucket. + pub bucket: Option, + /// The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl. + pub kind: Option, + /// The entity holding the permission, in one of the following forms: + /// - user-userId + /// - user-email + /// - group-groupId + /// - group-email + /// - domain-domain + /// - project-team-projectId + /// - allUsers + /// - allAuthenticatedUsers Examples: + /// - The user liz@example.com would be user-liz@example.com. + /// - The group example@googlegroups.com would be group-example@googlegroups.com. + /// - To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com. + pub entity: Option, + /// The email address associated with the entity, if any. + pub email: Option, + /// HTTP 1.1 Entity tag for the access-control entry. + pub etag: Option, + /// The access permission for the entity. + pub role: Option, + /// The ID for the entity, if any. #[serde(rename="entityId")] pub entity_id: Option, - /// The entity, in the form user-userId. - pub entity: Option, + /// The project team associated with the entity, if any. + #[serde(rename="projectTeam")] + pub project_team: Option, + /// The ID of the access-control entry. + pub id: Option, + /// The link to this access-control entry. + #[serde(rename="selfLink")] + pub self_link: Option, } -impl NestedType for ObjectOwner {} -impl Part for ObjectOwner {} +impl RequestValue for BucketAccessControl {} +impl Resource for BucketAccessControl {} +impl ResponseResult for BucketAccessControl {} -/// The action to take. +/// An association between a role, which comes with a set of permissions, and members who may assume that 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 BucketLifecycleRuleAction { - /// Type of the action. Currently, only Delete and SetStorageClass are supported. +pub struct PolicyBindings { + /// The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole. + /// The new IAM roles are: + /// - roles/storage.admin — Full control of Google Cloud Storage resources. + /// - roles/storage.objectViewer — Read-Only access to Google Cloud Storage objects. + /// - roles/storage.objectCreator — Access to create objects in Google Cloud Storage. + /// - roles/storage.objectAdmin — Full control of Google Cloud Storage objects. The legacy IAM roles are: + /// - roles/storage.legacyObjectReader — Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. + /// - roles/storage.legacyObjectOwner — Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. + /// - roles/storage.legacyBucketReader — Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. + /// - roles/storage.legacyBucketWriter — Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. + /// - roles/storage.legacyBucketOwner — Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role. + pub role: Option, + /// A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: + /// - allUsers — A special identifier that represents anyone on the internet; with or without a Google account. + /// - allAuthenticatedUsers — A special identifier that represents anyone who is authenticated with a Google account or a service account. + /// - user:emailid — An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. + /// - serviceAccount:emailid — An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . + /// - group:emailid — An email address that represents a Google group. For example, group:admins@example.com. + /// - domain:domain — A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. + /// - projectOwner:projectid — Owners of the given project. For example, projectOwner:my-example-project + /// - projectEditor:projectid — Editors of the given project. For example, projectEditor:my-example-project + /// - projectViewer:projectid — Viewers of the given project. For example, projectViewer:my-example-project + pub members: Option>, +} + +impl NestedType for PolicyBindings {} +impl Part for PolicyBindings {} + + +/// 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*). +/// +/// * [stop channels](struct.ChannelStopCall.html) (request) +/// * [watch all objects](struct.ObjectWatchAllCall.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, - /// Target storage class. Required iff the type of the action is SetStorageClass. - #[serde(rename="storageClass")] - pub storage_class: Option, + /// A Boolean value to indicate whether payload is wanted. Optional. + pub payload: Option, } -impl NestedType for BucketLifecycleRuleAction {} -impl Part for BucketLifecycleRuleAction {} +impl RequestValue for Channel {} +impl Resource for Channel {} +impl ResponseResult for Channel {} -/// The owner of the bucket. This is always the project team's owner group. +/// The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct BucketOwner { - /// The ID for the entity. - #[serde(rename="entityId")] - pub entity_id: Option, - /// The entity, in the form project-owner-projectId. - pub entity: Option, +pub struct BucketLogging { + /// A prefix for log object names. + #[serde(rename="logObjectPrefix")] + pub log_object_prefix: Option, + /// The destination bucket where the current bucket's logs should be placed. + #[serde(rename="logBucket")] + pub log_bucket: Option, } -impl NestedType for BucketOwner {} -impl Part for BucketOwner {} +impl NestedType for BucketLogging {} +impl Part for BucketLogging {} + + +/// A storage.(buckets|objects).testIamPermissions 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*). +/// +/// * [test iam permissions buckets](struct.BucketTestIamPermissionCall.html) (response) +/// * [test iam permissions objects](struct.ObjectTestIamPermissionCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct TestIamPermissionsResponse { + /// The kind of item this is. + pub kind: Option, + /// The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets or objects. The supported permissions are as follows: + /// - storage.buckets.delete — Delete bucket. + /// - storage.buckets.get — Read bucket metadata. + /// - storage.buckets.getIamPolicy — Read bucket IAM policy. + /// - storage.buckets.create — Create bucket. + /// - storage.buckets.list — List buckets. + /// - storage.buckets.setIamPolicy — Update bucket IAM policy. + /// - storage.buckets.update — Update bucket metadata. + /// - storage.objects.delete — Delete object. + /// - storage.objects.get — Read object data and metadata. + /// - storage.objects.getIamPolicy — Read object IAM policy. + /// - storage.objects.create — Create object. + /// - storage.objects.list — List objects. + /// - storage.objects.setIamPolicy — Update object IAM policy. + /// - storage.objects.update — Update object metadata. + pub permissions: Option>, +} + +impl ResponseResult for TestIamPermissionsResponse {} + + +/// The bucket's lifecycle configuration. See lifecycle management for more information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BucketLifecycle { + /// A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken. + pub rule: Option>, +} + +impl NestedType for BucketLifecycle {} +impl Part for BucketLifecycle {} /// A Compose request. @@ -1196,6 +1089,308 @@ pub struct Buckets { impl ResponseResult for Buckets {} +/// An 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*). +/// +/// * [get iam policy objects](struct.ObjectGetIamPolicyCall.html) (none) +/// * [list objects](struct.ObjectListCall.html) (none) +/// * [rewrite objects](struct.ObjectRewriteCall.html) (request) +/// * [test iam permissions objects](struct.ObjectTestIamPermissionCall.html) (none) +/// * [copy objects](struct.ObjectCopyCall.html) (request|response) +/// * [watch all objects](struct.ObjectWatchAllCall.html) (none) +/// * [get objects](struct.ObjectGetCall.html) (response) +/// * [set iam policy objects](struct.ObjectSetIamPolicyCall.html) (none) +/// * [insert objects](struct.ObjectInsertCall.html) (request|response) +/// * [compose objects](struct.ObjectComposeCall.html) (response) +/// * [update objects](struct.ObjectUpdateCall.html) (request|response) +/// * [delete objects](struct.ObjectDeleteCall.html) (none) +/// * [patch objects](struct.ObjectPatchCall.html) (request|response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Object { + /// The link to this object. + #[serde(rename="selfLink")] + pub self_link: Option, + /// The modification time of the object metadata in RFC 3339 format. + pub updated: Option, + /// Content-Type of the object data. If contentType is not specified, object downloads will be served as application/octet-stream. + #[serde(rename="contentType")] + pub content_type: Option, + /// The creation time of the object in RFC 3339 format. + #[serde(rename="timeCreated")] + pub time_created: Option, + /// The content generation of this object. Used for object versioning. + pub generation: Option, + /// Metadata of customer-supplied encryption key, if the object is encrypted by such a key. + #[serde(rename="customerEncryption")] + pub customer_encryption: Option, + /// Number of underlying components that make up this object. Components are accumulated by compose operations. + #[serde(rename="componentCount")] + pub component_count: Option, + /// The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated. + #[serde(rename="timeStorageClassUpdated")] + pub time_storage_class_updated: Option, + /// The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object. + pub metageneration: Option, + /// Media download link. + #[serde(rename="mediaLink")] + pub media_link: Option, + /// The owner of the object. This will always be the uploader of the object. + pub owner: Option, + /// Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600. + #[serde(rename="cacheControl")] + pub cache_control: Option, + /// Access controls on the object. + pub acl: Option>, + /// The ID of the object, including the bucket name, object name, and generation number. + pub id: Option, + /// Content-Length of the data in bytes. + pub size: Option, + /// The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted. + #[serde(rename="timeDeleted")] + pub time_deleted: Option, + /// The kind of item this is. For objects, this is always storage#object. + pub kind: Option, + /// Content-Language of the object data. + #[serde(rename="contentLanguage")] + pub content_language: Option, + /// The name of the object. Required if not specified by URL parameter. + pub name: Option, + /// MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices. + #[serde(rename="md5Hash")] + pub md5_hash: Option, + /// The name of the bucket containing this object. + pub bucket: Option, + /// Content-Encoding of the object data. + #[serde(rename="contentEncoding")] + pub content_encoding: Option, + /// CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices. + pub crc32c: Option, + /// HTTP 1.1 Entity tag for the object. + pub etag: Option, + /// Storage class of the object. + #[serde(rename="storageClass")] + pub storage_class: Option, + /// Content-Disposition of the object data. + #[serde(rename="contentDisposition")] + pub content_disposition: Option, + /// User-provided metadata, in key/value pairs. + pub metadata: Option>, +} + +impl RequestValue for Object {} +impl Resource for Object {} +impl ResponseResult for Object {} + + +/// The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BucketWebsite { + /// If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result. + #[serde(rename="notFoundPage")] + pub not_found_page: Option, + /// If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages. + #[serde(rename="mainPageSuffix")] + pub main_page_suffix: Option, +} + +impl NestedType for BucketWebsite {} +impl Part for BucketWebsite {} + + +/// The owner of the object. This will always be the uploader of the object. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ObjectOwner { + /// The ID for the entity. + #[serde(rename="entityId")] + pub entity_id: Option, + /// The entity, in the form user-userId. + pub entity: Option, +} + +impl NestedType for ObjectOwner {} +impl Part for ObjectOwner {} + + +/// The owner of the bucket. This is always the project team's owner 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 BucketOwner { + /// The ID for the entity. + #[serde(rename="entityId")] + pub entity_id: Option, + /// The entity, in the form project-owner-projectId. + pub entity: Option, +} + +impl NestedType for BucketOwner {} +impl Part for BucketOwner {} + + +/// A list of notification subscriptions. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 notifications](struct.NotificationListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Notifications { + /// The list of items. + pub items: Option>, + /// The kind of item this is. For lists of notifications, this is always storage#notifications. + pub kind: Option, +} + +impl ResponseResult for Notifications {} + + +/// A list of objects. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 objects](struct.ObjectListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Objects { + /// The continuation token, 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, + /// The list of items. + pub items: Option>, + /// The kind of item this is. For lists of objects, this is always storage#objects. + pub kind: Option, + /// The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter. + pub prefixes: Option>, +} + +impl ResponseResult for Objects {} + + +/// The bucket's billing 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 BucketBilling { + /// When set to true, bucket is requester pays. + #[serde(rename="requesterPays")] + pub requester_pays: Option, +} + +impl NestedType for BucketBilling {} +impl Part for BucketBilling {} + + +/// A subscription to receive Google PubSub notifications. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 notifications](struct.NotificationInsertCall.html) (request|response) +/// * [list notifications](struct.NotificationListCall.html) (none) +/// * [delete notifications](struct.NotificationDeleteCall.html) (none) +/// * [get notifications](struct.NotificationGetCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct Notification { + /// The kind of item this is. For notifications, this is always storage#notification. + pub kind: Option, + /// An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription. + pub custom_attributes: Option>, + /// The ID of the notification. + pub id: Option, + /// The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}' + pub topic: Option, + /// HTTP 1.1 Entity tag for this subscription notification. + pub etag: Option, + /// If present, only send notifications about listed event types. If empty, sent notifications for all event types. + pub event_types: Option>, + /// If present, only apply this notification configuration to object names that begin with this prefix. + pub object_name_prefix: Option, + /// The desired content of the Payload. + pub payload_format: Option, + /// The canonical URL of this notification. + #[serde(rename="selfLink")] + pub self_link: Option, +} + +impl RequestValue for Notification {} +impl Resource for Notification {} +impl ResponseResult for Notification {} + + +/// An access-control 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 object access controls](struct.ObjectAccessControlListCall.html) (response) +/// * [list default object access controls](struct.DefaultObjectAccessControlListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ObjectAccessControls { + /// The list of items. + pub items: Option>, + /// The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls. + pub kind: Option, +} + +impl ResponseResult for ObjectAccessControls {} + + +/// The project team associated with the entity, if any. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct BucketAccessControlProjectTeam { + /// The project number. + #[serde(rename="projectNumber")] + pub project_number: Option, + /// The team. + pub team: Option, +} + +impl NestedType for BucketAccessControlProjectTeam {} +impl Part for BucketAccessControlProjectTeam {} + + +/// The bucket's versioning 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 BucketVersioning { + /// While set to true, versioning is fully enabled for this bucket. + pub enabled: Option, +} + +impl NestedType for BucketVersioning {} +impl Part for BucketVersioning {} + + // ################### // MethodBuilders ### @@ -1252,27 +1447,7 @@ impl<'a, C, A> DefaultObjectAccessControlMethods<'a, C, A> { hub: self.hub, _request: request, _bucket: bucket.to_string(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Updates a default object ACL entry on the specified bucket. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `bucket` - Name of a bucket. - /// * `entity` - The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - pub fn update(&self, request: ObjectAccessControl, bucket: &str, entity: &str) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { - DefaultObjectAccessControlUpdateCall { - hub: self.hub, - _request: request, - _bucket: bucket.to_string(), - _entity: entity.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1290,6 +1465,7 @@ impl<'a, C, A> DefaultObjectAccessControlMethods<'a, C, A> { DefaultObjectAccessControlListCall { hub: self.hub, _bucket: bucket.to_string(), + _user_project: Default::default(), _if_metageneration_not_match: Default::default(), _if_metageneration_match: Default::default(), _delegate: Default::default(), @@ -1313,6 +1489,7 @@ impl<'a, C, A> DefaultObjectAccessControlMethods<'a, C, A> { _request: request, _bucket: bucket.to_string(), _entity: entity.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1332,6 +1509,29 @@ impl<'a, C, A> DefaultObjectAccessControlMethods<'a, C, A> { hub: self.hub, _bucket: bucket.to_string(), _entity: entity.to_string(), + _user_project: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates a default object ACL entry on the specified bucket. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `bucket` - Name of a bucket. + /// * `entity` - The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + pub fn update(&self, request: ObjectAccessControl, bucket: &str, entity: &str) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { + DefaultObjectAccessControlUpdateCall { + hub: self.hub, + _request: request, + _bucket: bucket.to_string(), + _entity: entity.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1351,6 +1551,7 @@ impl<'a, C, A> DefaultObjectAccessControlMethods<'a, C, A> { hub: self.hub, _bucket: bucket.to_string(), _entity: entity.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1413,6 +1614,7 @@ impl<'a, C, A> BucketAccessControlMethods<'a, C, A> { _request: request, _bucket: bucket.to_string(), _entity: entity.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1432,6 +1634,7 @@ impl<'a, C, A> BucketAccessControlMethods<'a, C, A> { hub: self.hub, _bucket: bucket.to_string(), _entity: entity.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1451,6 +1654,7 @@ impl<'a, C, A> BucketAccessControlMethods<'a, C, A> { hub: self.hub, _request: request, _bucket: bucket.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1470,6 +1674,7 @@ impl<'a, C, A> BucketAccessControlMethods<'a, C, A> { hub: self.hub, _bucket: bucket.to_string(), _entity: entity.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1491,6 +1696,7 @@ impl<'a, C, A> BucketAccessControlMethods<'a, C, A> { _request: request, _bucket: bucket.to_string(), _entity: entity.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1508,6 +1714,7 @@ impl<'a, C, A> BucketAccessControlMethods<'a, C, A> { BucketAccessControlListCall { hub: self.hub, _bucket: bucket.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -1575,6 +1782,125 @@ impl<'a, C, A> ChannelMethods<'a, C, A> { +/// A builder providing access to all methods supported on *notification* resources. +/// It is not used directly, but through the `Storage` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_storage1 as storage1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use storage1::Storage; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Storage::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `delete(...)`, `get(...)`, `insert(...)` and `list(...)` +/// // to build up your call. +/// let rb = hub.notifications(); +/// # } +/// ``` +pub struct NotificationMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, +} + +impl<'a, C, A> MethodsBuilder for NotificationMethods<'a, C, A> {} + +impl<'a, C, A> NotificationMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Creates a notification subscription for a given bucket. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `bucket` - The parent bucket of the notification. + pub fn insert(&self, request: Notification, bucket: &str) -> NotificationInsertCall<'a, C, A> { + NotificationInsertCall { + hub: self.hub, + _request: request, + _bucket: bucket.to_string(), + _user_project: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Permanently deletes a notification subscription. + /// + /// # Arguments + /// + /// * `bucket` - The parent bucket of the notification. + /// * `notification` - ID of the notification to delete. + pub fn delete(&self, bucket: &str, notification: &str) -> NotificationDeleteCall<'a, C, A> { + NotificationDeleteCall { + hub: self.hub, + _bucket: bucket.to_string(), + _notification: notification.to_string(), + _user_project: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// View a notification configuration. + /// + /// # Arguments + /// + /// * `bucket` - The parent bucket of the notification. + /// * `notification` - Notification ID + pub fn get(&self, bucket: &str, notification: &str) -> NotificationGetCall<'a, C, A> { + NotificationGetCall { + hub: self.hub, + _bucket: bucket.to_string(), + _notification: notification.to_string(), + _user_project: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Retrieves a list of notification subscriptions for a given bucket. + /// + /// # Arguments + /// + /// * `bucket` - Name of a GCS bucket. + pub fn list(&self, bucket: &str) -> NotificationListCall<'a, C, A> { + NotificationListCall { + hub: self.hub, + _bucket: bucket.to_string(), + _user_project: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *object* resources. /// It is not used directly, but through the `Storage` hub. /// @@ -1598,7 +1924,7 @@ impl<'a, C, A> ChannelMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Storage::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `compose(...)`, `copy(...)`, `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)`, `rewrite(...)`, `update(...)` and `watch_all(...)` +/// // like `compose(...)`, `copy(...)`, `delete(...)`, `get(...)`, `get_iam_policy(...)`, `insert(...)`, `list(...)`, `patch(...)`, `rewrite(...)`, `set_iam_policy(...)`, `test_iam_permissions(...)`, `update(...)` and `watch_all(...)` /// // to build up your call. /// let rb = hub.objects(); /// # } @@ -1632,6 +1958,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _source_object: source_object.to_string(), _destination_bucket: destination_bucket.to_string(), _destination_object: destination_object.to_string(), + _user_project: Default::default(), _source_generation: Default::default(), _rewrite_token: Default::default(), _projection: Default::default(), @@ -1664,6 +1991,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { hub: self.hub, _bucket: bucket.to_string(), _object: object.to_string(), + _user_project: Default::default(), _projection: Default::default(), _if_metageneration_not_match: Default::default(), _if_metageneration_match: Default::default(), @@ -1676,34 +2004,6 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { } } - /// Create a builder to help you perform the following task: - /// - /// Updates an object's metadata. - /// - /// # Arguments - /// - /// * `request` - No description provided. - /// * `bucket` - Name of the bucket in which the object resides. - /// * `object` - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - pub fn update(&self, request: Object, bucket: &str, object: &str) -> ObjectUpdateCall<'a, C, A> { - ObjectUpdateCall { - hub: self.hub, - _request: request, - _bucket: bucket.to_string(), - _object: object.to_string(), - _projection: Default::default(), - _predefined_acl: Default::default(), - _if_metageneration_not_match: Default::default(), - _if_metageneration_match: Default::default(), - _if_generation_not_match: Default::default(), - _if_generation_match: Default::default(), - _generation: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - /// Create a builder to help you perform the following task: /// /// Watch for changes on all objects in a bucket. @@ -1718,6 +2018,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _request: request, _bucket: bucket.to_string(), _versions: Default::default(), + _user_project: Default::default(), _projection: Default::default(), _prefix: Default::default(), _page_token: Default::default(), @@ -1729,6 +2030,79 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Updates an IAM policy for the specified object. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `bucket` - Name of the bucket in which the object resides. + /// * `object` - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + pub fn set_iam_policy(&self, request: Policy, bucket: &str, object: &str) -> ObjectSetIamPolicyCall<'a, C, A> { + ObjectSetIamPolicyCall { + hub: self.hub, + _request: request, + _bucket: bucket.to_string(), + _object: object.to_string(), + _user_project: Default::default(), + _generation: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns an IAM policy for the specified object. + /// + /// # Arguments + /// + /// * `bucket` - Name of the bucket in which the object resides. + /// * `object` - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + pub fn get_iam_policy(&self, bucket: &str, object: &str) -> ObjectGetIamPolicyCall<'a, C, A> { + ObjectGetIamPolicyCall { + hub: self.hub, + _bucket: bucket.to_string(), + _object: object.to_string(), + _user_project: Default::default(), + _generation: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an object's metadata. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `bucket` - Name of the bucket in which the object resides. + /// * `object` - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + pub fn update(&self, request: Object, bucket: &str, object: &str) -> ObjectUpdateCall<'a, C, A> { + ObjectUpdateCall { + hub: self.hub, + _request: request, + _bucket: bucket.to_string(), + _object: object.to_string(), + _user_project: Default::default(), + _projection: Default::default(), + _predefined_acl: Default::default(), + _if_metageneration_not_match: Default::default(), + _if_metageneration_match: Default::default(), + _if_generation_not_match: Default::default(), + _if_generation_match: Default::default(), + _generation: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Stores a new object and metadata. @@ -1742,6 +2116,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { hub: self.hub, _request: request, _bucket: bucket.to_string(), + _user_project: Default::default(), _projection: Default::default(), _predefined_acl: Default::default(), _name: Default::default(), @@ -1771,6 +2146,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _request: request, _destination_bucket: destination_bucket.to_string(), _destination_object: destination_object.to_string(), + _user_project: Default::default(), _if_metageneration_match: Default::default(), _if_generation_match: Default::default(), _destination_predefined_acl: Default::default(), @@ -1793,6 +2169,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { hub: self.hub, _bucket: bucket.to_string(), _object: object.to_string(), + _user_project: Default::default(), _if_metageneration_not_match: Default::default(), _if_metageneration_match: Default::default(), _if_generation_not_match: Default::default(), @@ -1816,6 +2193,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { hub: self.hub, _bucket: bucket.to_string(), _versions: Default::default(), + _user_project: Default::default(), _projection: Default::default(), _prefix: Default::default(), _page_token: Default::default(), @@ -1827,6 +2205,29 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Tests a set of permissions on the given object to see which, if any, are held by the caller. + /// + /// # Arguments + /// + /// * `bucket` - Name of the bucket in which the object resides. + /// * `object` - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + /// * `permissions` - Permissions to test. + pub fn test_iam_permissions(&self, bucket: &str, object: &str, permissions: &Vec) -> ObjectTestIamPermissionCall<'a, C, A> { + ObjectTestIamPermissionCall { + hub: self.hub, + _bucket: bucket.to_string(), + _object: object.to_string(), + _permissions: permissions.clone(), + _user_project: Default::default(), + _generation: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Copies a source object to a destination object. Optionally overrides metadata. @@ -1846,6 +2247,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _source_object: source_object.to_string(), _destination_bucket: destination_bucket.to_string(), _destination_object: destination_object.to_string(), + _user_project: Default::default(), _source_generation: Default::default(), _projection: Default::default(), _if_source_metageneration_not_match: Default::default(), @@ -1878,6 +2280,7 @@ impl<'a, C, A> ObjectMethods<'a, C, A> { _request: request, _bucket: bucket.to_string(), _object: object.to_string(), + _user_project: Default::default(), _projection: Default::default(), _predefined_acl: Default::default(), _if_metageneration_not_match: Default::default(), @@ -1934,19 +2337,20 @@ impl<'a, C, A> ObjectAccessControlMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Creates a new ACL entry on the specified object. + /// Returns the ACL entry for the specified entity on the specified object. /// /// # Arguments /// - /// * `request` - No description provided. /// * `bucket` - Name of a bucket. /// * `object` - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - pub fn insert(&self, request: ObjectAccessControl, bucket: &str, object: &str) -> ObjectAccessControlInsertCall<'a, C, A> { - ObjectAccessControlInsertCall { + /// * `entity` - The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + pub fn get(&self, bucket: &str, object: &str, entity: &str) -> ObjectAccessControlGetCall<'a, C, A> { + ObjectAccessControlGetCall { hub: self.hub, - _request: request, _bucket: bucket.to_string(), _object: object.to_string(), + _entity: entity.to_string(), + _user_project: Default::default(), _generation: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1971,6 +2375,7 @@ impl<'a, C, A> ObjectAccessControlMethods<'a, C, A> { _bucket: bucket.to_string(), _object: object.to_string(), _entity: entity.to_string(), + _user_project: Default::default(), _generation: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -1991,6 +2396,7 @@ impl<'a, C, A> ObjectAccessControlMethods<'a, C, A> { hub: self.hub, _bucket: bucket.to_string(), _object: object.to_string(), + _user_project: Default::default(), _generation: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2013,28 +2419,7 @@ impl<'a, C, A> ObjectAccessControlMethods<'a, C, A> { _bucket: bucket.to_string(), _object: object.to_string(), _entity: entity.to_string(), - _generation: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } - - /// Create a builder to help you perform the following task: - /// - /// Returns the ACL entry for the specified entity on the specified object. - /// - /// # Arguments - /// - /// * `bucket` - Name of a bucket. - /// * `object` - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - /// * `entity` - The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - pub fn get(&self, bucket: &str, object: &str, entity: &str) -> ObjectAccessControlGetCall<'a, C, A> { - ObjectAccessControlGetCall { - hub: self.hub, - _bucket: bucket.to_string(), - _object: object.to_string(), - _entity: entity.to_string(), + _user_project: Default::default(), _generation: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2059,6 +2444,30 @@ impl<'a, C, A> ObjectAccessControlMethods<'a, C, A> { _bucket: bucket.to_string(), _object: object.to_string(), _entity: entity.to_string(), + _user_project: Default::default(), + _generation: 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 ACL entry on the specified object. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `bucket` - Name of a bucket. + /// * `object` - Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + pub fn insert(&self, request: ObjectAccessControl, bucket: &str, object: &str) -> ObjectAccessControlInsertCall<'a, C, A> { + ObjectAccessControlInsertCall { + hub: self.hub, + _request: request, + _bucket: bucket.to_string(), + _object: object.to_string(), + _user_project: Default::default(), _generation: Default::default(), _delegate: Default::default(), _scopes: Default::default(), @@ -2092,7 +2501,7 @@ impl<'a, C, A> ObjectAccessControlMethods<'a, C, A> { /// ::default(), None); /// let mut hub = Storage::new(hyper::Client::new(), auth); /// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `delete(...)`, `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)` +/// // like `delete(...)`, `get(...)`, `get_iam_policy(...)`, `insert(...)`, `list(...)`, `patch(...)`, `set_iam_policy(...)`, `test_iam_permissions(...)` and `update(...)` /// // to build up your call. /// let rb = hub.buckets(); /// # } @@ -2107,6 +2516,31 @@ impl<'a, C, A> MethodsBuilder for BucketMethods<'a, C, A> {} impl<'a, C, A> BucketMethods<'a, C, A> { + /// Create a builder to help you perform the following task: + /// + /// Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. This method supports patch semantics. + /// + /// # Arguments + /// + /// * `request` - No description provided. + /// * `bucket` - Name of a bucket. + pub fn patch(&self, request: Bucket, bucket: &str) -> BucketPatchCall<'a, C, A> { + BucketPatchCall { + hub: self.hub, + _request: request, + _bucket: bucket.to_string(), + _user_project: Default::default(), + _projection: Default::default(), + _predefined_default_object_acl: Default::default(), + _predefined_acl: Default::default(), + _if_metageneration_not_match: Default::default(), + _if_metageneration_match: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. @@ -2120,6 +2554,7 @@ impl<'a, C, A> BucketMethods<'a, C, A> { hub: self.hub, _request: request, _bucket: bucket.to_string(), + _user_project: Default::default(), _projection: Default::default(), _predefined_default_object_acl: Default::default(), _predefined_acl: Default::default(), @@ -2142,6 +2577,7 @@ impl<'a, C, A> BucketMethods<'a, C, A> { BucketGetCall { hub: self.hub, _bucket: bucket.to_string(), + _user_project: Default::default(), _projection: Default::default(), _if_metageneration_not_match: Default::default(), _if_metageneration_match: Default::default(), @@ -2162,6 +2598,7 @@ impl<'a, C, A> BucketMethods<'a, C, A> { BucketDeleteCall { hub: self.hub, _bucket: bucket.to_string(), + _user_project: Default::default(), _if_metageneration_not_match: Default::default(), _if_metageneration_match: Default::default(), _delegate: Default::default(), @@ -2194,22 +2631,56 @@ impl<'a, C, A> BucketMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. This method supports patch semantics. + /// Tests a set of permissions on the given bucket to see which, if any, are held by the caller. + /// + /// # Arguments + /// + /// * `bucket` - Name of a bucket. + /// * `permissions` - Permissions to test. + pub fn test_iam_permissions(&self, bucket: &str, permissions: &Vec) -> BucketTestIamPermissionCall<'a, C, A> { + BucketTestIamPermissionCall { + hub: self.hub, + _bucket: bucket.to_string(), + _permissions: permissions.clone(), + _user_project: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Updates an IAM policy for the specified bucket. /// /// # Arguments /// /// * `request` - No description provided. /// * `bucket` - Name of a bucket. - pub fn patch(&self, request: Bucket, bucket: &str) -> BucketPatchCall<'a, C, A> { - BucketPatchCall { + pub fn set_iam_policy(&self, request: Policy, bucket: &str) -> BucketSetIamPolicyCall<'a, C, A> { + BucketSetIamPolicyCall { hub: self.hub, _request: request, _bucket: bucket.to_string(), - _projection: Default::default(), - _predefined_default_object_acl: Default::default(), - _predefined_acl: Default::default(), - _if_metageneration_not_match: Default::default(), - _if_metageneration_match: Default::default(), + _user_project: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + + /// Create a builder to help you perform the following task: + /// + /// Returns an IAM policy for the specified bucket. + /// + /// # Arguments + /// + /// * `bucket` - Name of a bucket. + pub fn get_iam_policy(&self, bucket: &str) -> BucketGetIamPolicyCall<'a, C, A> { + BucketGetIamPolicyCall { + hub: self.hub, + _bucket: bucket.to_string(), + _user_project: Default::default(), _delegate: Default::default(), _scopes: Default::default(), _additional_params: Default::default(), @@ -2240,6 +2711,64 @@ impl<'a, C, A> BucketMethods<'a, C, A> { +/// A builder providing access to all methods supported on *project* resources. +/// It is not used directly, but through the `Storage` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_storage1 as storage1; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use storage1::Storage; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = Storage::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `service_account_get(...)` +/// // to build up your call. +/// let rb = hub.projects(); +/// # } +/// ``` +pub struct ProjectMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, +} + +impl<'a, C, A> MethodsBuilder for ProjectMethods<'a, C, A> {} + +impl<'a, C, A> ProjectMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Get the email address of this project's GCS service account. + /// + /// # Arguments + /// + /// * `projectId` - Project ID + pub fn service_account_get(&self, project_id: &str) -> ProjectServiceAccountGetCall<'a, C, A> { + ProjectServiceAccountGetCall { + hub: self.hub, + _project_id: project_id.to_string(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + // ################### @@ -2279,6 +2808,7 @@ impl<'a, C, A> BucketMethods<'a, C, A> { /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.default_object_access_controls().insert(req, "bucket") +/// .user_project("amet") /// .doit(); /// # } /// ``` @@ -2288,6 +2818,7 @@ pub struct DefaultObjectAccessControlInsertCall<'a, C, A> hub: &'a Storage, _request: ObjectAccessControl, _bucket: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -2309,9 +2840,12 @@ impl<'a, C, A> DefaultObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut }; dlg.begin(MethodInfo { id: "storage.defaultObjectAccessControls.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(("bucket", self._bucket.to_string())); - for &field in ["alt", "bucket"].iter() { + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2323,7 +2857,7 @@ impl<'a, C, A> DefaultObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "b/{bucket}/defaultObjectAcl"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/defaultObjectAcl".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -2460,6 +2994,13 @@ impl<'a, C, A> DefaultObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut self._bucket = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> DefaultObjectAccessControlInsertCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -2512,284 +3053,6 @@ impl<'a, C, A> DefaultObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut } -/// Updates a default object ACL entry on the specified bucket. -/// -/// A builder for the *update* method supported by a *defaultObjectAccessControl* resource. -/// It is not used directly, but through a `DefaultObjectAccessControlMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_storage1 as storage1; -/// use storage1::ObjectAccessControl; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use storage1::Storage; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Storage::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = ObjectAccessControl::default(); -/// -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.default_object_access_controls().update(req, "bucket", "entity") -/// .doit(); -/// # } -/// ``` -pub struct DefaultObjectAccessControlUpdateCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Storage, - _request: ObjectAccessControl, - _bucket: String, - _entity: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for DefaultObjectAccessControlUpdateCall<'a, C, A> {} - -impl<'a, C, A> DefaultObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ObjectAccessControl)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "storage.defaultObjectAccessControls.update", - http_method: hyper::method::Method::Put }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); - params.push(("bucket", self._bucket.to_string())); - params.push(("entity", self._entity.to_string())); - for &field in ["alt", "bucket", "entity"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "b/{bucket}/defaultObjectAcl/{entity}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{bucket}", "bucket"), ("{entity}", "entity")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["entity", "bucket"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).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: ObjectAccessControl) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { - self._request = new_value; - self - } - /// Name of a bucket. - /// - /// Sets the *bucket* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn bucket(mut self, new_value: &str) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { - self._bucket = new_value.to_string(); - self - } - /// The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - /// - /// Sets the *entity* path property to 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(mut self, new_value: &str) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { - self._entity = new_value.to_string(); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> DefaultObjectAccessControlUpdateCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> DefaultObjectAccessControlUpdateCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Retrieves default object ACL entries on the specified bucket. /// /// A builder for the *list* method supported by a *defaultObjectAccessControl* resource. @@ -2817,8 +3080,9 @@ impl<'a, C, A> DefaultObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.default_object_access_controls().list("bucket") -/// .if_metageneration_not_match("amet") -/// .if_metageneration_match("et") +/// .user_project("consetetur") +/// .if_metageneration_not_match("ut") +/// .if_metageneration_match("ea") /// .doit(); /// # } /// ``` @@ -2827,6 +3091,7 @@ pub struct DefaultObjectAccessControlListCall<'a, C, A> hub: &'a Storage, _bucket: String, + _user_project: Option, _if_metageneration_not_match: Option, _if_metageneration_match: Option, _delegate: Option<&'a mut Delegate>, @@ -2850,15 +3115,18 @@ impl<'a, C, A> DefaultObjectAccessControlListCall<'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(("bucket", self._bucket.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._if_metageneration_not_match { params.push(("ifMetagenerationNotMatch", value.to_string())); } if let Some(value) = self._if_metageneration_match { params.push(("ifMetagenerationMatch", value.to_string())); } - for &field in ["alt", "bucket", "ifMetagenerationNotMatch", "ifMetagenerationMatch"].iter() { + for &field in ["alt", "bucket", "userProject", "ifMetagenerationNotMatch", "ifMetagenerationMatch"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -2870,7 +3138,7 @@ impl<'a, C, A> DefaultObjectAccessControlListCall<'a, C, A> where C: BorrowMut DefaultObjectAccessControlListCall<'a, C, A> where C: BorrowMut DefaultObjectAccessControlListCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// If present, only return default ACL listing if the bucket's current metageneration does not match the given value. /// /// Sets the *if metageneration not match* query property to the given value. @@ -3082,6 +3357,7 @@ impl<'a, C, A> DefaultObjectAccessControlListCall<'a, C, A> where C: BorrowMut _request: ObjectAccessControl, _bucket: String, _entity: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3113,10 +3390,13 @@ impl<'a, C, A> DefaultObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut< }; dlg.begin(MethodInfo { id: "storage.defaultObjectAccessControls.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(("bucket", self._bucket.to_string())); params.push(("entity", self._entity.to_string())); - for &field in ["alt", "bucket", "entity"].iter() { + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "entity", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3128,7 +3408,7 @@ impl<'a, C, A> DefaultObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "b/{bucket}/defaultObjectAcl/{entity}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/defaultObjectAcl/{entity}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3275,6 +3555,13 @@ impl<'a, C, A> DefaultObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut< self._entity = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> DefaultObjectAccessControlPatchCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -3354,6 +3641,7 @@ impl<'a, C, A> DefaultObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut< /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.default_object_access_controls().delete("bucket", "entity") +/// .user_project("consetetur") /// .doit(); /// # } /// ``` @@ -3363,6 +3651,7 @@ pub struct DefaultObjectAccessControlDeleteCall<'a, C, A> hub: &'a Storage, _bucket: String, _entity: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3384,10 +3673,13 @@ impl<'a, C, A> DefaultObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut }; dlg.begin(MethodInfo { id: "storage.defaultObjectAccessControls.delete", http_method: hyper::method::Method::Delete }); - 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(("bucket", self._bucket.to_string())); params.push(("entity", self._entity.to_string())); - for &field in ["bucket", "entity"].iter() { + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["bucket", "entity", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3398,7 +3690,7 @@ impl<'a, C, A> DefaultObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "b/{bucket}/defaultObjectAcl/{entity}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/defaultObjectAcl/{entity}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3511,6 +3803,13 @@ impl<'a, C, A> DefaultObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut self._entity = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> DefaultObjectAccessControlDeleteCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -3563,6 +3862,296 @@ impl<'a, C, A> DefaultObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut } +/// Updates a default object ACL entry on the specified bucket. +/// +/// A builder for the *update* method supported by a *defaultObjectAccessControl* resource. +/// It is not used directly, but through a `DefaultObjectAccessControlMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// use storage1::ObjectAccessControl; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ObjectAccessControl::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.default_object_access_controls().update(req, "bucket", "entity") +/// .user_project("Lorem") +/// .doit(); +/// # } +/// ``` +pub struct DefaultObjectAccessControlUpdateCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _request: ObjectAccessControl, + _bucket: String, + _entity: String, + _user_project: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for DefaultObjectAccessControlUpdateCall<'a, C, A> {} + +impl<'a, C, A> DefaultObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ObjectAccessControl)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.defaultObjectAccessControls.update", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("bucket", self._bucket.to_string())); + params.push(("entity", self._entity.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "entity", "userProject"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/defaultObjectAcl/{entity}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket"), ("{entity}", "entity")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["entity", "bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: ObjectAccessControl) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of a bucket. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + /// + /// Sets the *entity* path property to 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(mut self, new_value: &str) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { + self._entity = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> DefaultObjectAccessControlUpdateCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> DefaultObjectAccessControlUpdateCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> DefaultObjectAccessControlUpdateCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Returns the default object ACL entry for the specified entity on the specified bucket. /// /// A builder for the *get* method supported by a *defaultObjectAccessControl* resource. @@ -3590,6 +4179,7 @@ impl<'a, C, A> DefaultObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.default_object_access_controls().get("bucket", "entity") +/// .user_project("sit") /// .doit(); /// # } /// ``` @@ -3599,6 +4189,7 @@ pub struct DefaultObjectAccessControlGetCall<'a, C, A> hub: &'a Storage, _bucket: String, _entity: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3620,10 +4211,13 @@ impl<'a, C, A> DefaultObjectAccessControlGetCall<'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(("bucket", self._bucket.to_string())); params.push(("entity", self._entity.to_string())); - for &field in ["alt", "bucket", "entity"].iter() { + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "entity", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3635,7 +4229,7 @@ impl<'a, C, A> DefaultObjectAccessControlGetCall<'a, C, A> where C: BorrowMut DefaultObjectAccessControlGetCall<'a, C, A> where C: BorrowMut DefaultObjectAccessControlGetCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -3843,6 +4444,7 @@ impl<'a, C, A> DefaultObjectAccessControlGetCall<'a, C, A> where C: BorrowMut _request: BucketAccessControl, _bucket: String, _entity: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -3874,10 +4477,13 @@ impl<'a, C, A> BucketAccessControlPatchCall<'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(("bucket", self._bucket.to_string())); params.push(("entity", self._entity.to_string())); - for &field in ["alt", "bucket", "entity"].iter() { + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "entity", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -3889,7 +4495,7 @@ impl<'a, C, A> BucketAccessControlPatchCall<'a, C, A> where C: BorrowMut BucketAccessControlPatchCall<'a, C, A> where C: BorrowMut BucketAccessControlPatchCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4115,6 +4728,7 @@ impl<'a, C, A> BucketAccessControlPatchCall<'a, C, A> where C: BorrowMut hub: &'a Storage, _bucket: String, _entity: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4145,10 +4760,13 @@ impl<'a, C, A> BucketAccessControlDeleteCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((3 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("bucket", self._bucket.to_string())); params.push(("entity", self._entity.to_string())); - for &field in ["bucket", "entity"].iter() { + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["bucket", "entity", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4159,7 +4777,7 @@ impl<'a, C, A> BucketAccessControlDeleteCall<'a, C, A> where C: BorrowMut BucketAccessControlDeleteCall<'a, C, A> where C: BorrowMut BucketAccessControlDeleteCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4357,6 +4982,7 @@ impl<'a, C, A> BucketAccessControlDeleteCall<'a, C, A> where C: BorrowMut hub: &'a Storage, _request: BucketAccessControl, _bucket: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4387,9 +5014,12 @@ impl<'a, C, A> BucketAccessControlInsertCall<'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(("bucket", self._bucket.to_string())); - for &field in ["alt", "bucket"].iter() { + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4401,7 +5031,7 @@ impl<'a, C, A> BucketAccessControlInsertCall<'a, C, A> where C: BorrowMut BucketAccessControlInsertCall<'a, C, A> where C: BorrowMut BucketAccessControlInsertCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4617,6 +5254,7 @@ impl<'a, C, A> BucketAccessControlInsertCall<'a, C, A> where C: BorrowMut hub: &'a Storage, _bucket: String, _entity: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4647,10 +5286,13 @@ impl<'a, C, A> BucketAccessControlGetCall<'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(("bucket", self._bucket.to_string())); params.push(("entity", self._entity.to_string())); - for &field in ["alt", "bucket", "entity"].iter() { + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "entity", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4662,7 +5304,7 @@ impl<'a, C, A> BucketAccessControlGetCall<'a, C, A> where C: BorrowMut BucketAccessControlGetCall<'a, C, A> where C: BorrowMut BucketAccessControlGetCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -4870,6 +5519,7 @@ impl<'a, C, A> BucketAccessControlGetCall<'a, C, A> where C: BorrowMut _request: BucketAccessControl, _bucket: String, _entity: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -4901,10 +5552,13 @@ impl<'a, C, A> BucketAccessControlUpdateCall<'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(("bucket", self._bucket.to_string())); params.push(("entity", self._entity.to_string())); - for &field in ["alt", "bucket", "entity"].iter() { + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "entity", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -4916,7 +5570,7 @@ impl<'a, C, A> BucketAccessControlUpdateCall<'a, C, A> where C: BorrowMut BucketAccessControlUpdateCall<'a, C, A> where C: BorrowMut BucketAccessControlUpdateCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -5142,6 +5803,7 @@ impl<'a, C, A> BucketAccessControlUpdateCall<'a, C, A> where C: BorrowMut hub: &'a Storage, _bucket: String, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap @@ -5171,9 +5834,12 @@ impl<'a, C, A> BucketAccessControlListCall<'a, C, A> where C: BorrowMut = Vec::with_capacity((3 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); params.push(("bucket", self._bucket.to_string())); - for &field in ["alt", "bucket"].iter() { + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -5185,7 +5851,7 @@ impl<'a, C, A> BucketAccessControlListCall<'a, C, A> where C: BorrowMut BucketAccessControlListCall<'a, C, A> where C: BorrowMut BucketAccessControlListCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong /// while executing the actual API request. /// @@ -5424,7 +6097,7 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "channels/stop"; + let mut url = "https://www.googleapis.com/storage/v1/channels/stop".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5572,6 +6245,1038 @@ impl<'a, C, A> ChannelStopCall<'a, C, A> where C: BorrowMut, A: o } +/// Creates a notification subscription for a given bucket. +/// +/// A builder for the *insert* method supported by a *notification* resource. +/// It is not used directly, but through a `NotificationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// use storage1::Notification; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Notification::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.notifications().insert(req, "bucket") +/// .user_project("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct NotificationInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _request: Notification, + _bucket: String, + _user_project: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NotificationInsertCall<'a, C, A> {} + +impl<'a, C, A> NotificationInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Notification)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.notifications.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("bucket", self._bucket.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "userProject"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/notificationConfigs".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: Notification) -> NotificationInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// The parent bucket of the notification. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> NotificationInsertCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> NotificationInsertCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> NotificationInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> NotificationInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NotificationInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Permanently deletes a notification subscription. +/// +/// A builder for the *delete* method supported by a *notification* resource. +/// It is not used directly, but through a `NotificationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.notifications().delete("bucket", "notification") +/// .user_project("takimata") +/// .doit(); +/// # } +/// ``` +pub struct NotificationDeleteCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _bucket: String, + _notification: String, + _user_project: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NotificationDeleteCall<'a, C, A> {} + +impl<'a, C, A> NotificationDeleteCall<'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: "storage.notifications.delete", + http_method: hyper::method::Method::Delete }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("bucket", self._bucket.to_string())); + params.push(("notification", self._notification.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["bucket", "notification", "userProject"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/notificationConfigs/{notification}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket"), ("{notification}", "notification")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["notification", "bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_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 parent bucket of the notification. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> NotificationDeleteCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// ID of the notification to delete. + /// + /// Sets the *notification* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn notification(mut self, new_value: &str) -> NotificationDeleteCall<'a, C, A> { + self._notification = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> NotificationDeleteCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> NotificationDeleteCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> NotificationDeleteCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NotificationDeleteCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// View a notification configuration. +/// +/// A builder for the *get* method supported by a *notification* resource. +/// It is not used directly, but through a `NotificationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.notifications().get("bucket", "notification") +/// .user_project("invidunt") +/// .doit(); +/// # } +/// ``` +pub struct NotificationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _bucket: String, + _notification: String, + _user_project: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NotificationGetCall<'a, C, A> {} + +impl<'a, C, A> NotificationGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Notification)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.notifications.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("bucket", self._bucket.to_string())); + params.push(("notification", self._notification.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "notification", "userProject"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/notificationConfigs/{notification}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket"), ("{notification}", "notification")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["notification", "bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 bucket of the notification. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> NotificationGetCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// Notification ID + /// + /// Sets the *notification* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn notification(mut self, new_value: &str) -> NotificationGetCall<'a, C, A> { + self._notification = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> NotificationGetCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> NotificationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> NotificationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NotificationGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Retrieves a list of notification subscriptions for a given bucket. +/// +/// A builder for the *list* method supported by a *notification* resource. +/// It is not used directly, but through a `NotificationMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.notifications().list("bucket") +/// .user_project("sadipscing") +/// .doit(); +/// # } +/// ``` +pub struct NotificationListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _bucket: String, + _user_project: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for NotificationListCall<'a, C, A> {} + +impl<'a, C, A> NotificationListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Notifications)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.notifications.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("bucket", self._bucket.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "userProject"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/notificationConfigs".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 a GCS bucket. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> NotificationListCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> NotificationListCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> NotificationListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> NotificationListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> NotificationListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Rewrites a source object to a destination object. Optionally overrides metadata. /// /// A builder for the *rewrite* method supported by a *object* resource. @@ -5605,19 +7310,20 @@ 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.objects().rewrite(req, "sourceBucket", "sourceObject", "destinationBucket", "destinationObject") -/// .source_generation("vero") -/// .rewrite_token("sadipscing") -/// .projection("invidunt") -/// .max_bytes_rewritten_per_call("consetetur") -/// .if_source_metageneration_not_match("dolore") -/// .if_source_metageneration_match("duo") -/// .if_source_generation_not_match("aliquyam") -/// .if_source_generation_match("Lorem") -/// .if_metageneration_not_match("et") -/// .if_metageneration_match("clita") -/// .if_generation_not_match("consetetur") -/// .if_generation_match("takimata") -/// .destination_predefined_acl("nonumy") +/// .user_project("aliquyam") +/// .source_generation("sit") +/// .rewrite_token("eirmod") +/// .projection("consetetur") +/// .max_bytes_rewritten_per_call("labore") +/// .if_source_metageneration_not_match("sed") +/// .if_source_metageneration_match("ea") +/// .if_source_generation_not_match("gubergren") +/// .if_source_generation_match("aliquyam") +/// .if_metageneration_not_match("eos") +/// .if_metageneration_match("tempor") +/// .if_generation_not_match("sea") +/// .if_generation_match("labore") +/// .destination_predefined_acl("ipsum") /// .doit(); /// # } /// ``` @@ -5630,6 +7336,7 @@ pub struct ObjectRewriteCall<'a, C, A> _source_object: String, _destination_bucket: String, _destination_object: String, + _user_project: Option, _source_generation: Option, _rewrite_token: Option, _projection: Option, @@ -5664,11 +7371,14 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "storage.objects.rewrite", http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((20 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((21 + 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())); params.push(("destinationObject", self._destination_object.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._source_generation { params.push(("sourceGeneration", value.to_string())); } @@ -5708,7 +7418,7 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._destination_predefined_acl { params.push(("destinationPredefinedAcl", value.to_string())); } - for &field in ["alt", "sourceBucket", "sourceObject", "destinationBucket", "destinationObject", "sourceGeneration", "rewriteToken", "projection", "maxBytesRewrittenPerCall", "ifSourceMetagenerationNotMatch", "ifSourceMetagenerationMatch", "ifSourceGenerationNotMatch", "ifSourceGenerationMatch", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { + for &field in ["alt", "sourceBucket", "sourceObject", "destinationBucket", "destinationObject", "userProject", "sourceGeneration", "rewriteToken", "projection", "maxBytesRewrittenPerCall", "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)); @@ -5720,7 +7430,7 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -5887,6 +7597,13 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: self._destination_object = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectRewriteCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// If present, selects a specific revision of the source object (as opposed to the latest version, the default). /// /// Sets the *source generation* query property to the given value. @@ -6062,12 +7779,13 @@ impl<'a, C, A> ObjectRewriteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().get("bucket", "object") -/// .projection("takimata") -/// .if_metageneration_not_match("At") -/// .if_metageneration_match("labore") -/// .if_generation_not_match("invidunt") -/// .if_generation_match("ea") -/// .generation("sadipscing") +/// .user_project("sit") +/// .projection("diam") +/// .if_metageneration_not_match("ut") +/// .if_metageneration_match("justo") +/// .if_generation_not_match("est") +/// .if_generation_match("amet") +/// .generation("accusam") /// .doit(); /// # } /// ``` @@ -6077,6 +7795,7 @@ pub struct ObjectGetCall<'a, C, A> hub: &'a Storage, _bucket: String, _object: String, + _user_project: Option, _projection: Option, _if_metageneration_not_match: Option, _if_metageneration_match: Option, @@ -6104,9 +7823,12 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "storage.objects.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + 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 { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._projection { params.push(("projection", value.to_string())); } @@ -6125,7 +7847,7 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau if let Some(value) = self._generation { params.push(("generation", value.to_string())); } - for &field in ["bucket", "object", "projection", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "generation"].iter() { + for &field in ["bucket", "object", "userProject", "projection", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "generation"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -6153,7 +7875,7 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "b/{bucket}/o/{object}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6276,6 +7998,13 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau self._object = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectGetCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Set of properties to return. Defaults to noAcl. /// /// Sets the *projection* query property to the given value. @@ -6370,6 +8099,929 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau } +/// Watch for changes on all objects in a bucket. +/// +/// A builder for the *watchAll* method supported by a *object* resource. +/// It is not used directly, but through a `ObjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// use storage1::Channel; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = 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.objects().watch_all(req, "bucket") +/// .versions(false) +/// .user_project("justo") +/// .projection("est") +/// .prefix("clita") +/// .page_token("invidunt") +/// .max_results(14) +/// .delimiter("dolores") +/// .doit(); +/// # } +/// ``` +pub struct ObjectWatchAllCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _request: Channel, + _bucket: String, + _versions: Option, + _user_project: Option, + _projection: Option, + _prefix: Option, + _page_token: Option, + _max_results: Option, + _delimiter: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ObjectWatchAllCall<'a, C, A> {} + +impl<'a, C, A> ObjectWatchAllCall<'a, C, 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: "storage.objects.watchAll", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((11 + self._additional_params.len())); + params.push(("bucket", self._bucket.to_string())); + if let Some(value) = self._versions { + params.push(("versions", value.to_string())); + } + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + if let Some(value) = self._projection { + params.push(("projection", value.to_string())); + } + if let Some(value) = self._prefix { + params.push(("prefix", 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._delimiter { + params.push(("delimiter", value.to_string())); + } + for &field in ["alt", "bucket", "versions", "userProject", "projection", "prefix", "pageToken", "maxResults", "delimiter"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/watch".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though 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) -> ObjectWatchAllCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the bucket in which to look for objects. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. + /// + /// Sets the *versions* query property to the given value. + pub fn versions(mut self, new_value: bool) -> ObjectWatchAllCall<'a, C, A> { + self._versions = Some(new_value); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// Set of properties to return. Defaults to noAcl. + /// + /// Sets the *projection* query property to the given value. + pub fn projection(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { + self._projection = Some(new_value.to_string()); + self + } + /// Filter results to objects whose names begin with this prefix. + /// + /// Sets the *prefix* query property to the given value. + pub fn prefix(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { + self._prefix = Some(new_value.to_string()); + self + } + /// A previously-returned page token representing part of the larger set of results to view. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> ObjectWatchAllCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. + /// + /// Sets the *delimiter* query property to the given value. + pub fn delimiter(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { + self._delimiter = 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) -> ObjectWatchAllCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ObjectWatchAllCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ObjectWatchAllCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates an IAM policy for the specified object. +/// +/// A builder for the *setIamPolicy* method supported by a *object* resource. +/// It is not used directly, but through a `ObjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// use storage1::Policy; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Policy::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.objects().set_iam_policy(req, "bucket", "object") +/// .user_project("duo") +/// .generation("sed") +/// .doit(); +/// # } +/// ``` +pub struct ObjectSetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _request: Policy, + _bucket: String, + _object: String, + _user_project: Option, + _generation: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ObjectSetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ObjectSetIamPolicyCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.objects.setIamPolicy", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + 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 { + params.push(("userProject", value.to_string())); + } + if let Some(value) = self._generation { + params.push(("generation", value.to_string())); + } + for &field in ["alt", "bucket", "object", "userProject", "generation"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}/iam".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket"), ("{object}", "object")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["object", "bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: Policy) -> ObjectSetIamPolicyCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of the bucket in which the object resides. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> ObjectSetIamPolicyCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + /// + /// Sets the *object* path property to 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(mut self, new_value: &str) -> ObjectSetIamPolicyCall<'a, C, A> { + self._object = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectSetIamPolicyCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// If present, selects a specific revision of this object (as opposed to the latest version, the default). + /// + /// Sets the *generation* query property to the given value. + pub fn generation(mut self, new_value: &str) -> ObjectSetIamPolicyCall<'a, C, A> { + self._generation = 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) -> ObjectSetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ObjectSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ObjectSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns an IAM policy for the specified object. +/// +/// A builder for the *getIamPolicy* method supported by a *object* resource. +/// It is not used directly, but through a `ObjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.objects().get_iam_policy("bucket", "object") +/// .user_project("ea") +/// .generation("et") +/// .doit(); +/// # } +/// ``` +pub struct ObjectGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _bucket: String, + _object: String, + _user_project: Option, + _generation: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ObjectGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> ObjectGetIamPolicyCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.objects.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + 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 { + params.push(("userProject", value.to_string())); + } + if let Some(value) = self._generation { + params.push(("generation", value.to_string())); + } + for &field in ["alt", "bucket", "object", "userProject", "generation"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}/iam".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket"), ("{object}", "object")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["object", "bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 bucket in which the object resides. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> ObjectGetIamPolicyCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + /// + /// Sets the *object* path property to 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(mut self, new_value: &str) -> ObjectGetIamPolicyCall<'a, C, A> { + self._object = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectGetIamPolicyCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// If present, selects a specific revision of this object (as opposed to the latest version, the default). + /// + /// Sets the *generation* query property to the given value. + pub fn generation(mut self, new_value: &str) -> ObjectGetIamPolicyCall<'a, C, A> { + self._generation = 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) -> ObjectGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ObjectGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ObjectGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Updates an object's metadata. /// /// This method supports **media download**. To enable it, adjust the builder like this: @@ -6408,13 +9060,14 @@ impl<'a, C, A> ObjectGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().update(req, "bucket", "object") -/// .projection("nonumy") -/// .predefined_acl("sed") -/// .if_metageneration_not_match("aliquyam") -/// .if_metageneration_match("sit") -/// .if_generation_not_match("eirmod") -/// .if_generation_match("consetetur") -/// .generation("labore") +/// .user_project("kasd") +/// .projection("invidunt") +/// .predefined_acl("rebum.") +/// .if_metageneration_not_match("Lorem") +/// .if_metageneration_match("clita") +/// .if_generation_not_match("invidunt") +/// .if_generation_match("eirmod") +/// .generation("At") /// .doit(); /// # } /// ``` @@ -6425,6 +9078,7 @@ pub struct ObjectUpdateCall<'a, C, A> _request: Object, _bucket: String, _object: String, + _user_project: Option, _projection: Option, _predefined_acl: Option, _if_metageneration_not_match: Option, @@ -6453,9 +9107,12 @@ impl<'a, C, A> 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((11 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + 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 { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._projection { params.push(("projection", value.to_string())); } @@ -6477,7 +9134,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", "projection", "predefinedAcl", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "generation"].iter() { + for &field in ["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)); @@ -6505,7 +9162,7 @@ impl<'a, C, A> ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "b/{bucket}/o/{object}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -6652,6 +9309,13 @@ impl<'a, C, A> ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: self._object = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectUpdateCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Set of properties to return. Defaults to full. /// /// Sets the *projection* query property to the given value. @@ -6753,344 +9417,6 @@ impl<'a, C, A> ObjectUpdateCall<'a, C, A> where C: BorrowMut, A: } -/// Watch for changes on all objects in a bucket. -/// -/// A builder for the *watchAll* method supported by a *object* resource. -/// It is not used directly, but through a `ObjectMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_storage1 as storage1; -/// use storage1::Channel; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use storage1::Storage; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = Storage::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = 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.objects().watch_all(req, "bucket") -/// .versions(true) -/// .projection("gubergren") -/// .prefix("aliquyam") -/// .page_token("eos") -/// .max_results(63) -/// .delimiter("sea") -/// .doit(); -/// # } -/// ``` -pub struct ObjectWatchAllCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Storage, - _request: Channel, - _bucket: String, - _versions: Option, - _projection: Option, - _prefix: Option, - _page_token: Option, - _max_results: Option, - _delimiter: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ObjectWatchAllCall<'a, C, A> {} - -impl<'a, C, A> ObjectWatchAllCall<'a, C, 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: "storage.objects.watchAll", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); - params.push(("bucket", self._bucket.to_string())); - if let Some(value) = self._versions { - params.push(("versions", value.to_string())); - } - if let Some(value) = self._projection { - params.push(("projection", value.to_string())); - } - if let Some(value) = self._prefix { - params.push(("prefix", 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._delimiter { - params.push(("delimiter", value.to_string())); - } - for &field in ["alt", "bucket", "versions", "projection", "prefix", "pageToken", "maxResults", "delimiter"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "b/{bucket}/o/watch"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{bucket}", "bucket")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - break; - } - } - url = url.replace(find_this, replace_with.expect("to find substitution value in params")); - } - { - let mut indices_for_removal: Vec = Vec::with_capacity(1); - for param_name in ["bucket"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); - let mut request_value_reader = - { - let mut value = json::value::to_value(&self._request).expect("serde to work"); - remove_json_null_values(&mut value); - let mut dst = io::Cursor::new(Vec::with_capacity(128)); - json::to_writer(&mut dst, &value).unwrap(); - dst - }; - let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()) - .header(ContentType(json_mime_type.clone())) - .header(ContentLength(request_size as u64)) - .body(&mut request_value_reader); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// - /// Sets the *request* property to the given value. - /// - /// Even though 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) -> ObjectWatchAllCall<'a, C, A> { - self._request = new_value; - self - } - /// Name of the bucket in which to look for objects. - /// - /// Sets the *bucket* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn bucket(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { - self._bucket = new_value.to_string(); - self - } - /// If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning. - /// - /// Sets the *versions* query property to the given value. - pub fn versions(mut self, new_value: bool) -> ObjectWatchAllCall<'a, C, A> { - self._versions = Some(new_value); - self - } - /// Set of properties to return. Defaults to noAcl. - /// - /// Sets the *projection* query property to the given value. - pub fn projection(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { - self._projection = Some(new_value.to_string()); - self - } - /// Filter results to objects whose names begin with this prefix. - /// - /// Sets the *prefix* query property to the given value. - pub fn prefix(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { - self._prefix = Some(new_value.to_string()); - self - } - /// A previously-returned page token representing part of the larger set of results to view. - /// - /// Sets the *page token* query property to the given value. - pub fn page_token(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { - self._page_token = Some(new_value.to_string()); - self - } - /// Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. The default value of this parameter is 1,000 items. - /// - /// Sets the *max results* query property to the given value. - pub fn max_results(mut self, new_value: u32) -> ObjectWatchAllCall<'a, C, A> { - self._max_results = Some(new_value); - self - } - /// Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted. - /// - /// Sets the *delimiter* query property to the given value. - pub fn delimiter(mut self, new_value: &str) -> ObjectWatchAllCall<'a, C, A> { - self._delimiter = 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) -> ObjectWatchAllCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ObjectWatchAllCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ObjectWatchAllCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Stores a new object and metadata. /// /// This method supports **media download**. To enable it, adjust the builder like this: @@ -7130,14 +9456,15 @@ impl<'a, C, A> ObjectWatchAllCall<'a, C, A> where C: BorrowMut, A /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().insert(req, "bucket") -/// .projection("ipsum") -/// .predefined_acl("aliquyam") -/// .name("dolores") -/// .if_metageneration_not_match("sit") -/// .if_metageneration_match("diam") -/// .if_generation_not_match("ut") -/// .if_generation_match("justo") -/// .content_encoding("est") +/// .user_project("et") +/// .projection("sed") +/// .predefined_acl("sit") +/// .name("takimata") +/// .if_metageneration_not_match("elitr") +/// .if_metageneration_match("nonumy") +/// .if_generation_not_match("rebum.") +/// .if_generation_match("Lorem") +/// .content_encoding("Lorem") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -7147,6 +9474,7 @@ pub struct ObjectInsertCall<'a, C, A> hub: &'a Storage, _request: Object, _bucket: String, + _user_project: Option, _projection: Option, _predefined_acl: Option, _name: Option, @@ -7177,8 +9505,11 @@ 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((11 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); params.push(("bucket", self._bucket.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._projection { params.push(("projection", value.to_string())); } @@ -7203,7 +9534,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", "projection", "predefinedAcl", "name", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "contentEncoding"].iter() { + for &field in ["bucket", "userProject", "projection", "predefinedAcl", "name", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "contentEncoding"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7233,9 +9564,9 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/storage/v1/b/{bucket}/o", "multipart") + ("https://www.googleapis.com/upload/storage/v1/b/{bucket}/o".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/storage/v1/b/{bucket}/o", "resumable") + ("https://www.googleapis.com/resumable/upload/storage/v1/b/{bucket}/o".to_string(), "resumable") } else { unreachable!() }; @@ -7476,6 +9807,13 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: self._bucket = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectInsertCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full. /// /// Sets the *projection* query property to the given value. @@ -7622,9 +9960,10 @@ impl<'a, C, A> ObjectInsertCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().compose(req, "destinationBucket", "destinationObject") -/// .if_metageneration_match("clita") -/// .if_generation_match("diam") -/// .destination_predefined_acl("justo") +/// .user_project("ut") +/// .if_metageneration_match("amet.") +/// .if_generation_match("ipsum") +/// .destination_predefined_acl("ut") /// .doit(); /// # } /// ``` @@ -7635,6 +9974,7 @@ pub struct ObjectComposeCall<'a, C, A> _request: ComposeRequest, _destination_bucket: String, _destination_object: String, + _user_project: Option, _if_metageneration_match: Option, _if_generation_match: Option, _destination_predefined_acl: Option, @@ -7659,9 +9999,12 @@ 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((7 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((8 + self._additional_params.len())); params.push(("destinationBucket", self._destination_bucket.to_string())); params.push(("destinationObject", self._destination_object.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._if_metageneration_match { params.push(("ifMetagenerationMatch", value.to_string())); } @@ -7671,7 +10014,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", "ifMetagenerationMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { + for &field in ["destinationBucket", "destinationObject", "userProject", "ifMetagenerationMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -7699,7 +10042,7 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "b/{destinationBucket}/o/{destinationObject}/compose"; + let mut url = "https://www.googleapis.com/storage/v1/b/{destinationBucket}/o/{destinationObject}/compose".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -7846,6 +10189,13 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: self._destination_object = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectComposeCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Makes the operation conditional on whether the object's current metageneration matches the given value. /// /// Sets the *if metageneration match* query property to the given value. @@ -7946,11 +10296,12 @@ impl<'a, C, A> ObjectComposeCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().delete("bucket", "object") -/// .if_metageneration_not_match("invidunt") -/// .if_metageneration_match("ut") -/// .if_generation_not_match("dolores") -/// .if_generation_match("eos") -/// .generation("voluptua.") +/// .user_project("ut") +/// .if_metageneration_not_match("eirmod") +/// .if_metageneration_match("sanctus") +/// .if_generation_not_match("voluptua.") +/// .if_generation_match("dolor") +/// .generation("et") /// .doit(); /// # } /// ``` @@ -7960,6 +10311,7 @@ pub struct ObjectDeleteCall<'a, C, A> hub: &'a Storage, _bucket: String, _object: String, + _user_project: Option, _if_metageneration_not_match: Option, _if_metageneration_match: Option, _if_generation_not_match: Option, @@ -7986,9 +10338,12 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "storage.objects.delete", http_method: hyper::method::Method::Delete }); - 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(("bucket", self._bucket.to_string())); params.push(("object", self._object.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._if_metageneration_not_match { params.push(("ifMetagenerationNotMatch", value.to_string())); } @@ -8004,7 +10359,7 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._generation { params.push(("generation", value.to_string())); } - for &field in ["bucket", "object", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "generation"].iter() { + for &field in ["bucket", "object", "userProject", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "generation"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8015,7 +10370,7 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "b/{bucket}/o/{object}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8128,6 +10483,13 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: self._object = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectDeleteCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Makes the operation conditional on whether the object's current metageneration does not match the given value. /// /// Sets the *if metageneration not match* query property to the given value. @@ -8242,12 +10604,13 @@ impl<'a, C, A> ObjectDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().list("bucket") -/// .versions(false) -/// .projection("aliquyam") -/// .prefix("ea") -/// .page_token("ea") -/// .max_results(27) -/// .delimiter("dolor") +/// .versions(true) +/// .user_project("ut") +/// .projection("sed") +/// .prefix("et") +/// .page_token("ipsum") +/// .max_results(81) +/// .delimiter("dolore") /// .doit(); /// # } /// ``` @@ -8257,6 +10620,7 @@ pub struct ObjectListCall<'a, C, A> hub: &'a Storage, _bucket: String, _versions: Option, + _user_project: Option, _projection: Option, _prefix: Option, _page_token: Option, @@ -8283,11 +10647,14 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa }; dlg.begin(MethodInfo { id: "storage.objects.list", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); params.push(("bucket", self._bucket.to_string())); if let Some(value) = self._versions { params.push(("versions", value.to_string())); } + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._projection { params.push(("projection", value.to_string())); } @@ -8303,7 +10670,7 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa if let Some(value) = self._delimiter { params.push(("delimiter", value.to_string())); } - for &field in ["alt", "bucket", "versions", "projection", "prefix", "pageToken", "maxResults", "delimiter"].iter() { + for &field in ["alt", "bucket", "versions", "userProject", "projection", "prefix", "pageToken", "maxResults", "delimiter"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -8315,7 +10682,7 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "b/{bucket}/o"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8435,6 +10802,13 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa self._versions = Some(new_value); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectListCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Set of properties to return. Defaults to noAcl. /// /// Sets the *projection* query property to the given value. @@ -8456,7 +10830,7 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa self._page_token = Some(new_value.to_string()); self } - /// Maximum number of items plus prefixes to return. As duplicate prefixes are omitted, fewer total results may be returned than requested. The default value of this parameter is 1,000 items. + /// Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> ObjectListCall<'a, C, A> { @@ -8522,6 +10896,294 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa } +/// Tests a set of permissions on the given object to see which, if any, are held by the caller. +/// +/// A builder for the *testIamPermissions* method supported by a *object* resource. +/// It is not used directly, but through a `ObjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.objects().test_iam_permissions("bucket", "object", "permissions") +/// .user_project("et") +/// .generation("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct ObjectTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _bucket: String, + _object: String, + _permissions: Vec, + _user_project: Option, + _generation: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ObjectTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> ObjectTestIamPermissionCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.objects.testIamPermissions", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("bucket", self._bucket.to_string())); + params.push(("object", self._object.to_string())); + if self._permissions.len() > 0 { + for f in self._permissions.iter() { + params.push(("permissions", f.to_string())); + } + } + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + if let Some(value) = self._generation { + params.push(("generation", value.to_string())); + } + for &field in ["alt", "bucket", "object", "permissions", "userProject", "generation"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}/iam/testPermissions".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket"), ("{object}", "object")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["object", "bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 bucket in which the object resides. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> ObjectTestIamPermissionCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + /// + /// Sets the *object* path property to 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(mut self, new_value: &str) -> ObjectTestIamPermissionCall<'a, C, A> { + self._object = new_value.to_string(); + self + } + /// Permissions to test. + /// + /// Append the given value to the *permissions* query 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_permissions(mut self, new_value: &str) -> ObjectTestIamPermissionCall<'a, C, A> { + self._permissions.push(new_value.to_string()); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectTestIamPermissionCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// If present, selects a specific revision of this object (as opposed to the latest version, the default). + /// + /// Sets the *generation* query property to the given value. + pub fn generation(mut self, new_value: &str) -> ObjectTestIamPermissionCall<'a, C, A> { + self._generation = 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) -> ObjectTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ObjectTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ObjectTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Copies a source object to a destination object. Optionally overrides metadata. /// /// This method supports **media download**. To enable it, adjust the builder like this: @@ -8560,17 +11222,18 @@ impl<'a, C, A> ObjectListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().copy(req, "sourceBucket", "sourceObject", "destinationBucket", "destinationObject") -/// .source_generation("Lorem") -/// .projection("clita") -/// .if_source_metageneration_not_match("invidunt") -/// .if_source_metageneration_match("eirmod") -/// .if_source_generation_not_match("At") -/// .if_source_generation_match("consetetur") -/// .if_metageneration_not_match("et") -/// .if_metageneration_match("sed") -/// .if_generation_not_match("sit") -/// .if_generation_match("takimata") -/// .destination_predefined_acl("elitr") +/// .user_project("rebum.") +/// .source_generation("labore") +/// .projection("aliquyam") +/// .if_source_metageneration_not_match("elitr") +/// .if_source_metageneration_match("consetetur") +/// .if_source_generation_not_match("sea") +/// .if_source_generation_match("elitr") +/// .if_metageneration_not_match("At") +/// .if_metageneration_match("sea") +/// .if_generation_not_match("consetetur") +/// .if_generation_match("diam") +/// .destination_predefined_acl("accusam") /// .doit(); /// # } /// ``` @@ -8583,6 +11246,7 @@ pub struct ObjectCopyCall<'a, C, A> _source_object: String, _destination_bucket: String, _destination_object: String, + _user_project: Option, _source_generation: Option, _projection: Option, _if_source_metageneration_not_match: Option, @@ -8615,11 +11279,14 @@ impl<'a, C, A> 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((17 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((18 + 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())); params.push(("destinationObject", self._destination_object.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._source_generation { params.push(("sourceGeneration", value.to_string())); } @@ -8653,7 +11320,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", "sourceGeneration", "projection", "ifSourceMetagenerationNotMatch", "ifSourceMetagenerationMatch", "ifSourceGenerationNotMatch", "ifSourceGenerationMatch", "ifMetagenerationNotMatch", "ifMetagenerationMatch", "ifGenerationNotMatch", "ifGenerationMatch", "destinationPredefinedAcl"].iter() { + for &field in ["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)); @@ -8681,7 +11348,7 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -8848,6 +11515,13 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa self._destination_object = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectCopyCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// If present, selects a specific revision of the source object (as opposed to the latest version, the default). /// /// Sets the *source generation* query property to the given value. @@ -9010,13 +11684,14 @@ impl<'a, C, A> ObjectCopyCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.objects().patch(req, "bucket", "object") -/// .projection("Lorem") -/// .predefined_acl("Lorem") -/// .if_metageneration_not_match("diam") -/// .if_metageneration_match("ut") -/// .if_generation_not_match("ut") -/// .if_generation_match("amet.") -/// .generation("ipsum") +/// .user_project("dolor") +/// .projection("aliquyam") +/// .predefined_acl("elitr") +/// .if_metageneration_not_match("ea") +/// .if_metageneration_match("et") +/// .if_generation_not_match("Stet") +/// .if_generation_match("sed") +/// .generation("dolor") /// .doit(); /// # } /// ``` @@ -9027,6 +11702,7 @@ pub struct ObjectPatchCall<'a, C, A> _request: Object, _bucket: String, _object: String, + _user_project: Option, _projection: Option, _predefined_acl: Option, _if_metageneration_not_match: Option, @@ -9055,9 +11731,12 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "storage.objects.patch", http_method: hyper::method::Method::Patch }); - 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 { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._projection { params.push(("projection", value.to_string())); } @@ -9079,7 +11758,7 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o if let Some(value) = self._generation { params.push(("generation", value.to_string())); } - for &field in ["alt", "bucket", "object", "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)); @@ -9091,7 +11770,7 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "b/{bucket}/o/{object}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -9238,6 +11917,13 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o self._object = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectPatchCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Set of properties to return. Defaults to full. /// /// Sets the *projection* query property to the given value. @@ -9339,9 +12025,9 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o } -/// Creates a new ACL entry on the specified object. +/// Returns the ACL entry for the specified entity on the specified object. /// -/// A builder for the *insert* method supported by a *objectAccessControl* resource. +/// A builder for the *get* method supported by a *objectAccessControl* resource. /// It is not used directly, but through a `ObjectAccessControlMethods` instance. /// /// # Example @@ -9352,7 +12038,6 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_storage1 as storage1; -/// use storage1::ObjectAccessControl; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -9363,35 +12048,32 @@ impl<'a, C, A> ObjectPatchCall<'a, C, A> where C: BorrowMut, A: o /// # hyper::Client::new(), /// # ::default(), None); /// # let mut hub = Storage::new(hyper::Client::new(), auth); -/// // As the method needs a request, you would usually fill it with the desired information -/// // into the respective structure. Some of the parts shown here might not be applicable ! -/// // Values shown here are possibly random and not representative ! -/// let mut req = ObjectAccessControl::default(); -/// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.object_access_controls().insert(req, "bucket", "object") -/// .generation("sea") +/// let result = hub.object_access_controls().get("bucket", "object", "entity") +/// .user_project("consetetur") +/// .generation("consetetur") /// .doit(); /// # } /// ``` -pub struct ObjectAccessControlInsertCall<'a, C, A> +pub struct ObjectAccessControlGetCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Storage, - _request: ObjectAccessControl, _bucket: String, _object: String, + _entity: String, + _user_project: Option, _generation: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for ObjectAccessControlInsertCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for ObjectAccessControlGetCall<'a, C, A> {} -impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> ObjectAccessControlGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. @@ -9403,15 +12085,19 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut d, None => &mut dd }; - dlg.begin(MethodInfo { id: "storage.objectAccessControls.insert", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "storage.objectAccessControls.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("bucket", self._bucket.to_string())); params.push(("object", self._object.to_string())); + params.push(("entity", self._entity.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._generation { params.push(("generation", value.to_string())); } - for &field in ["alt", "bucket", "object", "generation"].iter() { + for &field in ["alt", "bucket", "object", "entity", "userProject", "generation"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9423,12 +12109,12 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut = None; for &(name, ref value) in params.iter() { if name == param_name { @@ -9439,8 +12125,8 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut = Vec::with_capacity(2); - for param_name in ["object", "bucket"].iter() { + let mut indices_for_removal: Vec = Vec::with_capacity(3); + for param_name in ["entity", "object", "bucket"].iter() { if let Some(index) = params.iter().position(|t| &t.0 == param_name) { indices_for_removal.push(index); } @@ -9455,17 +12141,6 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut ObjectAccessControlInsertCall<'a, C, A> { - self._request = new_value; - self - } /// Name of a bucket. /// /// Sets the *bucket* path property to the given value. /// /// Even though the property as already been set when instantiating this call, /// we provide this method for API completeness. - pub fn bucket(mut self, new_value: &str) -> ObjectAccessControlInsertCall<'a, C, A> { + pub fn bucket(mut self, new_value: &str) -> ObjectAccessControlGetCall<'a, C, A> { self._bucket = new_value.to_string(); self } @@ -9566,14 +12228,31 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut ObjectAccessControlInsertCall<'a, C, A> { + pub fn object(mut self, new_value: &str) -> ObjectAccessControlGetCall<'a, C, A> { self._object = new_value.to_string(); self } + /// The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. + /// + /// Sets the *entity* path property to 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(mut self, new_value: &str) -> ObjectAccessControlGetCall<'a, C, A> { + self._entity = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectAccessControlGetCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// If present, selects a specific revision of this object (as opposed to the latest version, the default). /// /// Sets the *generation* query property to the given value. - pub fn generation(mut self, new_value: &str) -> ObjectAccessControlInsertCall<'a, C, A> { + pub fn generation(mut self, new_value: &str) -> ObjectAccessControlGetCall<'a, C, A> { self._generation = Some(new_value.to_string()); self } @@ -9583,7 +12262,7 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut ObjectAccessControlInsertCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ObjectAccessControlGetCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -9604,7 +12283,7 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> ObjectAccessControlInsertCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> ObjectAccessControlGetCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -9621,7 +12300,7 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut(mut self, scope: T) -> ObjectAccessControlInsertCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> ObjectAccessControlGetCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -9662,7 +12341,8 @@ impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut _bucket: String, _object: String, _entity: String, + _user_project: Option, _generation: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -9696,14 +12377,17 @@ impl<'a, C, A> ObjectAccessControlPatchCall<'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(("bucket", self._bucket.to_string())); params.push(("object", self._object.to_string())); params.push(("entity", self._entity.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._generation { params.push(("generation", value.to_string())); } - for &field in ["alt", "bucket", "object", "entity", "generation"].iter() { + for &field in ["alt", "bucket", "object", "entity", "userProject", "generation"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -9715,7 +12399,7 @@ impl<'a, C, A> ObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut ObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut ObjectAccessControlPatchCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// If present, selects a specific revision of this object (as opposed to the latest version, the default). /// /// Sets the *generation* query property to the given value. @@ -9958,7 +12649,8 @@ impl<'a, C, A> ObjectAccessControlPatchCall<'a, C, A> where C: BorrowMut hub: &'a Storage, _bucket: String, _object: String, + _user_project: Option, _generation: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -9990,13 +12683,16 @@ impl<'a, C, A> ObjectAccessControlListCall<'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(("bucket", self._bucket.to_string())); params.push(("object", self._object.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._generation { params.push(("generation", value.to_string())); } - for &field in ["alt", "bucket", "object", "generation"].iter() { + for &field in ["alt", "bucket", "object", "userProject", "generation"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10008,7 +12704,7 @@ impl<'a, C, A> ObjectAccessControlListCall<'a, C, A> where C: BorrowMut ObjectAccessControlListCall<'a, C, A> where C: BorrowMut ObjectAccessControlListCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// If present, selects a specific revision of this object (as opposed to the latest version, the default). /// /// Sets the *generation* query property to the given value. @@ -10217,7 +12920,8 @@ impl<'a, C, A> ObjectAccessControlListCall<'a, C, A> where C: BorrowMut _bucket: String, _object: String, _entity: String, + _user_project: Option, _generation: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -10250,14 +12955,17 @@ impl<'a, C, A> ObjectAccessControlDeleteCall<'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(("bucket", self._bucket.to_string())); params.push(("object", self._object.to_string())); params.push(("entity", self._entity.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._generation { params.push(("generation", value.to_string())); } - for &field in ["bucket", "object", "entity", "generation"].iter() { + for &field in ["bucket", "object", "entity", "userProject", "generation"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10268,7 +12976,7 @@ impl<'a, C, A> ObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut ObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut ObjectAccessControlDeleteCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// If present, selects a specific revision of this object (as opposed to the latest version, the default). /// /// Sets the *generation* query property to the given value. @@ -10450,277 +13165,6 @@ impl<'a, C, A> ObjectAccessControlDeleteCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Storage::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.object_access_controls().get("bucket", "object", "entity") -/// .generation("vero") -/// .doit(); -/// # } -/// ``` -pub struct ObjectAccessControlGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Storage, - _bucket: String, - _object: String, - _entity: String, - _generation: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for ObjectAccessControlGetCall<'a, C, A> {} - -impl<'a, C, A> ObjectAccessControlGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, ObjectAccessControl)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "storage.objectAccessControls.get", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); - params.push(("bucket", self._bucket.to_string())); - params.push(("object", self._object.to_string())); - params.push(("entity", self._entity.to_string())); - if let Some(value) = self._generation { - params.push(("generation", value.to_string())); - } - for &field in ["alt", "bucket", "object", "entity", "generation"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "b/{bucket}/o/{object}/acl/{entity}"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); - } - - for &(find_this, param_name) in [("{bucket}", "bucket"), ("{object}", "object"), ("{entity}", "entity")].iter() { - let mut replace_with: Option<&str> = None; - for &(name, ref value) in params.iter() { - if name == param_name { - replace_with = Some(value); - 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 ["entity", "object", "bucket"].iter() { - if let Some(index) = params.iter().position(|t| &t.0 == param_name) { - indices_for_removal.push(index); - } - } - for &index in indices_for_removal.iter() { - params.remove(index); - } - } - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - 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 a bucket. - /// - /// Sets the *bucket* path property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - pub fn bucket(mut self, new_value: &str) -> ObjectAccessControlGetCall<'a, C, A> { - self._bucket = new_value.to_string(); - self - } - /// Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. - /// - /// Sets the *object* path property to 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(mut self, new_value: &str) -> ObjectAccessControlGetCall<'a, C, A> { - self._object = new_value.to_string(); - self - } - /// The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. - /// - /// Sets the *entity* path property to 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(mut self, new_value: &str) -> ObjectAccessControlGetCall<'a, C, A> { - self._entity = new_value.to_string(); - self - } - /// If present, selects a specific revision of this object (as opposed to the latest version, the default). - /// - /// Sets the *generation* query property to the given value. - pub fn generation(mut self, new_value: &str) -> ObjectAccessControlGetCall<'a, C, A> { - self._generation = 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) -> ObjectAccessControlGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> ObjectAccessControlGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> ObjectAccessControlGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Updates an ACL entry on the specified object. /// /// A builder for the *update* method supported by a *objectAccessControl* resource. @@ -10754,7 +13198,8 @@ impl<'a, C, A> ObjectAccessControlGetCall<'a, C, A> where C: BorrowMut _bucket: String, _object: String, _entity: String, + _user_project: Option, _generation: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, @@ -10788,14 +13234,17 @@ impl<'a, C, A> ObjectAccessControlUpdateCall<'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(("bucket", self._bucket.to_string())); params.push(("object", self._object.to_string())); params.push(("entity", self._entity.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._generation { params.push(("generation", value.to_string())); } - for &field in ["alt", "bucket", "object", "entity", "generation"].iter() { + for &field in ["alt", "bucket", "object", "entity", "userProject", "generation"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -10807,7 +13256,7 @@ impl<'a, C, A> ObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut ObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut ObjectAccessControlUpdateCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// If present, selects a specific revision of this object (as opposed to the latest version, the default). /// /// Sets the *generation* query property to the given value. @@ -11023,6 +13479,646 @@ impl<'a, C, A> ObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = ObjectAccessControl::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.object_access_controls().insert(req, "bucket", "object") +/// .user_project("dolore") +/// .generation("amet.") +/// .doit(); +/// # } +/// ``` +pub struct ObjectAccessControlInsertCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _request: ObjectAccessControl, + _bucket: String, + _object: String, + _user_project: Option, + _generation: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ObjectAccessControlInsertCall<'a, C, A> {} + +impl<'a, C, A> ObjectAccessControlInsertCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ObjectAccessControl)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.objectAccessControls.insert", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + 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 { + params.push(("userProject", value.to_string())); + } + if let Some(value) = self._generation { + params.push(("generation", value.to_string())); + } + for &field in ["alt", "bucket", "object", "userProject", "generation"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/o/{object}/acl".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket"), ("{object}", "object")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + 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 ["object", "bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()) + .header(ContentType(json_mime_type.clone())) + .header(ContentLength(request_size as u64)) + .body(&mut request_value_reader); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// + /// Sets the *request* property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn request(mut self, new_value: ObjectAccessControl) -> ObjectAccessControlInsertCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of a bucket. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> ObjectAccessControlInsertCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts. + /// + /// Sets the *object* path property to 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(mut self, new_value: &str) -> ObjectAccessControlInsertCall<'a, C, A> { + self._object = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> ObjectAccessControlInsertCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// If present, selects a specific revision of this object (as opposed to the latest version, the default). + /// + /// Sets the *generation* query property to the given value. + pub fn generation(mut self, new_value: &str) -> ObjectAccessControlInsertCall<'a, C, A> { + self._generation = 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) -> ObjectAccessControlInsertCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ObjectAccessControlInsertCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ObjectAccessControlInsertCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. This method supports patch semantics. +/// +/// A builder for the *patch* method supported by a *bucket* resource. +/// It is not used directly, but through a `BucketMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// use storage1::Bucket; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // As the method needs a request, you would usually fill it with the desired information +/// // into the respective structure. Some of the parts shown here might not be applicable ! +/// // Values shown here are possibly random and not representative ! +/// let mut req = Bucket::default(); +/// +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.buckets().patch(req, "bucket") +/// .user_project("magna") +/// .projection("elitr") +/// .predefined_default_object_acl("magna") +/// .predefined_acl("ipsum") +/// .if_metageneration_not_match("invidunt") +/// .if_metageneration_match("accusam") +/// .doit(); +/// # } +/// ``` +pub struct BucketPatchCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _request: Bucket, + _bucket: String, + _user_project: Option, + _projection: Option, + _predefined_default_object_acl: Option, + _predefined_acl: Option, + _if_metageneration_not_match: Option, + _if_metageneration_match: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BucketPatchCall<'a, C, A> {} + +impl<'a, C, A> BucketPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, Bucket)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.buckets.patch", + http_method: hyper::method::Method::Patch }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((10 + self._additional_params.len())); + params.push(("bucket", self._bucket.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + if let Some(value) = self._projection { + params.push(("projection", value.to_string())); + } + if let Some(value) = self._predefined_default_object_acl { + params.push(("predefinedDefaultObjectAcl", value.to_string())); + } + if let Some(value) = self._predefined_acl { + params.push(("predefinedAcl", value.to_string())); + } + if let Some(value) = self._if_metageneration_not_match { + params.push(("ifMetagenerationNotMatch", value.to_string())); + } + if let Some(value) = self._if_metageneration_match { + params.push(("ifMetagenerationMatch", value.to_string())); + } + for &field in ["alt", "bucket", "userProject", "projection", "predefinedDefaultObjectAcl", "predefinedAcl", "ifMetagenerationNotMatch", "ifMetagenerationMatch"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + let mut json_mime_type = mime::Mime(mime::TopLevel::Application, mime::SubLevel::Json, Default::default()); + let mut request_value_reader = + { + let mut value = json::value::to_value(&self._request).expect("serde to work"); + remove_json_null_values(&mut value); + let mut dst = io::Cursor::new(Vec::with_capacity(128)); + json::to_writer(&mut dst, &value).unwrap(); + dst + }; + let request_size = request_value_reader.seek(io::SeekFrom::End(0)).unwrap(); + request_value_reader.seek(io::SeekFrom::Start(0)).unwrap(); + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + request_value_reader.seek(io::SeekFrom::Start(0)).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: Bucket) -> BucketPatchCall<'a, C, A> { + self._request = new_value; + self + } + /// Name of a bucket. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// Set of properties to return. Defaults to full. + /// + /// Sets the *projection* query property to the given value. + pub fn projection(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { + self._projection = Some(new_value.to_string()); + self + } + /// Apply a predefined set of default object access controls to this bucket. + /// + /// Sets the *predefined default object acl* query property to the given value. + pub fn predefined_default_object_acl(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { + self._predefined_default_object_acl = Some(new_value.to_string()); + self + } + /// Apply a predefined set of access controls to this bucket. + /// + /// Sets the *predefined acl* query property to the given value. + pub fn predefined_acl(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { + self._predefined_acl = Some(new_value.to_string()); + self + } + /// Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. + /// + /// Sets the *if metageneration not match* query property to the given value. + pub fn if_metageneration_not_match(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { + self._if_metageneration_not_match = Some(new_value.to_string()); + self + } + /// Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. + /// + /// Sets the *if metageneration match* query property to the given value. + pub fn if_metageneration_match(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { + self._if_metageneration_match = 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) -> BucketPatchCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> BucketPatchCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> BucketPatchCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. /// /// A builder for the *update* method supported by a *bucket* resource. @@ -11056,11 +14152,12 @@ impl<'a, C, A> ObjectAccessControlUpdateCall<'a, C, A> where C: BorrowMut hub: &'a Storage, _request: Bucket, _bucket: String, + _user_project: Option, _projection: Option, _predefined_default_object_acl: Option, _predefined_acl: Option, @@ -11096,8 +14194,11 @@ impl<'a, C, A> BucketUpdateCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "storage.buckets.update", http_method: hyper::method::Method::Put }); - 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(("bucket", self._bucket.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._projection { params.push(("projection", value.to_string())); } @@ -11113,7 +14214,7 @@ impl<'a, C, A> BucketUpdateCall<'a, C, A> where C: BorrowMut, A: if let Some(value) = self._if_metageneration_match { params.push(("ifMetagenerationMatch", value.to_string())); } - for &field in ["alt", "bucket", "projection", "predefinedDefaultObjectAcl", "predefinedAcl", "ifMetagenerationNotMatch", "ifMetagenerationMatch"].iter() { + for &field in ["alt", "bucket", "userProject", "projection", "predefinedDefaultObjectAcl", "predefinedAcl", "ifMetagenerationNotMatch", "ifMetagenerationMatch"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11125,7 +14226,7 @@ impl<'a, C, A> BucketUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "b/{bucket}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11262,6 +14363,13 @@ impl<'a, C, A> BucketUpdateCall<'a, C, A> where C: BorrowMut, A: self._bucket = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> BucketUpdateCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Set of properties to return. Defaults to full. /// /// Sets the *projection* query property to the given value. @@ -11376,9 +14484,10 @@ impl<'a, C, A> BucketUpdateCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.buckets().get("bucket") -/// .projection("elitr") -/// .if_metageneration_not_match("consetetur") -/// .if_metageneration_match("sea") +/// .user_project("dolor") +/// .projection("vero") +/// .if_metageneration_not_match("nonumy") +/// .if_metageneration_match("takimata") /// .doit(); /// # } /// ``` @@ -11387,6 +14496,7 @@ pub struct BucketGetCall<'a, C, A> hub: &'a Storage, _bucket: String, + _user_project: Option, _projection: Option, _if_metageneration_not_match: Option, _if_metageneration_match: Option, @@ -11411,8 +14521,11 @@ impl<'a, C, A> BucketGetCall<'a, C, A> where C: BorrowMut, A: oau }; dlg.begin(MethodInfo { id: "storage.buckets.get", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); params.push(("bucket", self._bucket.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._projection { params.push(("projection", value.to_string())); } @@ -11422,7 +14535,7 @@ impl<'a, C, A> BucketGetCall<'a, C, A> where C: BorrowMut, A: oau if let Some(value) = self._if_metageneration_match { params.push(("ifMetagenerationMatch", value.to_string())); } - for &field in ["alt", "bucket", "projection", "ifMetagenerationNotMatch", "ifMetagenerationMatch"].iter() { + for &field in ["alt", "bucket", "userProject", "projection", "ifMetagenerationNotMatch", "ifMetagenerationMatch"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11434,7 +14547,7 @@ impl<'a, C, A> BucketGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "b/{bucket}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11547,6 +14660,13 @@ impl<'a, C, A> BucketGetCall<'a, C, A> where C: BorrowMut, A: oau self._bucket = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> BucketGetCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// Set of properties to return. Defaults to noAcl. /// /// Sets the *projection* query property to the given value. @@ -11647,8 +14767,9 @@ impl<'a, C, A> BucketGetCall<'a, C, A> where C: BorrowMut, A: oau /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.buckets().delete("bucket") -/// .if_metageneration_not_match("At") -/// .if_metageneration_match("sea") +/// .user_project("consetetur") +/// .if_metageneration_not_match("erat") +/// .if_metageneration_match("amet.") /// .doit(); /// # } /// ``` @@ -11657,6 +14778,7 @@ pub struct BucketDeleteCall<'a, C, A> hub: &'a Storage, _bucket: String, + _user_project: Option, _if_metageneration_not_match: Option, _if_metageneration_match: Option, _delegate: Option<&'a mut Delegate>, @@ -11680,15 +14802,18 @@ impl<'a, C, A> BucketDeleteCall<'a, C, A> where C: BorrowMut, A: }; dlg.begin(MethodInfo { id: "storage.buckets.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(("bucket", self._bucket.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } if let Some(value) = self._if_metageneration_not_match { params.push(("ifMetagenerationNotMatch", value.to_string())); } if let Some(value) = self._if_metageneration_match { params.push(("ifMetagenerationMatch", value.to_string())); } - for &field in ["bucket", "ifMetagenerationNotMatch", "ifMetagenerationMatch"].iter() { + for &field in ["bucket", "userProject", "ifMetagenerationNotMatch", "ifMetagenerationMatch"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -11699,7 +14824,7 @@ impl<'a, C, A> BucketDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "b/{bucket}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -11802,6 +14927,13 @@ impl<'a, C, A> BucketDeleteCall<'a, C, A> where C: BorrowMut, A: self._bucket = new_value.to_string(); self } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> BucketDeleteCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } /// If set, only deletes the bucket if its metageneration does not match this value. /// /// Sets the *if metageneration not match* query property to the given value. @@ -11901,9 +15033,9 @@ impl<'a, C, A> BucketDeleteCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.buckets().insert(req, "project") -/// .projection("diam") -/// .predefined_default_object_acl("accusam") -/// .predefined_acl("dolores") +/// .projection("dolores") +/// .predefined_default_object_acl("et") +/// .predefined_acl("sed") /// .doit(); /// # } /// ``` @@ -11960,7 +15092,7 @@ impl<'a, C, A> BucketInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "b"; + let mut url = "https://www.googleapis.com/storage/v1/b".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12149,9 +15281,9 @@ impl<'a, C, A> BucketInsertCall<'a, C, A> where C: BorrowMut, A: } -/// Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. This method supports patch semantics. +/// Tests a set of permissions on the given bucket to see which, if any, are held by the caller. /// -/// A builder for the *patch* method supported by a *bucket* resource. +/// A builder for the *testIamPermissions* method supported by a *bucket* resource. /// It is not used directly, but through a `BucketMethods` instance. /// /// # Example @@ -12162,7 +15294,271 @@ impl<'a, C, A> BucketInsertCall<'a, C, A> where C: BorrowMut, A: /// # extern crate hyper; /// # extern crate yup_oauth2 as oauth2; /// # extern crate google_storage1 as storage1; -/// use storage1::Bucket; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.buckets().test_iam_permissions("bucket", "permissions") +/// .user_project("nonumy") +/// .doit(); +/// # } +/// ``` +pub struct BucketTestIamPermissionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _bucket: String, + _permissions: Vec, + _user_project: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BucketTestIamPermissionCall<'a, C, A> {} + +impl<'a, C, A> BucketTestIamPermissionCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.buckets.testIamPermissions", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); + params.push(("bucket", self._bucket.to_string())); + if self._permissions.len() > 0 { + for f in self._permissions.iter() { + params.push(("permissions", f.to_string())); + } + } + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "permissions", "userProject"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/iam/testPermissions".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 a bucket. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> BucketTestIamPermissionCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// Permissions to test. + /// + /// Append the given value to the *permissions* query 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_permissions(mut self, new_value: &str) -> BucketTestIamPermissionCall<'a, C, A> { + self._permissions.push(new_value.to_string()); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> BucketTestIamPermissionCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> BucketTestIamPermissionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> BucketTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> BucketTestIamPermissionCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Updates an IAM policy for the specified bucket. +/// +/// A builder for the *setIamPolicy* method supported by a *bucket* resource. +/// It is not used directly, but through a `BucketMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// use storage1::Policy; /// # #[test] fn egal() { /// # use std::default::Default; /// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; @@ -12176,43 +15572,35 @@ impl<'a, C, A> BucketInsertCall<'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 = Bucket::default(); +/// let mut req = Policy::default(); /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! -/// let result = hub.buckets().patch(req, "bucket") -/// .projection("dolor") -/// .predefined_default_object_acl("aliquyam") -/// .predefined_acl("elitr") -/// .if_metageneration_not_match("ea") -/// .if_metageneration_match("et") +/// let result = hub.buckets().set_iam_policy(req, "bucket") +/// .user_project("aliquyam") /// .doit(); /// # } /// ``` -pub struct BucketPatchCall<'a, C, A> +pub struct BucketSetIamPolicyCall<'a, C, A> where C: 'a, A: 'a { hub: &'a Storage, - _request: Bucket, + _request: Policy, _bucket: String, - _projection: Option, - _predefined_default_object_acl: Option, - _predefined_acl: Option, - _if_metageneration_not_match: Option, - _if_metageneration_match: Option, + _user_project: Option, _delegate: Option<&'a mut Delegate>, _additional_params: HashMap, _scopes: BTreeMap } -impl<'a, C, A> CallBuilder for BucketPatchCall<'a, C, A> {} +impl<'a, C, A> CallBuilder for BucketSetIamPolicyCall<'a, C, A> {} -impl<'a, C, A> BucketPatchCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { +impl<'a, C, A> BucketSetIamPolicyCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, Bucket)> { + pub fn doit(mut self) -> Result<(hyper::client::Response, Policy)> { use std::io::{Read, Seek}; use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; let mut dd = DefaultDelegate; @@ -12220,26 +15608,14 @@ impl<'a, C, A> BucketPatchCall<'a, C, A> where C: BorrowMut, A: o Some(d) => d, None => &mut dd }; - dlg.begin(MethodInfo { id: "storage.buckets.patch", - http_method: hyper::method::Method::Patch }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len())); + dlg.begin(MethodInfo { id: "storage.buckets.setIamPolicy", + http_method: hyper::method::Method::Put }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((5 + self._additional_params.len())); params.push(("bucket", self._bucket.to_string())); - if let Some(value) = self._projection { - params.push(("projection", value.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); } - if let Some(value) = self._predefined_default_object_acl { - params.push(("predefinedDefaultObjectAcl", value.to_string())); - } - if let Some(value) = self._predefined_acl { - params.push(("predefinedAcl", value.to_string())); - } - if let Some(value) = self._if_metageneration_not_match { - params.push(("ifMetagenerationNotMatch", value.to_string())); - } - if let Some(value) = self._if_metageneration_match { - params.push(("ifMetagenerationMatch", value.to_string())); - } - for &field in ["alt", "bucket", "projection", "predefinedDefaultObjectAcl", "predefinedAcl", "ifMetagenerationNotMatch", "ifMetagenerationMatch"].iter() { + for &field in ["alt", "bucket", "userProject"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -12251,7 +15627,7 @@ impl<'a, C, A> BucketPatchCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "b/{bucket}"; + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/iam".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12313,7 +15689,7 @@ impl<'a, C, A> BucketPatchCall<'a, C, A> where C: BorrowMut, A: o request_value_reader.seek(io::SeekFrom::Start(0)).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) + 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())) @@ -12374,7 +15750,7 @@ impl<'a, C, A> BucketPatchCall<'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: Bucket) -> BucketPatchCall<'a, C, A> { + pub fn request(mut self, new_value: Policy) -> BucketSetIamPolicyCall<'a, C, A> { self._request = new_value; self } @@ -12384,43 +15760,15 @@ impl<'a, C, A> BucketPatchCall<'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 bucket(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { + pub fn bucket(mut self, new_value: &str) -> BucketSetIamPolicyCall<'a, C, A> { self._bucket = new_value.to_string(); self } - /// Set of properties to return. Defaults to full. + /// The project number to be billed for this request, for Requester Pays buckets. /// - /// Sets the *projection* query property to the given value. - pub fn projection(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { - self._projection = Some(new_value.to_string()); - self - } - /// Apply a predefined set of default object access controls to this bucket. - /// - /// Sets the *predefined default object acl* query property to the given value. - pub fn predefined_default_object_acl(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { - self._predefined_default_object_acl = Some(new_value.to_string()); - self - } - /// Apply a predefined set of access controls to this bucket. - /// - /// Sets the *predefined acl* query property to the given value. - pub fn predefined_acl(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { - self._predefined_acl = Some(new_value.to_string()); - self - } - /// Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value. - /// - /// Sets the *if metageneration not match* query property to the given value. - pub fn if_metageneration_not_match(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { - self._if_metageneration_not_match = Some(new_value.to_string()); - self - } - /// Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value. - /// - /// Sets the *if metageneration match* query property to the given value. - pub fn if_metageneration_match(mut self, new_value: &str) -> BucketPatchCall<'a, C, A> { - self._if_metageneration_match = Some(new_value.to_string()); + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> BucketSetIamPolicyCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); self } /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong @@ -12429,7 +15777,7 @@ impl<'a, C, A> BucketPatchCall<'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) -> BucketPatchCall<'a, C, A> { + pub fn delegate(mut self, new_value: &'a mut Delegate) -> BucketSetIamPolicyCall<'a, C, A> { self._delegate = Some(new_value); self } @@ -12450,7 +15798,7 @@ impl<'a, C, A> BucketPatchCall<'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) -> BucketPatchCall<'a, C, A> + pub fn param(mut self, name: T, value: T) -> BucketSetIamPolicyCall<'a, C, A> where T: AsRef { self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); self @@ -12467,7 +15815,254 @@ impl<'a, C, A> BucketPatchCall<'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) -> BucketPatchCall<'a, C, A> + pub fn add_scope(mut self, scope: T) -> BucketSetIamPolicyCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Returns an IAM policy for the specified bucket. +/// +/// A builder for the *getIamPolicy* method supported by a *bucket* resource. +/// It is not used directly, but through a `BucketMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.buckets().get_iam_policy("bucket") +/// .user_project("magna") +/// .doit(); +/// # } +/// ``` +pub struct BucketGetIamPolicyCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _bucket: String, + _user_project: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for BucketGetIamPolicyCall<'a, C, A> {} + +impl<'a, C, A> BucketGetIamPolicyCall<'a, C, 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 std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.buckets.getIamPolicy", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((4 + self._additional_params.len())); + params.push(("bucket", self._bucket.to_string())); + if let Some(value) = self._user_project { + params.push(("userProject", value.to_string())); + } + for &field in ["alt", "bucket", "userProject"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/b/{bucket}/iam".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{bucket}", "bucket")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["bucket"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 a bucket. + /// + /// Sets the *bucket* path property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + pub fn bucket(mut self, new_value: &str) -> BucketGetIamPolicyCall<'a, C, A> { + self._bucket = new_value.to_string(); + self + } + /// The project number to be billed for this request, for Requester Pays buckets. + /// + /// Sets the *user project* query property to the given value. + pub fn user_project(mut self, new_value: &str) -> BucketGetIamPolicyCall<'a, C, A> { + self._user_project = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> BucketGetIamPolicyCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> BucketGetIamPolicyCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> BucketGetIamPolicyCall<'a, C, A> where T: AsRef { self._scopes.insert(scope.as_ref().to_string(), ()); self @@ -12502,10 +16097,10 @@ impl<'a, C, A> BucketPatchCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.buckets().list("project") -/// .projection("sed") -/// .prefix("dolor") -/// .page_token("sanctus") -/// .max_results(68) +/// .projection("sit") +/// .prefix("gubergren") +/// .page_token("sit") +/// .max_results(4) /// .doit(); /// # } /// ``` @@ -12565,7 +16160,7 @@ impl<'a, C, A> BucketListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "b"; + let mut url = "https://www.googleapis.com/storage/v1/b".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -12678,7 +16273,7 @@ impl<'a, C, A> BucketListCall<'a, C, A> where C: BorrowMut, A: oa self._page_token = Some(new_value.to_string()); self } - /// Maximum number of buckets to return. + /// Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller. /// /// Sets the *max results* query property to the given value. pub fn max_results(mut self, new_value: u32) -> BucketListCall<'a, C, A> { @@ -12737,3 +16332,239 @@ impl<'a, C, A> BucketListCall<'a, C, A> where C: BorrowMut, A: oa } +/// Get the email address of this project's GCS service account. +/// +/// A builder for the *serviceAccount.get* method supported by a *project* resource. +/// It is not used directly, but through a `ProjectMethods` instance. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_storage1 as storage1; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use storage1::Storage; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = Storage::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.projects().service_account_get("projectId") +/// .doit(); +/// # } +/// ``` +pub struct ProjectServiceAccountGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storage, + _project_id: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for ProjectServiceAccountGetCall<'a, C, A> {} + +impl<'a, C, A> ProjectServiceAccountGetCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, ServiceAccount)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "storage.projects.serviceAccount.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("projectId", self._project_id.to_string())); + for &field in ["alt", "projectId"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/storage/v1/projects/{projectId}/serviceAccount".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{projectId}", "projectId")].iter() { + let mut replace_with: Option<&str> = None; + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = Some(value); + break; + } + } + url = url.replace(find_this, replace_with.expect("to find substitution value in params")); + } + { + let mut indices_for_removal: Vec = Vec::with_capacity(1); + for param_name in ["projectId"].iter() { + if let Some(index) = params.iter().position(|t| &t.0 == param_name) { + indices_for_removal.push(index); + } + } + for &index in indices_for_removal.iter() { + params.remove(index); + } + } + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// Project ID + /// + /// 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) -> ProjectServiceAccountGetCall<'a, C, A> { + self._project_id = new_value.to_string(); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> ProjectServiceAccountGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> ProjectServiceAccountGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> ProjectServiceAccountGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + + diff --git a/gen/storagetransfer1-cli/Cargo.toml b/gen/storagetransfer1-cli/Cargo.toml index 2f14d2132c..6daf71d5ad 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.4+20150811" +version = "1.0.4+20170515" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-storagetransfer1] path = "../storagetransfer1" -version = "1.0.4+20150811" +version = "1.0.4+20170515" diff --git a/gen/storagetransfer1-cli/README.md b/gen/storagetransfer1-cli/README.md index 1261fc41b0..ed8de7d844 100644 --- a/gen/storagetransfer1-cli/README.md +++ b/gen/storagetransfer1-cli/README.md @@ -25,14 +25,12 @@ 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 *20150811*. The CLI is at version *1.0.4*. +This documentation was generated from the *storagetransfer* API at revision *20170515*. The CLI is at version *1.0.4*. ```bash storagetransfer1 [options] google-service-accounts get [-p ]... [-o ] - methods - get-google-service-account [-p ]... [-o ] transfer-jobs create (-r )... [-p ]... [-o ] get [-p ]... [-o ] diff --git a/gen/storagetransfer1-cli/mkdocs.yml b/gen/storagetransfer1-cli/mkdocs.yml index 6996d1f158..d9d26a2795 100644 --- a/gen/storagetransfer1-cli/mkdocs.yml +++ b/gen/storagetransfer1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: storagetransfer v1.0.4+20150811 +site_name: storagetransfer v1.0.4+20170515 site_url: http://byron.github.io/google-apis-rs/google-storagetransfer1-cli site_description: A complete library to interact with storagetransfer (protocol v1) @@ -10,7 +10,6 @@ site_dir: build_html pages: - ['index.md', 'Home'] - ['google-service-accounts_get.md', 'Google Service Accounts', 'Get'] -- ['methods_get-google-service-account.md', 'Methods', 'Get Google Service Account'] - ['transfer-jobs_create.md', 'Transfer Jobs', 'Create'] - ['transfer-jobs_get.md', 'Transfer Jobs', 'Get'] - ['transfer-jobs_list.md', 'Transfer Jobs', 'List'] diff --git a/gen/storagetransfer1-cli/src/main.rs b/gen/storagetransfer1-cli/src/main.rs index d787f546a2..ea1440d3ee 100644 --- a/gen/storagetransfer1-cli/src/main.rs +++ b/gen/storagetransfer1-cli/src/main.rs @@ -98,62 +98,6 @@ impl<'n> Engine<'n> { } } - fn _methods_get_google_service_account(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) - -> Result<(), DoitError> { - let mut call = self.hub.methods().get_google_service_account(); - for parg in 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 _transfer_jobs_create(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { @@ -192,21 +136,21 @@ 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.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 })), - "schedule.start-time-of-day.hours" => Some(("schedule.startTimeOfDay.hours", 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.minutes" => Some(("schedule.startTimeOfDay.minutes", 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.schedule-end-date.month" => Some(("schedule.scheduleEndDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "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())))); @@ -426,21 +370,21 @@ 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.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 })), - "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.seconds" => Some(("transferJob.schedule.startTimeOfDay.seconds", 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.nanos" => Some(("transferJob.schedule.startTimeOfDay.nanos", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "transfer-job.schedule.schedule-end-date.month" => Some(("transferJob.schedule.scheduleEndDate.month", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), "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())))); @@ -904,17 +848,6 @@ impl<'n> Engine<'n> { } } }, - ("methods", Some(opt)) => { - match opt.subcommand() { - ("get-google-service-account", Some(opt)) => { - call_result = self._methods_get_google_service_account(opt, dry_run, &mut err); - }, - _ => { - err.issues.push(CLIError::MissingMethodError("methods".to_string())); - writeln!(io::stderr(), "{}\n", opt.usage()).ok(); - } - } - }, ("transfer-jobs", Some(opt)) => { match opt.subcommand() { ("create", Some(opt)) => { @@ -1049,12 +982,21 @@ fn main() { let arg_data = [ ("google-service-accounts", "methods: 'get'", vec![ ("get", - Some(r##"Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service."##), + Some(r##"Returns the Google service account that is used by Storage Transfer + Service to access buckets in the project where transfers + run or in other projects. Each Google service account is associated + with one Google Cloud Platform Console project. Users + should add this service account to the Google Cloud Storage bucket + ACLs to grant access to Storage Transfer Service. This service + account is created and owned by Storage Transfer Service and can + only be used by Storage Transfer Service."##), "Details at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli/google-service-accounts_get", vec![ (Some(r##"project-id"##), None, - Some(r##"The ID of the Google Developers Console project that the Google service account is associated with. Required."##), + Some(r##"The ID of the Google Cloud Platform Console project that the Google service + account is associated with. + Required."##), Some(true), Some(false)), @@ -1072,25 +1014,6 @@ fn main() { ]), ]), - ("methods", "methods: 'get-google-service-account'", vec![ - ("get-google-service-account", - Some(r##"Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service."##), - "Details at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli/methods_get-google-service-account", - 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)), - ]), - ]), - ("transfer-jobs", "methods: 'create', 'get', 'list' and 'patch'", vec![ ("create", Some(r##"Creates a transfer job that runs periodically."##), @@ -1120,7 +1043,8 @@ fn main() { vec![ (Some(r##"job-name"##), None, - Some(r##"The job to get. Required."##), + Some(r##"The job to get. + Required."##), Some(true), Some(false)), @@ -1153,12 +1077,15 @@ fn main() { Some(false)), ]), ("patch", - Some(r##"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."##), + Some(r##"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."##), "Details at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli/transfer-jobs_patch", vec![ (Some(r##"job-name"##), None, - Some(r##"The name of job to update. Required."##), + Some(r##"The name of job to update. + Required."##), Some(true), Some(false)), @@ -1228,7 +1155,9 @@ fn main() { 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."##), + 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_storagetransfer1_cli/transfer-operations_get", vec![ (Some(r##"name"##), @@ -1250,7 +1179,11 @@ fn main() { 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 below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`."##), + Some(r##"Lists operations that match the specified filter in the request. If the + server doesn't support this method, it returns `UNIMPLEMENTED`. + + NOTE: the `name` binding below allows API services to override the binding + to use different resource name schemes, such as `users/*/operations`."##), "Details at http://byron.github.io/google-apis-rs/google_storagetransfer1_cli/transfer-operations_list", vec![ (Some(r##"name"##), @@ -1277,7 +1210,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the transfer operation. Required."##), + Some(r##"The name of the transfer operation. + Required."##), Some(true), Some(false)), @@ -1305,7 +1239,8 @@ fn main() { vec![ (Some(r##"name"##), None, - Some(r##"The name of the transfer operation. Required."##), + Some(r##"The name of the transfer operation. + Required."##), Some(true), Some(false)), @@ -1333,7 +1268,7 @@ fn main() { let mut app = App::new("storagetransfer1") .author("Sebastian Thiel ") - .version("1.0.4+20150811") + .version("1.0.4+20170515") .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 52f398f878..4e7bcd6b6c 100644 --- a/gen/storagetransfer1/Cargo.toml +++ b/gen/storagetransfer1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-storagetransfer1" -version = "1.0.4+20150811" +version = "1.0.4+20170515" 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.4+20150811" +documentation = "https://docs.rs/google-storagetransfer1/1.0.4+20170515" license = "MIT" keywords = ["storagetransfer", "google", "protocol", "web", "api"] diff --git a/gen/storagetransfer1/README.md b/gen/storagetransfer1/README.md index bf55e3eb80..0b7db428a0 100644 --- a/gen/storagetransfer1/README.md +++ b/gen/storagetransfer1/README.md @@ -5,24 +5,21 @@ 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.4+20150811*, where *20150811* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *storagetransfer* crate version *1.0.4+20170515*, where *20170515* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20150811/google_storagetransfer1/struct.Storagetransfer.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.Storagetransfer.html) ... -* [google service accounts](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.GoogleServiceAccount.html) - * [*get*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.GoogleServiceAccountGetCall.html) -* [transfer jobs](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferJob.html) - * [*create*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferJobCreateCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferJobGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferJobListCall.html) and [*patch*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferJobPatchCall.html) -* [transfer operations](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferOperation.html) - * [*cancel*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferOperationCancelCall.html), [*delete*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferOperationDeleteCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferOperationGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferOperationListCall.html), [*pause*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferOperationPauseCall.html) and [*resume*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.TransferOperationResumeCall.html) +* [google service accounts](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.GoogleServiceAccount.html) + * [*get*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.GoogleServiceAccountGetCall.html) +* [transfer jobs](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferJob.html) + * [*create*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferJobCreateCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferJobGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferJobListCall.html) and [*patch*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferJobPatchCall.html) +* [transfer operations](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferOperation.html) + * [*cancel*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferOperationCancelCall.html), [*delete*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferOperationDeleteCall.html), [*get*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferOperationGetCall.html), [*list*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferOperationListCall.html), [*pause*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferOperationPauseCall.html) and [*resume*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/struct.TransferOperationResumeCall.html) -Other activities are ... - -* [get google service account](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.MethodGetGoogleServiceAccountCall.html) @@ -30,17 +27,17 @@ Other activities are ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/struct.Storagetransfer.html)** +* **[Hub](https://docs.rs/google-storagetransfer1/1.0.4+20170515/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.4+20150811/google_storagetransfer1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-storagetransfer1/1.0.4+20170515/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.4+20150811/google_storagetransfer1/trait.Part.html)** + * **[Parts](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-storagetransfer1/1.0.4+20150811/google_storagetransfer1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-storagetransfer1/1.0.4+20170515/google_storagetransfer1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -130,17 +127,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-storagetransfer1/1.0.4+20150811/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.4+20170515/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.4+20150811/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.4+20170515/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.4+20150811/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.4+20170515/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.4+20150811/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.4+20170515/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")`. @@ -150,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-storagetransfer1/1.0.4+20150811/google_storagetransfer1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-storagetransfer1/1.0.4+20150811/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.4+20170515/google_storagetransfer1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-storagetransfer1/1.0.4+20170515/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.4+20150811/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.4+20170515/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.4+20150811/google_storagetransfer1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-storagetransfer1/1.0.4+20150811/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.4+20170515/google_storagetransfer1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-storagetransfer1/1.0.4+20170515/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.4+20150811/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.4+20170515/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.4+20150811/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.4+20170515/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.4+20150811/google_storagetransfer1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-storagetransfer1/1.0.4+20170515/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 e499eca76f..e5c124aab6 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.4+20150811*, where *20150811* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *storagetransfer* crate version *1.0.4+20170515*, where *20170515* is the exact revision of the *storagetransfer:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *storagetransfer* *v1* API can be found at the //! [official documentation site](https://cloud.google.com/storage/transfer). @@ -18,9 +18,6 @@ //! * [transfer operations](struct.TransferOperation.html) //! * [*cancel*](struct.TransferOperationCancelCall.html), [*delete*](struct.TransferOperationDeleteCall.html), [*get*](struct.TransferOperationGetCall.html), [*list*](struct.TransferOperationListCall.html), [*pause*](struct.TransferOperationPauseCall.html) and [*resume*](struct.TransferOperationResumeCall.html) //! -//! Other activities are ... -//! -//! * [get google service account](struct.MethodGetGoogleServiceAccountCall.html) //! //! //! @@ -185,7 +182,7 @@ // 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 +// 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)] @@ -313,8 +310,6 @@ pub struct Storagetransfer { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Storagetransfer {} @@ -327,17 +322,12 @@ impl<'a, C, A> Storagetransfer client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://storagetransfer.googleapis.com/".to_string(), - _root_url: "https://storagetransfer.googleapis.com/".to_string(), } } pub fn google_service_accounts(&'a self) -> GoogleServiceAccountMethods<'a, C, A> { GoogleServiceAccountMethods { hub: &self } } - pub fn methods(&'a self) -> MethodMethods<'a, C, A> { - MethodMethods { hub: &self } - } pub fn transfer_jobs(&'a self) -> TransferJobMethods<'a, C, A> { TransferJobMethods { hub: &self } } @@ -354,32 +344,27 @@ impl<'a, C, A> Storagetransfer self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://storagetransfer.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://storagetransfer.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } // ############ // 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. @@ -389,10 +374,14 @@ pub struct TransferSpec { /// An HTTP URL data source. #[serde(rename="httpDataSource")] pub http_data_source: Option, - /// If the option `deleteObjectsUniqueInSink` is `true`, object conditions based on objects' `lastModificationTime` are ignored and do not exclude objects in a data source or a data sink. + /// If the option `deleteObjectsUniqueInSink` is `true`, object conditions + /// based on objects' `lastModificationTime` are ignored and do not exclude + /// objects in a data source or a data sink. #[serde(rename="transferOptions")] pub transfer_options: Option, - /// Only objects that satisfy these object conditions are included in the set of data source and data sink objects. Object conditions based on objects' `lastModificationTime` do not exclude objects in a data sink. + /// Only objects that satisfy these object conditions are included in the set + /// of data source and data sink objects. Object conditions based on + /// objects' `lastModificationTime` do not exclude objects in a data sink. #[serde(rename="objectConditions")] pub object_conditions: Option, /// A Google Cloud Storage data source. @@ -409,31 +398,19 @@ 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)). +/// AWS access key (see +/// [AWS Security Credentials](http://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html)). /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct AwsAccessKey { - /// AWS secret access key. This field is not returned in RPC responses. Required. + /// AWS secret access key. This field is not returned in RPC responses. + /// Required. #[serde(rename="secretAccessKey")] pub secret_access_key: Option, - /// AWS access key ID. Required. + /// AWS access key ID. + /// Required. #[serde(rename="accessKeyId")] pub access_key_id: Option, } @@ -447,16 +424,58 @@ impl Part for AwsAccessKey {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ObjectConditions { - /// `maxTimeElapsedSinceLastModification` is the complement to `minTimeElapsedSinceLastModification`. + /// `maxTimeElapsedSinceLastModification` is the complement to + /// `minTimeElapsedSinceLastModification`. #[serde(rename="maxTimeElapsedSinceLastModification")] pub max_time_elapsed_since_last_modification: Option, - /// If `includePrefixes` is specified, objects that satisfy the object conditions must have names that start with one of the `includePrefixes` and that do not start with any of the `excludePrefixes`. If `includePrefixes` is not specified, all objects except those that have names starting with one of the `excludePrefixes` must satisfy the object conditions. Requirements: * Each include-prefix and exclude-prefix can contain any sequence of Unicode characters, of max length 1024 bytes when UTF8-encoded, and must not contain Carriage Return or Line Feed characters. Wildcard matching and regular expression matching are not supported. * None of the include-prefix or the exclude-prefix values can be empty, if specified. * Each include-prefix must include a distinct portion of the object namespace, i.e., no include-prefix may be a prefix of another include-prefix. * Each exclude-prefix must exclude a distinct portion of the object namespace, i.e., no exclude-prefix may be a prefix of another exclude-prefix. * If `includePrefixes` is specified, then each exclude-prefix must start with the value of a path explicitly included by `includePrefixes`. The max size of `includePrefixes` is 20. + /// If `includePrefixes` is specified, objects that satisfy the object + /// conditions must have names that start with one of the `includePrefixes` + /// and that do not start with any of the `excludePrefixes`. If `includePrefixes` + /// is not specified, all objects except those that have names starting with + /// one of the `excludePrefixes` must satisfy the object conditions. + /// + /// Requirements: + /// + /// * Each include-prefix and exclude-prefix can contain any sequence of + /// Unicode characters, of max length 1024 bytes when UTF8-encoded, and + /// must not contain Carriage Return or Line Feed characters. Wildcard + /// matching and regular expression matching are not supported. + /// + /// * Each include-prefix and exclude-prefix must omit the leading slash. + /// For example, to include the `requests.gz` object in a transfer from + /// `s3://my-aws-bucket/logs/y=2015/requests.gz`, specify the include + /// prefix as `logs/y=2015/requests.gz`. + /// + /// * None of the include-prefix or the exclude-prefix values can be empty, + /// if specified. + /// + /// * Each include-prefix must include a distinct portion of the object + /// namespace, i.e., no include-prefix may be a prefix of another + /// include-prefix. + /// + /// * Each exclude-prefix must exclude a distinct portion of the object + /// namespace, i.e., no exclude-prefix may be a prefix of another + /// exclude-prefix. + /// + /// * If `includePrefixes` is specified, then each exclude-prefix must start + /// with the value of a path explicitly included by `includePrefixes`. + /// + /// The max size of `includePrefixes` is 1000. #[serde(rename="includePrefixes")] pub include_prefixes: Option>, - /// `excludePrefixes` must follow the requirements described for `includePrefixes`. The max size of `excludePrefixes` is 20. + /// `excludePrefixes` must follow the requirements described for + /// `includePrefixes`. + /// + /// The max size of `excludePrefixes` is 1000. #[serde(rename="excludePrefixes")] pub exclude_prefixes: Option>, - /// If unspecified, `minTimeElapsedSinceLastModification` takes a zero value and `maxTimeElapsedSinceLastModification` takes the maximum possible value of Duration. Objects that satisfy the object conditions must either have a `lastModificationTime` greater or equal to `NOW` - `maxTimeElapsedSinceLastModification` and less than `NOW` - `minTimeElapsedSinceLastModification`, or not have a `lastModificationTime`. + /// If unspecified, `minTimeElapsedSinceLastModification` takes a zero value + /// and `maxTimeElapsedSinceLastModification` takes the maximum possible + /// value of Duration. Objects that satisfy the object conditions + /// must either have a `lastModificationTime` greater or equal to + /// `NOW` - `maxTimeElapsedSinceLastModification` and less than + /// `NOW` - `minTimeElapsedSinceLastModification`, or not have a + /// `lastModificationTime`. #[serde(rename="minTimeElapsedSinceLastModification")] pub min_time_elapsed_since_last_modification: Option, } @@ -470,10 +489,13 @@ impl Part for ObjectConditions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TransferCounters { - /// Bytes in the data source that are not transferred because they already exist in the data sink. + /// Bytes in the data source that are not transferred because they already + /// exist in the data sink. #[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. + /// 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. #[serde(rename="objectsFoundFromSource")] pub objects_found_from_source: Option, /// Bytes that failed to be deleted from the data sink. @@ -485,13 +507,16 @@ pub struct TransferCounters { /// Objects found only in the data sink that are scheduled to be deleted. #[serde(rename="objectsFoundOnlyFromSink")] pub objects_found_only_from_sink: Option, - /// Objects in the data source that are not transferred because they already exist in the data sink. + /// Objects in the data source that are not transferred because they already + /// exist in the data sink. #[serde(rename="objectsFromSourceSkippedBySync")] pub objects_from_source_skipped_by_sync: Option, /// 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. + /// 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, /// Objects that are deleted from the data source. @@ -539,7 +564,8 @@ impl Part for TransferCounters {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TransferOperation { - /// Transfer specification. Required. + /// Transfer specification. + /// Required. #[serde(rename="transferSpec")] pub transfer_spec: Option, /// Status of the transfer operation. @@ -549,7 +575,8 @@ pub struct TransferOperation { pub transfer_job_name: Option, /// A globally unique ID assigned by the system. pub name: Option, - /// The ID of the Google Developers Console project that owns the operation. Required. + /// The ID of the Google Cloud Platform Console project that owns the operation. + /// Required. #[serde(rename="projectId")] pub project_id: Option, /// Summarizes errors encountered with sample error log entries. @@ -568,16 +595,22 @@ pub struct TransferOperation { impl Resource for TransferOperation {} -/// An AwsS3Data can be a data source, but not a data sink. In an AwsS3Data, an object's name is the S3 object's key name. +/// 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. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[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. + /// 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. + /// 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, } @@ -591,7 +624,9 @@ impl Part for AwsS3Data {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ErrorLogEntry { - /// A URL that refers to the target (a data source, a data sink, or an object) with which the error is associated. Required. + /// 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")] @@ -601,13 +636,17 @@ pub struct ErrorLogEntry { impl Part for ErrorLogEntry {} -/// In a GcsData, an object's name is the Google Cloud Storage object's name and its `lastModificationTime` refers to the object's updated time, which changes when the content or the metadata of the object is updated. +/// In a GcsData, an object's name is the Google Cloud Storage object's name and +/// its `lastModificationTime` refers to the object's updated time, which changes +/// when the content or the metadata of the object is updated. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct GcsData { - /// Google Cloud Storage bucket name (see [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). Required. + /// Google Cloud Storage bucket name (see + /// [Bucket Name Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)). + /// Required. #[serde(rename="bucketName")] pub bucket_name: Option, } @@ -615,13 +654,56 @@ pub struct GcsData { impl Part for GcsData {} -/// An HttpData specifies a list of objects on the web to be transferred over HTTP. The information of the objects to be transferred is contained in a file referenced by a URL. The first line in the file must be "TsvHttpData-1.0", which specifies the format of the file. Subsequent lines specify the information of the list of objects, one object per list entry. Each entry has the following tab-delimited fields: * HTTP URL * Length * MD5 - This field is a base64-encoded MD5 hash of the object An HTTP URL that points to the object to be transferred. It must be a valid URL with URL scheme HTTP or HTTPS. When an object with URL `http(s)://hostname:port/` is transferred to the data sink, the name of the object at the data sink is `/`. Length and MD5 provide the size and the base64-encoded MD5 hash of the object. If Length does not match the actual length of the object fetched, the object will not be transferred. If MD5 does not match the MD5 computed from the transferred bytes, the object transfer will fail. `lastModificationTime` is not available in HttpData objects. The objects that the URL list points to must allow public access. Storage Transfer Service obeys `robots.txt` rules and requires the HTTP server to support Range requests and to return a Content-Length header in each response. +/// An HttpData specifies a list of objects on the web to be transferred over +/// HTTP. The information of the objects to be transferred is contained in a +/// file referenced by a URL. The first line in the file must be +/// "TsvHttpData-1.0", which specifies the format of the file. Subsequent lines +/// specify the information of the list of objects, one object per list entry. +/// Each entry has the following tab-delimited fields: +/// +/// * HTTP URL - The location of the object. +/// +/// * Length - The size of the object in bytes. +/// +/// * MD5 - The base64-encoded MD5 hash of the object. +/// +/// For an example of a valid TSV file, see +/// [Transferring data from URLs](https://cloud.google.com/storage/transfer/#urls) +/// +/// When transferring data based on a URL list, keep the following in mind: +/// +/// * When an object located at `http(s)://hostname:port/` is transferred +/// to a data sink, the name of the object at the data sink is +/// `/`. +/// +/// * If the specified size of an object does not match the actual size of the +/// object fetched, the object will not be transferred. +/// +/// * If the specified MD5 does not match the MD5 computed from the transferred +/// bytes, the object transfer will fail. For more information, see +/// [Generating MD5 hashes](https://cloud.google.com/storage/transfer/#md5) +/// +/// * Ensure that each URL you specify is publicly accessible. For +/// example, in Google Cloud Storage you can +/// [share an object publicly] +/// (https://cloud.google.com/storage/docs/cloud-console#_sharingdata) and get +/// a link to it. +/// +/// * Storage Transfer Service obeys `robots.txt` rules and requires the source +/// HTTP server to support `Range` requests and to return a `Content-Length` +/// header in each response. +/// +/// * [ObjectConditions](#ObjectConditions) have no effect when filtering objects +/// to transfer. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct HttpData { - /// The URL that points to the file that stores the object list entries. This file must allow public access. Currently, only URLs with HTTP and HTTPS schemes are supported. Required. + /// The URL that points to the file that stores the object list entries. + /// This file must allow public access. Currently, only URLs with HTTP and + /// HTTPS schemes are supported. + /// Required. #[serde(rename="listUrl")] pub list_url: Option, } @@ -629,26 +711,38 @@ pub struct HttpData { impl Part for HttpData {} -/// Represents a time of day. The date and time zone are either not significant or are specified elsewhere. An API may chose to allow leap seconds. Related types are [google.type.Date][google.type.Date] and `google.protobuf.Timestamp`. +/// 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 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. + /// 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, - /// 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, /// 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, } impl Part for TimeOfDay {} -/// 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 `{}`. +/// 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 /// @@ -666,17 +760,71 @@ 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][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` which can be used for common error conditions. # Language mapping The `Status` message is the logical representation of the error model, but it is not necessarily the actual wire format. When the `Status` message is exposed in different client libraries and different wire protocols, it can be mapped differently. For example, it will likely be mapped to some exceptions in Java, but more likely mapped to some error codes in C. # Other uses The error model and the `Status` message can be used in a variety of environments, either with or without APIs, to provide 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 purpose. - Batch operations. If a client uses batch request and batch response, the `Status` message should be used directly inside batch response, one for each error sub-response. - Asynchronous operations. If an API call embeds asynchronous operation results in its response, the status of those operations should be represented directly using the `Status` message. - Logging. If some API errors are stored in logs, the message `Status` could be used directly after any stripping needed for security/privacy reasons. +/// 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][google.rpc.Status.details] field, or localized by the client. + /// 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][google.rpc.Code]. + /// The status code, which should be an enum value of google.rpc.Code. pub code: Option, - /// A list of messages that carry the error details. There will be a common set of message types for APIs to use. + /// A list of messages that carry the error details. There will be a + /// common set of message types for APIs to use. pub details: Option>>, } @@ -690,7 +838,6 @@ impl Part for Status {} /// This type is used in activities, which are methods you may call on this type or where 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 google service account](struct.MethodGetGoogleServiceAccountCall.html) (response) /// * [get google service accounts](struct.GoogleServiceAccountGetCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] @@ -704,7 +851,7 @@ impl Resource for GoogleServiceAccount {} impl ResponseResult for GoogleServiceAccount {} -/// The response message for [Operations.ListOperations][google.longrunning.Operations.ListOperations]. +/// The response message for Operations.ListOperations. /// /// # Activities /// @@ -731,13 +878,24 @@ impl ResponseResult for ListOperationsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Schedule { - /// The first day the recurring transfer is scheduled to run. Required. - #[serde(rename="scheduleStartDate")] - pub schedule_start_date: Option, - /// The time in UTC at which the transfer will be scheduled to start in a day. Transfers may start later than this time. If not specified, transfers are scheduled to start at midnight UTC. + /// The time in UTC at which the transfer will be scheduled to start in a day. + /// Transfers may start later than this time. If not specified, recurring and + /// one-time transfers that are scheduled to run today will run immediately; + /// recurring transfers that are scheduled to run on a future date will start + /// at approximately midnight UTC on that date. Note that when configuring a + /// transfer with the Cloud Platform Console, the transfer's start time in a + /// day is specified in your local timezone. #[serde(rename="startTimeOfDay")] pub start_time_of_day: Option, - /// The last day the recurring transfer will be run. If `scheduleEndDate` is the same as `scheduleStartDate`, the transfer will be executed only once. + /// The first day the recurring transfer is scheduled to run. If + /// `scheduleStartDate` is in the past, the transfer will run for the first + /// time on the following day. + /// Required. + #[serde(rename="scheduleStartDate")] + pub schedule_start_date: Option, + /// The last day the recurring transfer will be run. If `scheduleEndDate` + /// is the same as `scheduleStartDate`, the transfer will be executed only + /// once. #[serde(rename="scheduleEndDate")] pub schedule_end_date: Option, } @@ -745,7 +903,8 @@ pub struct Schedule { impl Part for Schedule {} -/// A summary of errors by error code, plus a count and sample error log entries. +/// A summary of errors by error code, plus a count and sample error log +/// entries. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -757,7 +916,8 @@ pub struct ErrorSummary { /// Error samples. #[serde(rename="errorLogEntries")] pub error_log_entries: Option>, - /// Count of this type of error. Required. + /// Count of this type of error. + /// Required. #[serde(rename="errorCount")] pub error_count: Option, } @@ -791,13 +951,20 @@ impl RequestValue for ResumeTransferOperationRequest {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct UpdateTransferJobRequest { - /// The ID of the Google Developers Console project that owns the job. Required. + /// The ID of the Google Cloud Platform Console project that owns the job. + /// Required. #[serde(rename="projectId")] pub project_id: Option, - /// The field mask of the fields in `transferJob` that are to be updated in this request. Fields in `transferJob` that can be updated are: `description`, `transferSpec`, and `status`. To update the `transferSpec` of the job, a complete transfer specification has to be provided. An incomplete specification which misses any required fields will be rejected with the error `INVALID_ARGUMENT`. + /// The field mask of the fields in `transferJob` that are to be updated in + /// this request. Fields in `transferJob` that can be updated are: + /// `description`, `transferSpec`, and `status`. To update the `transferSpec` + /// of the job, a complete transfer specification has to be provided. An + /// incomplete specification which misses any required fields will be rejected + /// with the error `INVALID_ARGUMENT`. #[serde(rename="updateTransferJobFieldMask")] pub update_transfer_job_field_mask: Option, - /// The job to update. Required. + /// The job to update. + /// Required. #[serde(rename="transferJob")] pub transfer_job: Option, } @@ -827,7 +994,8 @@ pub struct ListTransferJobsResponse { impl ResponseResult for ListTransferJobsResponse {} -/// TransferOptions uses three boolean parameters to define the actions to be performed on objects in a transfer. +/// TransferOptions uses three boolean parameters to define the actions +/// to be performed on objects in a transfer. /// /// This type is not used in any activity, and only used as *part* of another schema. /// @@ -836,7 +1004,8 @@ pub struct TransferOptions { /// Whether overwriting objects that already exist in the sink is allowed. #[serde(rename="overwriteObjectsAlreadyExistingInSink")] pub overwrite_objects_already_existing_in_sink: Option, - /// Whether objects should be deleted from the source after they are transferred to the sink. + /// Whether objects should be deleted from the source after they are + /// transferred to the sink. #[serde(rename="deleteObjectsFromSourceAfterTransfer")] pub delete_objects_from_source_after_transfer: Option, /// Whether objects that exist only in the sink should be deleted. @@ -847,7 +1016,8 @@ pub struct TransferOptions { impl Part for TransferOptions {} -/// This resource represents the configuration of a transfer job that runs periodically. +/// This resource represents the configuration of a transfer job that runs +/// periodically. /// /// # Activities /// @@ -861,19 +1031,26 @@ impl Part for TransferOptions {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct TransferJob { - /// Transfer specification. Required. + /// Transfer specification. + /// Required. #[serde(rename="transferSpec")] pub transfer_spec: Option, - /// Status of the job. This value MUST be specified for `CreateTransferJobRequests`. NOTE: The effect of the new job status takes place during a subsequent job run. For example, if you change the job status from `ENABLED` to `DISABLED`, and an operation spawned by the transfer is running, the status change would not affect the current operation. + /// Status of the job. This value MUST be specified for + /// `CreateTransferJobRequests`. + /// + /// NOTE: The effect of the new job status takes place during a subsequent job + /// run. For example, if you change the job status from `ENABLED` to + /// `DISABLED`, and an operation spawned by the transfer is running, the status + /// change would not affect the current operation. pub status: Option, /// This field cannot be changed by user requests. #[serde(rename="deletionTime")] pub deletion_time: Option, - /// A description provided by the user for the job. Its max length is 1024 bytes when Unicode-encoded. - pub description: Option, - /// Schedule specification. Required. + /// Schedule specification. + /// Required. pub schedule: Option, - /// The ID of the Google Developers Console project that owns the job. Required. + /// The ID of the Google Cloud Platform Console project that owns the job. + /// Required. #[serde(rename="projectId")] pub project_id: Option, /// This field cannot be changed by user requests. @@ -882,8 +1059,14 @@ pub struct TransferJob { /// This field cannot be changed by user requests. #[serde(rename="creationTime")] pub creation_time: Option, - /// A globally unique name assigned by Storage Transfer Service when the job is created. This field should be left empty in requests to create a new transfer job; otherwise, the requests result in an `INVALID_ARGUMENT` error. + /// A globally unique name assigned by Storage Transfer Service when the + /// job is created. This field should be left empty in requests to create a new + /// 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 {} @@ -891,24 +1074,33 @@ impl Resource for TransferJob {} impl ResponseResult for TransferJob {} -/// 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][google.type.TimeOfDay] and `google.protobuf.Timestamp`. +/// Represents a whole calendar date, e.g. date of birth. The time of day and +/// time zone are either specified elsewhere or are not significant. The date +/// is relative to the Proleptic Gregorian Calendar. The day may be 0 to +/// represent a year and month where the day is not significant, e.g. credit card +/// expiration date. The year may be 0 to represent a month and day independent +/// of year, e.g. anniversary date. Related types are google.type.TimeOfDay +/// and `google.protobuf.Timestamp`. /// /// This type is not used in any activity, and only used as *part* of another schema. /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Date { - /// Year of date. Must be from 1 to 9,999, or 0 if specifying a date without a year. + /// 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 sigificant. + /// 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 of date. Must be from 1 to 12. + /// Month of year. Must be from 1 to 12. pub month: Option, } impl Part for Date {} -/// This resource represents a long-running operation that is the result of a network API call. +/// This resource represents a long-running operation that is the result of a +/// network API call. /// /// # Activities /// @@ -919,16 +1111,25 @@ impl Part for Date {} /// #[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 `transferOperations/some/unique/name`. + pub name: Option, /// Represents the transfer operation object. pub metadata: Option>, - /// If the value is `false`, it means the operation is still in progress. If true, the operation is completed and the `result` is available. - pub done: Option, - /// 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 above, the `name` should have the format of `operations/some/unique/name`. - pub name: Option, - /// The error result of the operation in case of failure. - pub error: Option, } impl ResponseResult for Operation {} @@ -984,7 +1185,8 @@ impl<'a, C, A> TransferOperationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the transfer operation. Required. + /// * `name` - The name of the transfer operation. + /// Required. pub fn pause(&self, request: PauseTransferOperationRequest, name: &str) -> TransferOperationPauseCall<'a, C, A> { TransferOperationPauseCall { hub: self.hub, @@ -1003,7 +1205,8 @@ impl<'a, C, A> TransferOperationMethods<'a, C, A> { /// # Arguments /// /// * `request` - No description provided. - /// * `name` - The name of the transfer operation. Required. + /// * `name` - The name of the transfer operation. + /// Required. pub fn resume(&self, request: ResumeTransferOperationRequest, name: &str) -> TransferOperationResumeCall<'a, C, A> { TransferOperationResumeCall { hub: self.hub, @@ -1015,23 +1218,6 @@ impl<'a, C, A> TransferOperationMethods<'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) -> TransferOperationGetCall<'a, C, A> { - TransferOperationGetCall { - 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: /// /// This method is not supported and the server returns `UNIMPLEMENTED`. @@ -1051,7 +1237,30 @@ impl<'a, C, A> TransferOperationMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name` binding below allows API services to override the binding to use different resource name schemes, such as `users/*/operations`. + /// 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) -> TransferOperationGetCall<'a, C, A> { + TransferOperationGetCall { + 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 below allows API services to override the binding + /// to use different resource name schemes, such as `users/*/operations`. /// /// # Arguments /// @@ -1129,11 +1338,20 @@ impl<'a, C, A> GoogleServiceAccountMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service. + /// Returns the Google service account that is used by Storage Transfer + /// Service to access buckets in the project where transfers + /// run or in other projects. Each Google service account is associated + /// with one Google Cloud Platform Console project. Users + /// should add this service account to the Google Cloud Storage bucket + /// ACLs to grant access to Storage Transfer Service. This service + /// account is created and owned by Storage Transfer Service and can + /// only be used by Storage Transfer Service. /// /// # Arguments /// - /// * `projectId` - The ID of the Google Developers Console project that the Google service account is associated with. Required. + /// * `projectId` - The ID of the Google Cloud Platform Console project that the Google service + /// account is associated with. + /// Required. pub fn get(&self, project_id: &str) -> GoogleServiceAccountGetCall<'a, C, A> { GoogleServiceAccountGetCall { hub: self.hub, @@ -1202,12 +1420,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. + /// 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. - /// * `jobName` - The name of job to update. Required. + /// * `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, @@ -1219,6 +1440,25 @@ impl<'a, C, A> TransferJobMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Gets a transfer job. + /// + /// # Arguments + /// + /// * `jobName` - The job to get. + /// Required. + pub fn get(&self, job_name: &str) -> TransferJobGetCall<'a, C, A> { + TransferJobGetCall { + hub: self.hub, + _job_name: job_name.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: /// /// Creates a transfer job that runs periodically. @@ -1235,78 +1475,6 @@ impl<'a, C, A> TransferJobMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Gets a transfer job. - /// - /// # Arguments - /// - /// * `jobName` - The job to get. Required. - pub fn get(&self, job_name: &str) -> TransferJobGetCall<'a, C, A> { - TransferJobGetCall { - hub: self.hub, - _job_name: job_name.to_string(), - _project_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } -} - - - -/// A builder providing access to all free methods, which are not associated with a particular resource. -/// It is not used directly, but through the `Storagetransfer` hub. -/// -/// # Example -/// -/// Instantiate a resource builder -/// -/// ```test_harness,no_run -/// extern crate hyper; -/// 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::new(), -/// ::default(), None); -/// let mut hub = Storagetransfer::new(hyper::Client::new(), auth); -/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* -/// // like `get_google_service_account(...)` -/// // to build up your call. -/// let rb = hub.methods(); -/// # } -/// ``` -pub struct MethodMethods<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Storagetransfer, -} - -impl<'a, C, A> MethodsBuilder for MethodMethods<'a, C, A> {} - -impl<'a, C, A> MethodMethods<'a, C, A> { - - /// Create a builder to help you perform the following task: - /// - /// Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service. - pub fn get_google_service_account(&self) -> MethodGetGoogleServiceAccountCall<'a, C, A> { - MethodGetGoogleServiceAccountCall { - hub: self.hub, - _project_id: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -1395,7 +1563,7 @@ impl<'a, C, A> TransferOperationPauseCall<'a, C, A> where C: BorrowMut TransferOperationPauseCall<'a, C, A> where C: BorrowMut TransferOperationPauseCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationPauseCall<'a, C, A> @@ -1671,7 +1840,7 @@ impl<'a, C, A> TransferOperationResumeCall<'a, C, A> where C: BorrowMut TransferOperationResumeCall<'a, C, A> where C: BorrowMut TransferOperationResumeCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationResumeCall<'a, C, A> @@ -1869,251 +2039,6 @@ impl<'a, C, A> TransferOperationResumeCall<'a, C, A> where C: BorrowMut::default(), None); -/// # let mut hub = Storagetransfer::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.transfer_operations().get("name") -/// .doit(); -/// # } -/// ``` -pub struct TransferOperationGetCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Storagetransfer, - _name: String, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for TransferOperationGetCall<'a, C, A> {} - -impl<'a, C, A> TransferOperationGetCall<'a, C, 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: "storagetransfer.transferOperations.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) -> TransferOperationGetCall<'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) -> TransferOperationGetCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> TransferOperationGetCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> TransferOperationGetCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// This method is not supported and the server returns `UNIMPLEMENTED`. /// /// A builder for the *delete* method supported by a *transferOperation* resource. @@ -2185,7 +2110,7 @@ impl<'a, C, A> TransferOperationDeleteCall<'a, C, A> where C: BorrowMut TransferOperationDeleteCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationDeleteCall<'a, C, A> @@ -2359,7 +2284,258 @@ impl<'a, C, A> TransferOperationDeleteCall<'a, C, A> where C: BorrowMut::default(), None); +/// # let mut hub = Storagetransfer::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.transfer_operations().get("name") +/// .doit(); +/// # } +/// ``` +pub struct TransferOperationGetCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a Storagetransfer, + _name: String, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for TransferOperationGetCall<'a, C, A> {} + +impl<'a, C, A> TransferOperationGetCall<'a, C, 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: "storagetransfer.transferOperations.get", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); + params.push(("name", self._name.to_string())); + for &field in ["alt", "name"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://storagetransfer.googleapis.com/v1/{+name}".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); + } + + for &(find_this, param_name) in [("{+name}", "name")].iter() { + let mut replace_with = String::new(); + for &(name, ref value) in params.iter() { + if name == param_name { + replace_with = value.to_string(); + break; + } + } + if find_this.as_bytes()[1] == '+' as u8 { + replace_with = percent_encode(replace_with.as_bytes(), 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) -> TransferOperationGetCall<'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) -> TransferOperationGetCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *bearer_token* (query-string) - OAuth bearer token. + /// * *pp* (query-boolean) - Pretty-print response. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). + /// * *access_token* (query-string) - OAuth access token. + /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. + /// * *callback* (query-string) - JSONP + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for response. + /// * *$.xgafv* (query-string) - V1 error format. + pub fn param(mut self, name: T, value: T) -> TransferOperationGetCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::CloudPlatform`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> TransferOperationGetCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + +/// Lists operations that match the specified filter in the request. If the +/// server doesn't support this method, it returns `UNIMPLEMENTED`. +/// +/// NOTE: the `name` binding below allows API services to override the binding +/// to use different resource name schemes, such as `users/*/operations`. /// /// A builder for the *list* method supported by a *transferOperation* resource. /// It is not used directly, but through a `TransferOperationMethods` instance. @@ -2445,7 +2621,7 @@ impl<'a, C, A> TransferOperationListCall<'a, C, A> where C: BorrowMut TransferOperationListCall<'a, C, A> where C: BorrowMut TransferOperationListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// The standard list page size. + /// The list page size. The max allowed value is 256. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> TransferOperationListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// The standard list filter. + /// 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. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TransferOperationListCall<'a, C, A> { @@ -2607,12 +2783,12 @@ impl<'a, C, A> TransferOperationListCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationListCall<'a, C, A> @@ -2711,7 +2887,7 @@ impl<'a, C, A> TransferOperationCancelCall<'a, C, A> where C: BorrowMut TransferOperationCancelCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> TransferOperationCancelCall<'a, C, A> @@ -2885,7 +3061,14 @@ impl<'a, C, A> TransferOperationCancelCall<'a, C, A> where C: BorrowMut GoogleServiceAccountGetCall<'a, C, A> where C: BorrowMut GoogleServiceAccountGetCall<'a, C, A> where C: BorrowMut GoogleServiceAccountGetCall<'a, C, A> where C: BorrowMut(mut self, name: T, value: T) -> GoogleServiceAccountGetCall<'a, C, A> @@ -3209,7 +3394,7 @@ impl<'a, C, A> TransferJobListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/transferJobs"; + let mut url = "https://storagetransfer.googleapis.com/v1/transferJobs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3305,7 +3490,14 @@ impl<'a, C, A> TransferJobListCall<'a, C, A> where C: BorrowMut, self._page_size = Some(new_value); self } - /// A list of query parameters specified as JSON text in the form of {"`project_id`":"my_project_id", "`job_names`":["jobid1","jobid2",...], "`job_statuses`":["status1","status2",...]}. Since `job_names` and `job_statuses` support multiple values, their values must be specified with array notation. `project_id` is required. `job_names` and `job_statuses` are optional. The valid values for `job_statuses` are case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`. + /// A list of query parameters specified as JSON text in the form of + /// {"project_id":"my_project_id", + /// "job_names":["jobid1","jobid2",...], + /// "job_statuses":["status1","status2",...]}. + /// Since `job_names` and `job_statuses` support multiple values, their values + /// must be specified with array notation. `project_id` is required. `job_names` + /// and `job_statuses` are optional. The valid values for `job_statuses` are + /// case-insensitive: `ENABLED`, `DISABLED`, and `DELETED`. /// /// Sets the *filter* query property to the given value. pub fn filter(mut self, new_value: &str) -> TransferJobListCall<'a, C, A> { @@ -3337,12 +3529,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> @@ -3370,7 +3562,9 @@ impl<'a, C, A> TransferJobListCall<'a, C, A> where C: BorrowMut, } -/// 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. +/// 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. /// /// A builder for the *patch* method supported by a *transferJob* resource. /// It is not used directly, but through a `TransferJobMethods` instance. @@ -3448,7 +3642,7 @@ impl<'a, C, A> TransferJobPatchCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/{+jobName}"; + let mut url = "https://storagetransfer.googleapis.com/v1/{+jobName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3578,7 +3772,8 @@ impl<'a, C, A> TransferJobPatchCall<'a, C, A> where C: BorrowMut, self._request = new_value; self } - /// The name of job to update. Required. + /// The name of job to update. + /// Required. /// /// Sets the *job name* path property to the given value. /// @@ -3613,12 +3808,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> @@ -3646,6 +3841,265 @@ 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 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::new(), +/// # ::default(), None); +/// # let mut hub = Storagetransfer::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.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 = "https://storagetransfer.googleapis.com/v1/{+jobName}".to_string(); + 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. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing 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: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Creates a transfer job that runs periodically. /// /// A builder for the *create* method supported by a *transferJob* resource. @@ -3721,7 +4175,7 @@ impl<'a, C, A> TransferJobCreateCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/transferJobs"; + let mut url = "https://storagetransfer.googleapis.com/v1/transferJobs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ()); } @@ -3852,12 +4306,12 @@ impl<'a, C, A> TransferJobCreateCall<'a, C, A> where C: BorrowMut /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (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) -> TransferJobCreateCall<'a, C, A> @@ -3885,480 +4339,4 @@ impl<'a, C, A> TransferJobCreateCall<'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 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::new(), -/// # ::default(), None); -/// # let mut hub = Storagetransfer::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.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 Developers 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. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing 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: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - -/// Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Developers Console project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service. -/// -/// A builder for the *getGoogleServiceAccount* method. -/// It is not used directly, but through a `MethodMethods` instance. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate 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::new(), -/// # ::default(), None); -/// # let mut hub = Storagetransfer::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.methods().get_google_service_account() -/// .project_id("et") -/// .doit(); -/// # } -/// ``` -pub struct MethodGetGoogleServiceAccountCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a Storagetransfer, - _project_id: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for MethodGetGoogleServiceAccountCall<'a, C, A> {} - -impl<'a, C, A> MethodGetGoogleServiceAccountCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, GoogleServiceAccount)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, 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.getGoogleServiceAccount", - http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len())); - if let Some(value) = self._project_id { - params.push(("projectId", value.to_string())); - } - for &field in ["alt", "projectId"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "v1:getGoogleServiceAccount"; - 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 ID of the Google Developers Console project that the Google service account is associated with. Required. - /// - /// Sets the *project id* query property to the given value. - pub fn project_id(mut self, new_value: &str) -> MethodGetGoogleServiceAccountCall<'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) -> MethodGetGoogleServiceAccountCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *bearer_token* (query-string) - OAuth bearer token. - /// * *pp* (query-boolean) - Pretty-print response. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *upload_protocol* (query-string) - Upload protocol for media (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) -> MethodGetGoogleServiceAccountCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::CloudPlatform`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> MethodGetGoogleServiceAccountCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - diff --git a/gen/surveys2-cli/Cargo.toml b/gen/surveys2-cli/Cargo.toml index 331d70fd5b..4a314f4fa3 100644 --- a/gen/surveys2-cli/Cargo.toml +++ b/gen/surveys2-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-surveys2-cli" -version = "1.0.4+20161103" +version = "1.0.4+20170407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Surveys (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/surveys2-cli" @@ -23,7 +23,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -33,4 +33,4 @@ clap = "^2.0" [dependencies.google-surveys2] path = "../surveys2" -version = "1.0.4+20161103" +version = "1.0.4+20170407" diff --git a/gen/surveys2-cli/README.md b/gen/surveys2-cli/README.md index 50c6b52816..56bb93ef40 100644 --- a/gen/surveys2-cli/README.md +++ b/gen/surveys2-cli/README.md @@ -22,7 +22,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *Surveys* API at revision *20161103*. The CLI is at version *1.0.4*. +This documentation was generated from the *Surveys* API at revision *20170407*. The CLI is at version *1.0.4*. ```bash surveys2 [options] diff --git a/gen/surveys2-cli/mkdocs.yml b/gen/surveys2-cli/mkdocs.yml index 596cc95cd7..66b9c37221 100644 --- a/gen/surveys2-cli/mkdocs.yml +++ b/gen/surveys2-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: Surveys v1.0.4+20161103 +site_name: Surveys v1.0.4+20170407 site_url: http://byron.github.io/google-apis-rs/google-surveys2-cli site_description: A complete library to interact with Surveys (protocol v2) diff --git a/gen/surveys2-cli/src/main.rs b/gen/surveys2-cli/src/main.rs index 1913890bae..7152aaa151 100644 --- a/gen/surveys2-cli/src/main.rs +++ b/gen/surveys2-cli/src/main.rs @@ -1266,7 +1266,7 @@ fn main() { let mut app = App::new("surveys2") .author("Sebastian Thiel ") - .version("1.0.4+20161103") + .version("1.0.4+20170407") .about("Creates and conducts surveys, lists the surveys that an authenticated user owns, and retrieves survey results and information about specified surveys.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_surveys2_cli") .arg(Arg::with_name("url") diff --git a/gen/surveys2/Cargo.toml b/gen/surveys2/Cargo.toml index b555b375c1..6719c5a1db 100644 --- a/gen/surveys2/Cargo.toml +++ b/gen/surveys2/Cargo.toml @@ -4,11 +4,11 @@ [package] name = "google-surveys2" -version = "1.0.4+20161103" +version = "1.0.4+20170407" authors = ["Sebastian Thiel "] description = "A complete library to interact with Surveys (protocol v2)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/surveys2" -documentation = "https://docs.rs/google-surveys2/1.0.4+20161103" +documentation = "https://docs.rs/google-surveys2/1.0.4+20170407" license = "MIT" keywords = ["surveys", "google", "protocol", "web", "api"] diff --git a/gen/surveys2/README.md b/gen/surveys2/README.md index 09eb5d6e39..e3c8b55336 100644 --- a/gen/surveys2/README.md +++ b/gen/surveys2/README.md @@ -5,22 +5,22 @@ DO NOT EDIT ! --> The `google-surveys2` library allows access to all features of the *Google Surveys* service. -This documentation was generated from *Surveys* crate version *1.0.4+20161103*, where *20161103* is the exact revision of the *surveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *Surveys* crate version *1.0.4+20170407*, where *20170407* is the exact revision of the *surveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.Surveys.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.Surveys.html) ... * mobileapppanels - * [*get*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.MobileapppanelGetCall.html), [*list*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.MobileapppanelListCall.html) and [*update*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.MobileapppanelUpdateCall.html) + * [*get*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.MobileapppanelGetCall.html), [*list*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.MobileapppanelListCall.html) and [*update*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.MobileapppanelUpdateCall.html) * results - * [*get*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.ResultGetCall.html) -* [surveys](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.Survey.html) - * [*delete*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.SurveyDeleteCall.html), [*get*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.SurveyGetCall.html), [*insert*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.SurveyInsertCall.html), [*list*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.SurveyListCall.html), [*start*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.SurveyStartCall.html), [*stop*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.SurveyStopCall.html) and [*update*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.SurveyUpdateCall.html) + * [*get*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.ResultGetCall.html) +* [surveys](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.Survey.html) + * [*delete*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.SurveyDeleteCall.html), [*get*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.SurveyGetCall.html), [*insert*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.SurveyInsertCall.html), [*list*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.SurveyListCall.html), [*start*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.SurveyStartCall.html), [*stop*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.SurveyStopCall.html) and [*update*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.SurveyUpdateCall.html) Download supported by ... -* [*get results*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.ResultGetCall.html) +* [*get results*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.ResultGetCall.html) @@ -28,17 +28,17 @@ Download supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/struct.Surveys.html)** +* **[Hub](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/struct.Surveys.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/trait.Part.html)** + * **[Parts](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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-surveys2/1.0.4+20161103/google_surveys2/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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-surveys2/1.0.4+20161103/google_surveys2/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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-surveys2/1.0.4+20161103/google_surveys2/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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-surveys2/1.0.4+20161103/google_surveys2/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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-surveys2/1.0.4+20161103/google_surveys2/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/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-surveys2/1.0.4+20170407/google_surveys2/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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-surveys2/1.0.4+20161103/google_surveys2/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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-surveys2/1.0.4+20161103/google_surveys2/trait.RequestValue.html) and -[decodable](https://docs.rs/google-surveys2/1.0.4+20161103/google_surveys2/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-surveys2/1.0.4+20170407/google_surveys2/trait.RequestValue.html) and +[decodable](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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-surveys2/1.0.4+20161103/google_surveys2/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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-surveys2/1.0.4+20161103/google_surveys2/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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-surveys2/1.0.4+20161103/google_surveys2/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-surveys2/1.0.4+20170407/google_surveys2/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/surveys2/src/lib.rs b/gen/surveys2/src/lib.rs index 1613787569..10ac7242c2 100644 --- a/gen/surveys2/src/lib.rs +++ b/gen/surveys2/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 *Surveys* crate version *1.0.4+20161103*, where *20161103* is the exact revision of the *surveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *Surveys* crate version *1.0.4+20170407*, where *20170407* is the exact revision of the *surveys:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/surveys2). //! # Features //! @@ -184,7 +184,7 @@ // 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 +// 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)] @@ -320,8 +320,6 @@ pub struct Surveys { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Surveys {} @@ -334,8 +332,6 @@ impl<'a, C, A> Surveys client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/surveys/v2/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -358,26 +354,6 @@ impl<'a, C, A> Surveys self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/surveys/v2/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -464,8 +440,6 @@ impl Part for FieldMask {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SurveysStartResponse { - /// Survey object containing the specification of the started Survey. - pub resource: Option, /// Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. #[serde(rename="requestId")] pub request_id: Option, @@ -844,8 +818,6 @@ impl ResponseResult for MobileAppPanel {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct SurveysStopResponse { - /// Survey object containing the specification of the stopped Survey. - pub resource: Option, /// Unique request ID used for logging and debugging. Please include in any error reporting or troubleshooting requests. #[serde(rename="requestId")] pub request_id: Option, @@ -1249,7 +1221,7 @@ impl<'a, C, A> SurveyStopCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "surveys/{resourceId}/stop"; + let mut url = "https://www.googleapis.com/surveys/v2/surveys/{resourceId}/stop".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1488,7 +1460,7 @@ impl<'a, C, A> SurveyInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "surveys"; + let mut url = "https://www.googleapis.com/surveys/v2/surveys".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1716,7 +1688,7 @@ impl<'a, C, A> SurveyDeleteCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "surveys/{surveyUrlId}"; + let mut url = "https://www.googleapis.com/surveys/v2/surveys/{surveyUrlId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1964,7 +1936,7 @@ impl<'a, C, A> SurveyListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "surveys"; + let mut url = "https://www.googleapis.com/surveys/v2/surveys".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2193,7 +2165,7 @@ impl<'a, C, A> SurveyUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "surveys/{surveyUrlId}"; + let mut url = "https://www.googleapis.com/surveys/v2/surveys/{surveyUrlId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2459,7 +2431,7 @@ impl<'a, C, A> SurveyStartCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "surveys/{resourceId}/start"; + let mut url = "https://www.googleapis.com/surveys/v2/surveys/{resourceId}/start".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2717,7 +2689,7 @@ impl<'a, C, A> SurveyGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "surveys/{surveyUrlId}"; + let mut url = "https://www.googleapis.com/surveys/v2/surveys/{surveyUrlId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2980,7 +2952,7 @@ impl<'a, C, A> ResultGetCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "surveys/{surveyUrlId}/results"; + let mut url = "https://www.googleapis.com/surveys/v2/surveys/{surveyUrlId}/results".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3252,7 +3224,7 @@ impl<'a, C, A> MobileapppanelListCall<'a, C, A> where C: BorrowMut MobileapppanelGetCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "mobileAppPanels/{panelId}"; + let mut url = "https://www.googleapis.com/surveys/v2/mobileAppPanels/{panelId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3716,7 +3688,7 @@ impl<'a, C, A> MobileapppanelUpdateCall<'a, C, A> where C: BorrowMut MobileapppanelUpdateCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for TagManager {} @@ -400,8 +398,6 @@ impl<'a, C, A> TagManager client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/tagmanager/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -418,26 +414,6 @@ impl<'a, C, A> TagManager self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/tagmanager/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -2578,7 +2554,7 @@ impl<'a, C, A> AccountContainerListCall<'a, C, A> where C: BorrowMut AccountPermissionListCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentCreateCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -3333,7 +3309,7 @@ impl<'a, C, A> AccountPermissionCreateCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentDeleteCall<'a, C, A> where C: BorrowMu } - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments/{environmentId}"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -3841,7 +3817,7 @@ impl<'a, C, A> AccountPermissionDeleteCall<'a, C, A> where C: BorrowMut AccountContainerGetCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentPatchCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments/{environmentId}"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -4637,7 +4613,7 @@ impl<'a, C, A> AccountContainerVersionListCall<'a, C, A> where C: BorrowMut AccountContainerTriggerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerTriggerGetCall<'a, C, A> where C: BorrowMut AccountContainerDeleteCall<'a, C, A> where C: BorrowMut AccountContainerFolderDeleteCall<'a, C, A> where C: BorrowMut AccountContainerCreateCall<'a, C, A> where C: BorrowMut AccountContainerTagDeleteCall<'a, C, A> where C: BorrowMut AccountContainerFolderEntityListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/folders/{folderId}/entities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -6718,7 +6694,7 @@ impl<'a, C, A> AccountContainerVersionUndeleteCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/versions/{containerVersionId}/undelete".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainerversion.as_ref().to_string(), ()); } @@ -6975,7 +6951,7 @@ impl<'a, C, A> AccountContainerEnvironmentListCall<'a, C, A> where C: BorrowMut< params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -7222,7 +7198,7 @@ impl<'a, C, A> AccountContainerTagListCall<'a, C, A> where C: BorrowMut AccountContainerVersionPublishCall<'a, C, A> where C: BorrowMut AccountContainerFolderGetCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentGetCall<'a, C, A> where C: BorrowMut AccountContainerTagCreateCall<'a, C, A> where C: BorrowMut AccountContainerTriggerListCall<'a, C, A> where C: BorrowMut AccountContainerVersionDeleteCall<'a, C, A> where C: BorrowMut AccountUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ManageAccount.as_ref().to_string(), ()); } @@ -9316,7 +9292,7 @@ impl<'a, C, A> AccountContainerVersionCreateCall<'a, C, A> where C: BorrowMut AccountPermissionGetCall<'a, C, A> where C: BorrowMut AccountContainerMoveFolderUpdateCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/move_folders/{folderId}"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/move_folders/{folderId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -10160,7 +10136,7 @@ impl<'a, C, A> AccountContainerVersionRestoreCall<'a, C, A> where C: BorrowMut AccountContainerVariableCreateCall<'a, C, A> where C: BorrowMut AccountContainerVariableListCall<'a, C, A> where C: BorrowMut AccountContainerTagGetCall<'a, C, A> where C: BorrowMut AccountContainerVariableGetCall<'a, C, A> where C: BorrowMut AccountContainerTriggerDeleteCall<'a, C, A> where C: BorrowMut AccountContainerTriggerCreateCall<'a, C, A> where C: BorrowMut AccountContainerFolderUpdateCall<'a, C, A> where C: BorrowMut AccountListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -12497,7 +12473,7 @@ impl<'a, C, A> AccountPermissionUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVariableDeleteCall<'a, C, A> where C: BorrowMut AccountContainerReauthorizeEnvironmentUpdateCall<'a, C, A> where params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/reauthorize_environments/{environmentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Publish.as_ref().to_string(), ()); } @@ -13304,7 +13280,7 @@ impl<'a, C, A> AccountGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13553,7 +13529,7 @@ impl<'a, C, A> AccountContainerUpdateCall<'a, C, A> where C: BorrowMut AccountContainerTagUpdateCall<'a, C, A> where C: BorrowMut AccountContainerEnvironmentUpdateCall<'a, C, A> where C: BorrowMu params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "accounts/{accountId}/containers/{containerId}/environments/{environmentId}"; + let mut url = "https://www.googleapis.com/tagmanager/v1/accounts/{accountId}/containers/{containerId}/environments/{environmentId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::EditContainer.as_ref().to_string(), ()); } @@ -14442,7 +14418,7 @@ impl<'a, C, A> AccountContainerFolderCreateCall<'a, C, A> where C: BorrowMut AccountContainerFolderListCall<'a, C, A> where C: BorrowMut AccountContainerVersionUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVariableUpdateCall<'a, C, A> where C: BorrowMut AccountContainerVersionGetCall<'a, C, A> where C: BorrowMut AccountContainerVersionGetCall<'a, C, A> where C: BorrowMut { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Taskqueue {} @@ -325,8 +323,6 @@ impl<'a, C, A> Taskqueue client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/taskqueue/v1beta2/projects/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -346,26 +342,6 @@ impl<'a, C, A> Taskqueue self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/taskqueue/v1beta2/projects/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -876,7 +852,7 @@ impl<'a, C, A> TaskqueueGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}"; + let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1144,7 +1120,7 @@ impl<'a, C, A> TaskLeaseCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks/lease"; + let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/lease".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1432,7 +1408,7 @@ impl<'a, C, A> TaskInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks"; + let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1704,7 +1680,7 @@ impl<'a, C, A> TaskDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks/{task}"; + let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1962,7 +1938,7 @@ impl<'a, C, A> TaskPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks/{task}"; + let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2251,7 +2227,7 @@ impl<'a, C, A> TaskListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks"; + let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2500,7 +2476,7 @@ impl<'a, C, A> TaskGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks/{task}"; + let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2768,7 +2744,7 @@ impl<'a, C, A> TaskUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "{project}/taskqueues/{taskqueue}/tasks/{task}"; + let mut url = "https://www.googleapis.com/taskqueue/v1beta2/projects/{project}/taskqueues/{taskqueue}/tasks/{task}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2985,3 +2961,4 @@ impl<'a, C, A> TaskUpdateCall<'a, C, A> where C: BorrowMut, A: oa } + diff --git a/gen/tasks1-cli/Cargo.toml b/gen/tasks1-cli/Cargo.toml index 31df1ce2fd..c0dab621bd 100644 --- a/gen/tasks1-cli/Cargo.toml +++ b/gen/tasks1-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/tasks1/src/lib.rs b/gen/tasks1/src/lib.rs index ead7c6ebd9..62d08226c1 100644 --- a/gen/tasks1/src/lib.rs +++ b/gen/tasks1/src/lib.rs @@ -189,7 +189,7 @@ // 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 +// 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)] @@ -328,8 +328,6 @@ pub struct TasksHub { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for TasksHub {} @@ -342,8 +340,6 @@ impl<'a, C, A> TasksHub client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/tasks/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -363,26 +359,6 @@ impl<'a, C, A> TasksHub self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/tasks/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1030,7 +1006,7 @@ impl<'a, C, A> TaskListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks"; + let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -1344,7 +1320,7 @@ impl<'a, C, A> TaskUpdateCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks/{task}"; + let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks/{task}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1622,7 +1598,7 @@ impl<'a, C, A> TaskPatchCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks/{task}"; + let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks/{task}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1890,7 +1866,7 @@ impl<'a, C, A> TaskClearCall<'a, C, A> where C: BorrowMut, A: oau } - let mut url = self.hub._base_url.clone() + "lists/{tasklist}/clear"; + let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/clear".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2127,7 +2103,7 @@ impl<'a, C, A> TaskMoveCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks/{task}/move"; + let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks/{task}/move".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2387,7 +2363,7 @@ impl<'a, C, A> TaskDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks/{task}"; + let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks/{task}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2624,7 +2600,7 @@ impl<'a, C, A> TaskGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks/{task}"; + let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks/{task}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2886,7 +2862,7 @@ impl<'a, C, A> TaskInsertCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "lists/{tasklist}/tasks"; + let mut url = "https://www.googleapis.com/tasks/v1/lists/{tasklist}/tasks".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3167,7 +3143,7 @@ impl<'a, C, A> TasklistListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/@me/lists"; + let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -3392,7 +3368,7 @@ impl<'a, C, A> TasklistUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/@me/lists/{tasklist}"; + let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists/{tasklist}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3650,7 +3626,7 @@ impl<'a, C, A> TasklistDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "users/@me/lists/{tasklist}"; + let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists/{tasklist}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3882,7 +3858,7 @@ impl<'a, C, A> TasklistPatchCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/@me/lists/{tasklist}"; + let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists/{tasklist}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4146,7 +4122,7 @@ impl<'a, C, A> TasklistInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/@me/lists"; + let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4374,7 +4350,7 @@ impl<'a, C, A> TasklistGetCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "users/@me/lists/{tasklist}"; + let mut url = "https://www.googleapis.com/tasks/v1/users/@me/lists/{tasklist}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -4539,3 +4515,4 @@ impl<'a, C, A> TasklistGetCall<'a, C, A> where C: BorrowMut, A: o } + diff --git a/gen/translate2-cli/Cargo.toml b/gen/translate2-cli/Cargo.toml index 1af4dd5df8..e81597f5ea 100644 --- a/gen/translate2-cli/Cargo.toml +++ b/gen/translate2-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/translate2/src/lib.rs b/gen/translate2/src/lib.rs index cb4a4205a5..238a1cbef5 100644 --- a/gen/translate2/src/lib.rs +++ b/gen/translate2/src/lib.rs @@ -174,7 +174,7 @@ // 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 +// 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)] @@ -277,8 +277,6 @@ pub struct Translate { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Translate {} @@ -291,8 +289,6 @@ impl<'a, C, A> Translate client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/language/translate/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -315,26 +311,6 @@ impl<'a, C, A> Translate self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/language/translate/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -721,7 +697,7 @@ impl<'a, C, A> LanguageListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/languages"; + let mut url = "https://www.googleapis.com/language/translate/v2/languages".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -914,7 +890,7 @@ impl<'a, C, A> DetectionListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2/detect"; + let mut url = "https://www.googleapis.com/language/translate/v2/detect".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1130,7 +1106,7 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v2"; + let mut url = "https://www.googleapis.com/language/translate/v2".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -1286,3 +1262,4 @@ impl<'a, C, A> TranslationListCall<'a, C, A> where C: BorrowMut, } + diff --git a/gen/urlshortener1-cli/Cargo.toml b/gen/urlshortener1-cli/Cargo.toml index d1d85765fd..b28c692582 100644 --- a/gen/urlshortener1-cli/Cargo.toml +++ b/gen/urlshortener1-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/urlshortener1/src/lib.rs b/gen/urlshortener1/src/lib.rs index ca9ea11ee8..5849b21886 100644 --- a/gen/urlshortener1/src/lib.rs +++ b/gen/urlshortener1/src/lib.rs @@ -172,7 +172,7 @@ // 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 +// 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)] @@ -298,8 +298,6 @@ pub struct Urlshortener { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Urlshortener {} @@ -312,8 +310,6 @@ impl<'a, C, A> Urlshortener client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/urlshortener/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -330,26 +326,6 @@ impl<'a, C, A> Urlshortener self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/urlshortener/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -655,7 +631,7 @@ impl<'a, C, A> UrlInsertCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "url"; + let mut url = "https://www.googleapis.com/urlshortener/v1/url".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -888,7 +864,7 @@ impl<'a, C, A> UrlGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "url"; + let mut url = "https://www.googleapis.com/urlshortener/v1/url".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1117,7 +1093,7 @@ impl<'a, C, A> UrlListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "url/history"; + let mut url = "https://www.googleapis.com/urlshortener/v1/url/history".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1265,3 +1241,4 @@ impl<'a, C, A> UrlListCall<'a, C, A> where C: BorrowMut, A: oauth } + diff --git a/gen/webfonts1-cli/Cargo.toml b/gen/webfonts1-cli/Cargo.toml index 24ed479c19..f58689b1c2 100644 --- a/gen/webfonts1-cli/Cargo.toml +++ b/gen/webfonts1-cli/Cargo.toml @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" diff --git a/gen/webfonts1/src/lib.rs b/gen/webfonts1/src/lib.rs index c802978c4f..0026f20599 100644 --- a/gen/webfonts1/src/lib.rs +++ b/gen/webfonts1/src/lib.rs @@ -171,7 +171,7 @@ // 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 +// 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)] @@ -275,8 +275,6 @@ pub struct Webfonts { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Webfonts {} @@ -289,8 +287,6 @@ impl<'a, C, A> Webfonts client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/webfonts/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -307,26 +303,6 @@ impl<'a, C, A> Webfonts self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/webfonts/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -522,7 +498,7 @@ impl<'a, C, A> WebfontListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "webfonts"; + let mut url = "https://www.googleapis.com/webfonts/v1/webfonts".to_string(); let mut key = self.hub.auth.borrow_mut().api_key(); if key.is_none() { @@ -642,3 +618,4 @@ impl<'a, C, A> WebfontListCall<'a, C, A> where C: BorrowMut, A: o } + diff --git a/gen/webmasters3-cli/Cargo.toml b/gen/webmasters3-cli/Cargo.toml index 1b1bc073a0..2424c35d5b 100644 --- a/gen/webmasters3-cli/Cargo.toml +++ b/gen/webmasters3-cli/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "google-webmasters3-cli" -version = "1.0.4+20160317" +version = "1.0.4+20170517" authors = ["Sebastian Thiel "] description = "A complete library to interact with webmasters (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-webmasters3] path = "../webmasters3" -version = "1.0.4+20160317" +version = "1.0.4+20170517" diff --git a/gen/webmasters3-cli/README.md b/gen/webmasters3-cli/README.md index 4c37e43d50..e1395847a0 100644 --- a/gen/webmasters3-cli/README.md +++ b/gen/webmasters3-cli/README.md @@ -25,7 +25,7 @@ Find the source code [on github](https://github.com/Byron/google-apis-rs/tree/ma # Usage -This documentation was generated from the *webmasters* API at revision *20160317*. The CLI is at version *1.0.4*. +This documentation was generated from the *webmasters* API at revision *20170517*. The CLI is at version *1.0.4*. ```bash webmasters3 [options] diff --git a/gen/webmasters3-cli/mkdocs.yml b/gen/webmasters3-cli/mkdocs.yml index 1e543566ac..96472a1a0e 100644 --- a/gen/webmasters3-cli/mkdocs.yml +++ b/gen/webmasters3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: webmasters v1.0.4+20160317 +site_name: webmasters v1.0.4+20170517 site_url: http://byron.github.io/google-apis-rs/google-webmasters3-cli site_description: A complete library to interact with webmasters (protocol v3) diff --git a/gen/webmasters3-cli/src/main.rs b/gen/webmasters3-cli/src/main.rs index e16e5d2318..d979b5213f 100644 --- a/gen/webmasters3-cli/src/main.rs +++ b/gen/webmasters3-cli/src/main.rs @@ -1244,7 +1244,7 @@ fn main() { let mut app = App::new("webmasters3") .author("Sebastian Thiel ") - .version("1.0.4+20160317") + .version("1.0.4+20170517") .about("View Google Search Console data for your verified sites.") .after_help("All documentation details can be found at http://byron.github.io/google-apis-rs/google_webmasters3_cli") .arg(Arg::with_name("url") diff --git a/gen/webmasters3/Cargo.toml b/gen/webmasters3/Cargo.toml index cffb9c60b3..bcaef254e9 100644 --- a/gen/webmasters3/Cargo.toml +++ b/gen/webmasters3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-webmasters3" -version = "1.0.4+20160317" +version = "1.0.4+20170517" authors = ["Sebastian Thiel "] description = "A complete library to interact with webmasters (protocol v3)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/webmasters3" homepage = "https://developers.google.com/webmaster-tools/" -documentation = "https://docs.rs/google-webmasters3/1.0.4+20160317" +documentation = "https://docs.rs/google-webmasters3/1.0.4+20170517" license = "MIT" keywords = ["webmasters", "google", "protocol", "web", "api"] diff --git a/gen/webmasters3/README.md b/gen/webmasters3/README.md index b7d2456096..1be45532be 100644 --- a/gen/webmasters3/README.md +++ b/gen/webmasters3/README.md @@ -5,24 +5,24 @@ DO NOT EDIT ! --> The `google-webmasters3` library allows access to all features of the *Google webmasters* service. -This documentation was generated from *webmasters* crate version *1.0.4+20160317*, where *20160317* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *webmasters* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. Everything else about the *webmasters* *v3* API can be found at the [official documentation site](https://developers.google.com/webmaster-tools/). # Features -Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.Webmasters.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.Webmasters.html) ... * searchanalytics - * [*query*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.SearchanalyticQueryCall.html) + * [*query*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.SearchanalyticQueryCall.html) * sitemaps - * [*delete*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.SitemapDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.SitemapGetCall.html), [*list*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.SitemapListCall.html) and [*submit*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.SitemapSubmitCall.html) + * [*delete*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.SitemapDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.SitemapGetCall.html), [*list*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.SitemapListCall.html) and [*submit*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.SitemapSubmitCall.html) * sites - * [*add*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.SiteAddCall.html), [*delete*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.SiteDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.SiteGetCall.html) and [*list*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.SiteListCall.html) + * [*add*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.SiteAddCall.html), [*delete*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.SiteDeleteCall.html), [*get*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.SiteGetCall.html) and [*list*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.SiteListCall.html) * urlcrawlerrorscounts - * [*query*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.UrlcrawlerrorscountQueryCall.html) + * [*query*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.UrlcrawlerrorscountQueryCall.html) * urlcrawlerrorssamples - * [*get*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.UrlcrawlerrorssampleGetCall.html), [*list*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.UrlcrawlerrorssampleListCall.html) and [*mark as fixed*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.UrlcrawlerrorssampleMarkAsFixedCall.html) + * [*get*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.UrlcrawlerrorssampleGetCall.html), [*list*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.UrlcrawlerrorssampleListCall.html) and [*mark as fixed*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.UrlcrawlerrorssampleMarkAsFixedCall.html) @@ -31,17 +31,17 @@ Handle the following *Resources* with ease from the central [hub](https://docs.r The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/struct.Webmasters.html)** +* **[Hub](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/struct.Webmasters.html)** * a central object to maintain state and allow accessing all *Activities* - * creates [*Method Builders*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.Resource.html)** * primary types that you can apply *Activities* to * a collection of properties and *Parts* - * **[Parts](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.Part.html)** + * **[Parts](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/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-webmasters3/1.0.4+20160317/google_webmasters3/enum.Result.html) enumeration as return value of +All errors produced by the system are provided either as [Result](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/enum.Result.html) enumeration as return value of the doit() methods, or handed as possibly intermediate results to either the -[Hub Delegate](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). +[Hub Delegate](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html). When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This makes the system potentially resilient to all kinds of errors. ## Uploads and Downloads -If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/enum.Result.html), should be +If a method supports downloads, the response body, which is part of the [Result](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/enum.Result.html), should be read by you to obtain the media. -If such a method also supports a [Response Result](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.ResponseResult.html), it will return that by default. +If such a method also supports a [Response Result](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.ResponseResult.html), it will return that by default. You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making this call: `.param("alt", "media")`. @@ -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-webmasters3/1.0.4+20160317/google_webmasters3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.CallBuilder.html) before making the final `doit()` call. +You may alter the way an `doit()` method is called by providing a [delegate](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.CallBuilder.html) before making the final `doit()` call. Respective methods will be called to provide progress information, as well as determine whether the system should retry on failure. -The [delegate trait](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. +The [delegate trait](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort. ## Optional Parts in Server-Requests -All structures provided by this library are made to be [enocodable](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses +All structures provided by this library are made to be [enocodable](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses are valid. -Most optionals are are considered [Parts](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.Part.html) which are identifiable by name, which will be sent to +Most optionals are are considered [Parts](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.Part.html) which are identifiable by name, which will be sent to the server to indicate either the set parts of the request or the desired parts in the response. ## Builder Arguments -Using [method builders](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. +Using [method builders](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods. These will always take a single argument, for which the following statements are true. * [PODs][wiki-pod] are handed by copy * strings are passed as `&str` -* [request values](https://docs.rs/google-webmasters3/1.0.4+20160317/google_webmasters3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-webmasters3/1.0.4+20170517/google_webmasters3/trait.RequestValue.html) are moved Arguments will always be copied or cloned into the builder, to make them independent of their original life times. diff --git a/gen/webmasters3/src/lib.rs b/gen/webmasters3/src/lib.rs index cb7c25067b..941cd647ab 100644 --- a/gen/webmasters3/src/lib.rs +++ b/gen/webmasters3/src/lib.rs @@ -2,7 +2,7 @@ // This file was generated automatically from 'src/mako/api/lib.rs.mako' // DO NOT EDIT ! -//! This documentation was generated from *webmasters* crate version *1.0.4+20160317*, where *20160317* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *webmasters* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *webmasters:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *webmasters* *v3* API can be found at the //! [official documentation site](https://developers.google.com/webmaster-tools/). @@ -178,7 +178,7 @@ // 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 +// 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)] @@ -307,8 +307,6 @@ pub struct Webmasters { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for Webmasters {} @@ -321,8 +319,6 @@ impl<'a, C, A> Webmasters client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/webmasters/v3/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -351,26 +347,6 @@ impl<'a, C, A> Webmasters self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/webmasters/v3/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1261,7 +1237,7 @@ impl<'a, C, A> SitemapDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "sites/{siteUrl}/sitemaps/{feedpath}"; + let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1497,7 +1473,7 @@ impl<'a, C, A> SitemapSubmitCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "sites/{siteUrl}/sitemaps/{feedpath}"; + let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -1734,7 +1710,7 @@ impl<'a, C, A> SitemapGetCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "sites/{siteUrl}/sitemaps/{feedpath}"; + let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/sitemaps/{feedpath}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -1984,7 +1960,7 @@ impl<'a, C, A> SitemapListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "sites/{siteUrl}/sitemaps"; + let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/sitemaps".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2226,7 +2202,7 @@ impl<'a, C, A> SiteGetCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "sites/{siteUrl}"; + let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2460,7 +2436,7 @@ impl<'a, C, A> SiteAddCall<'a, C, A> where C: BorrowMut, A: oauth } - let mut url = self.hub._base_url.clone() + "sites/{siteUrl}"; + let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -2683,7 +2659,7 @@ impl<'a, C, A> SiteListCall<'a, C, A> where C: BorrowMut, A: oaut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "sites"; + let mut url = "https://www.googleapis.com/webmasters/v3/sites".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -2886,7 +2862,7 @@ impl<'a, C, A> SiteDeleteCall<'a, C, A> where C: BorrowMut, A: oa } - let mut url = self.hub._base_url.clone() + "sites/{siteUrl}"; + let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -3120,7 +3096,7 @@ impl<'a, C, A> SearchanalyticQueryCall<'a, C, A> where C: BorrowMut UrlcrawlerrorscountQueryCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleGetCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleListCall<'a, C, A> where C: BorrowMut UrlcrawlerrorssampleMarkAsFixedCall<'a, C, A> where C: BorrowMut< } - let mut url = self.hub._base_url.clone() + "sites/{siteUrl}/urlCrawlErrorsSamples/{url}"; + let mut url = "https://www.googleapis.com/webmasters/v3/sites/{siteUrl}/urlCrawlErrorsSamples/{url}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -4370,3 +4346,4 @@ impl<'a, C, A> UrlcrawlerrorssampleMarkAsFixedCall<'a, C, A> where C: BorrowMut< } + diff --git a/gen/youtube3-cli/Cargo.toml b/gen/youtube3-cli/Cargo.toml index eb09148048..9419d06769 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.4+20161202" +version = "1.0.4+20170130" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-youtube3] path = "../youtube3" -version = "1.0.4+20161202" +version = "1.0.4+20170130" diff --git a/gen/youtube3-cli/README.md b/gen/youtube3-cli/README.md index a8c874d91d..dba4821c98 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 *20161202*. The CLI is at version *1.0.4*. +This documentation was generated from the *YouTube* API at revision *20170130*. The CLI is at version *1.0.4*. ```bash youtube3 [options] @@ -109,6 +109,8 @@ youtube3 [options] delete [-p ]... insert (-r )... [-p ]... [-o ] list [-p ]... [-o ] + super-chat-events + list [-p ]... [-o ] thumbnails set (-u (simple|resumable) -f [-m ]) [-p ]... [-o ] video-abuse-report-reasons diff --git a/gen/youtube3-cli/mkdocs.yml b/gen/youtube3-cli/mkdocs.yml index 4a7f56199a..fe8a2d78b4 100644 --- a/gen/youtube3-cli/mkdocs.yml +++ b/gen/youtube3-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube v1.0.4+20161202 +site_name: YouTube v1.0.4+20170130 site_url: http://byron.github.io/google-apis-rs/google-youtube3-cli site_description: A complete library to interact with YouTube (protocol v3) @@ -68,6 +68,7 @@ pages: - ['subscriptions_delete.md', 'Subscriptions', 'Delete'] - ['subscriptions_insert.md', 'Subscriptions', 'Insert'] - ['subscriptions_list.md', 'Subscriptions', 'List'] +- ['super-chat-events_list.md', 'Super Chat Events', 'List'] - ['thumbnails_set.md', 'Thumbnails', 'Set'] - ['video-abuse-report-reasons_list.md', 'Video Abuse Report Reasons', 'List'] - ['video-categories_list.md', 'Video Categories', 'List'] diff --git a/gen/youtube3-cli/src/main.rs b/gen/youtube3-cli/src/main.rs index 8d8976657e..dbf5bbba39 100644 --- a/gen/youtube3-cli/src/main.rs +++ b/gen/youtube3-cli/src/main.rs @@ -1245,6 +1245,7 @@ impl<'n> Engine<'n> { "content-owner-details.content-owner" => Some(("contentOwnerDetails.contentOwner", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-owner-details.time-linked" => Some(("contentOwnerDetails.timeLinked", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "topic-details.topic-ids" => Some(("topicDetails.topicIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "topic-details.topic-categories" => Some(("topicDetails.topicCategories", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "content-details.related-playlists.watch-later" => Some(("contentDetails.relatedPlaylists.watchLater", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.related-playlists.watch-history" => Some(("contentDetails.relatedPlaylists.watchHistory", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "content-details.related-playlists.uploads" => Some(("contentDetails.relatedPlaylists.uploads", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -1324,7 +1325,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!["audit-details", "background-color", "background-image-url", "banner-external-url", "banner-image-url", "banner-mobile-extra-hd-image-url", "banner-mobile-hd-image-url", "banner-mobile-image-url", "banner-mobile-low-image-url", "banner-mobile-medium-hd-image-url", "banner-tablet-extra-hd-image-url", "banner-tablet-hd-image-url", "banner-tablet-image-url", "banner-tablet-low-image-url", "banner-tv-high-image-url", "banner-tv-image-url", "banner-tv-low-image-url", "banner-tv-medium-image-url", "branding-settings", "channel", "comment-count", "community-guidelines-good-standing", "content-details", "content-id-claims-good-standing", "content-owner", "content-owner-details", "copyright-strikes-good-standing", "corner-position", "country", "custom-url", "default", "default-language", "default-tab", "default-timing", "description", "duration-ms", "etag", "favorites", "featured-channels-title", "featured-channels-urls", "featured-playlist-id", "height", "hidden-subscriber-count", "high", "id", "image", "invideo-promotion", "is-linked", "keywords", "kind", "large-branded-banner-image-imap-script", "large-branded-banner-image-url", "likes", "localized", "long-uploads-status", "maxres", "medium", "moderate-comments", "offset-ms", "overall-good-standing", "position", "privacy-status", "profile-color", "published-at", "related-playlists", "show-browse-view", "show-related-channels", "small-branded-banner-image-imap-script", "small-branded-banner-image-url", "snippet", "standard", "statistics", "status", "subscriber-count", "text-color", "thumbnails", "time-linked", "title", "topic-details", "topic-ids", "tracking-analytics-account-id", "tracking-image-url", "type", "unsubscribed-trailer", "uploads", "url", "use-smart-timing", "value", "video-count", "view-count", "watch", "watch-history", "watch-icon-image-url", "watch-later", "width"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["audit-details", "background-color", "background-image-url", "banner-external-url", "banner-image-url", "banner-mobile-extra-hd-image-url", "banner-mobile-hd-image-url", "banner-mobile-image-url", "banner-mobile-low-image-url", "banner-mobile-medium-hd-image-url", "banner-tablet-extra-hd-image-url", "banner-tablet-hd-image-url", "banner-tablet-image-url", "banner-tablet-low-image-url", "banner-tv-high-image-url", "banner-tv-image-url", "banner-tv-low-image-url", "banner-tv-medium-image-url", "branding-settings", "channel", "comment-count", "community-guidelines-good-standing", "content-details", "content-id-claims-good-standing", "content-owner", "content-owner-details", "copyright-strikes-good-standing", "corner-position", "country", "custom-url", "default", "default-language", "default-tab", "default-timing", "description", "duration-ms", "etag", "favorites", "featured-channels-title", "featured-channels-urls", "featured-playlist-id", "height", "hidden-subscriber-count", "high", "id", "image", "invideo-promotion", "is-linked", "keywords", "kind", "large-branded-banner-image-imap-script", "large-branded-banner-image-url", "likes", "localized", "long-uploads-status", "maxres", "medium", "moderate-comments", "offset-ms", "overall-good-standing", "position", "privacy-status", "profile-color", "published-at", "related-playlists", "show-browse-view", "show-related-channels", "small-branded-banner-image-imap-script", "small-branded-banner-image-url", "snippet", "standard", "statistics", "status", "subscriber-count", "text-color", "thumbnails", "time-linked", "title", "topic-categories", "topic-details", "topic-ids", "tracking-analytics-account-id", "tracking-image-url", "type", "unsubscribed-trailer", "uploads", "url", "use-smart-timing", "value", "video-count", "view-count", "watch", "watch-history", "watch-icon-image-url", "watch-later", "width"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -3133,6 +3134,11 @@ impl<'n> Engine<'n> { match &temp_cursor.to_string()[..] { "snippet.display-message" => Some(("snippet.displayMessage", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.message-retracted-details.retracted-message-id" => Some(("snippet.messageRetractedDetails.retractedMessageId", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snippet.super-chat-details.tier" => Some(("snippet.superChatDetails.tier", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), + "snippet.super-chat-details.currency" => Some(("snippet.superChatDetails.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snippet.super-chat-details.amount-display-string" => Some(("snippet.superChatDetails.amountDisplayString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snippet.super-chat-details.user-comment" => Some(("snippet.superChatDetails.userComment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), + "snippet.super-chat-details.amount-micros" => Some(("snippet.superChatDetails.amountMicros", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.fan-funding-event-details.currency" => Some(("snippet.fanFundingEventDetails.currency", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.fan-funding-event-details.amount-display-string" => Some(("snippet.fanFundingEventDetails.amountDisplayString", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "snippet.fan-funding-event-details.user-comment" => Some(("snippet.fanFundingEventDetails.userComment", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), @@ -3169,7 +3175,7 @@ impl<'n> Engine<'n> { "author-details.channel-url" => Some(("authorDetails.channelUrl", 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!["amount-display-string", "amount-micros", "author-channel-id", "author-details", "ban-duration-seconds", "ban-type", "banned-user-details", "channel-id", "channel-url", "currency", "deleted-message-id", "display-message", "display-name", "etag", "fan-funding-event-details", "has-display-content", "id", "is-chat-moderator", "is-chat-owner", "is-chat-sponsor", "is-verified", "item-id", "kind", "live-chat-id", "message-deleted-details", "message-retracted-details", "message-text", "poll-closed-details", "poll-edited-details", "poll-id", "poll-opened-details", "poll-voted-details", "profile-image-url", "prompt", "published-at", "retracted-message-id", "snippet", "text-message-details", "type", "user-banned-details", "user-comment"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["amount-display-string", "amount-micros", "author-channel-id", "author-details", "ban-duration-seconds", "ban-type", "banned-user-details", "channel-id", "channel-url", "currency", "deleted-message-id", "display-message", "display-name", "etag", "fan-funding-event-details", "has-display-content", "id", "is-chat-moderator", "is-chat-owner", "is-chat-sponsor", "is-verified", "item-id", "kind", "live-chat-id", "message-deleted-details", "message-retracted-details", "message-text", "poll-closed-details", "poll-edited-details", "poll-id", "poll-opened-details", "poll-voted-details", "profile-image-url", "prompt", "published-at", "retracted-message-id", "snippet", "super-chat-details", "text-message-details", "tier", "type", "user-banned-details", "user-comment"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5029,6 +5035,68 @@ impl<'n> Engine<'n> { } } + fn _super_chat_events_list(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) + -> Result<(), DoitError> { + let mut call = self.hub.super_chat_events().list(opt.value_of("part").unwrap_or("")); + for parg in 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")); + }, + "hl" => { + call = call.hl(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", "hl", "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 _thumbnails_set(&self, opt: &ArgMatches<'n>, dry_run: bool, err: &mut InvalidOptionsError) -> Result<(), DoitError> { let mut call = self.hub.thumbnails().set(opt.value_of("video-id").unwrap_or("")); @@ -5343,6 +5411,7 @@ impl<'n> Engine<'n> { "status.rejection-reason" => Some(("status.rejectionReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.failure-reason" => Some(("status.failureReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "topic-details.topic-ids" => Some(("topicDetails.topicIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "topic-details.topic-categories" => Some(("topicDetails.topicCategories", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "topic-details.relevant-topic-ids" => Some(("topicDetails.relevantTopicIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.comment-count" => Some(("statistics.commentCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -5500,7 +5569,7 @@ impl<'n> Engine<'n> { "recording-details.location.longitude" => Some(("recordingDetails.location.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "active-live-chat-id", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "cnc-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-audio-language", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "maxres", "mccaa-rating", "mccyp-rating", "mcst-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "active-live-chat-id", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "cnc-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-audio-language", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "maxres", "mccaa-rating", "mccyp-rating", "mcst-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-categories", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -5830,6 +5899,7 @@ impl<'n> Engine<'n> { "status.rejection-reason" => Some(("status.rejectionReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "status.failure-reason" => Some(("status.failureReason", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "topic-details.topic-ids" => Some(("topicDetails.topicIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), + "topic-details.topic-categories" => Some(("topicDetails.topicCategories", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "topic-details.relevant-topic-ids" => Some(("topicDetails.relevantTopicIds", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Vec })), "kind" => Some(("kind", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), "statistics.comment-count" => Some(("statistics.commentCount", JsonTypeInfo { jtype: JsonType::Int, ctype: ComplexType::Pod })), @@ -5987,7 +6057,7 @@ impl<'n> Engine<'n> { "recording-details.location.longitude" => Some(("recordingDetails.location.longitude", JsonTypeInfo { jtype: JsonType::Float, ctype: ComplexType::Pod })), "id" => Some(("id", JsonTypeInfo { jtype: JsonType::String, ctype: ComplexType::Pod })), _ => { - let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "active-live-chat-id", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "cnc-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-audio-language", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "maxres", "mccaa-rating", "mccyp-rating", "mcst-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); + let suggestion = FieldCursor::did_you_mean(key, &vec!["acb-rating", "access", "active-live-chat-id", "actual-end-time", "actual-start-time", "agcom-rating", "age-gating", "alcohol-content", "allowed", "altitude", "anatel-rating", "bbfc-rating", "bfvc-rating", "bitrate-bps", "blocked", "bmukk-rating", "caption", "category-id", "catv-rating", "catvfr-rating", "cbfc-rating", "ccc-rating", "cce-rating", "channel-id", "channel-title", "chfilm-rating", "chvrs-rating", "cicf-rating", "cna-rating", "cnc-rating", "comment-count", "concurrent-viewers", "container", "content-details", "content-rating", "country-restriction", "creation-time", "csa-rating", "cscf-rating", "czfilm-rating", "default", "default-audio-language", "default-language", "definition", "description", "dimension", "dislike-count", "djctq-rating", "djctq-rating-reasons", "duration", "duration-ms", "ecbmct-rating", "editor-suggestions", "editor-suggestions-availability", "eefilm-rating", "egfilm-rating", "eirin-rating", "embed-height", "embed-html", "embed-width", "embeddable", "etag", "exception", "failure-reason", "favorite-count", "fcbm-rating", "fco-rating", "file-details", "file-details-availability", "file-name", "file-size", "file-type", "fmoc-rating", "fpb-rating", "fpb-rating-reasons", "fsk-rating", "grfilm-rating", "has-custom-thumbnail", "height", "high", "icaa-rating", "id", "ifco-rating", "ilfilm-rating", "incaa-rating", "kfcb-rating", "kijkwijzer-rating", "kind", "kmrb-rating", "latitude", "license", "licensed-content", "like-count", "live-broadcast-content", "live-streaming-details", "localized", "location", "location-description", "longitude", "lsf-rating", "maxres", "mccaa-rating", "mccyp-rating", "mcst-rating", "mda-rating", "medietilsynet-rating", "medium", "meku-rating", "mibac-rating", "moc-rating", "moctw-rating", "monetization-details", "mpaa-rating", "mtrcb-rating", "nbc-rating", "nbcpl-rating", "nfrc-rating", "nfvcb-rating", "nkclv-rating", "oflc-rating", "parts-processed", "parts-total", "pefilm-rating", "player", "privacy-status", "processing-details", "processing-errors", "processing-failure-reason", "processing-hints", "processing-issues-availability", "processing-progress", "processing-status", "processing-warnings", "project-details", "projection", "public-stats-viewable", "publish-at", "published-at", "rcnof-rating", "recording-date", "recording-details", "region-restriction", "rejection-reason", "relevant-topic-ids", "resorteviolencia-rating", "restricted", "rtc-rating", "rte-rating", "russia-rating", "scheduled-end-time", "scheduled-start-time", "skfilm-rating", "smais-rating", "smsa-rating", "snippet", "standard", "statistics", "status", "suggestions", "tag-suggestions-availability", "tags", "thumbnails", "thumbnails-availability", "time-left-ms", "title", "topic-categories", "topic-details", "topic-ids", "tvpg-rating", "upload-status", "url", "video-game-rating", "view-count", "width", "yt-rating"]); err.issues.push(CLIError::Field(FieldError::Unknown(temp_cursor.to_string(), suggestion, value.map(|v| v.to_string())))); None } @@ -6541,6 +6611,17 @@ impl<'n> Engine<'n> { } } }, + ("super-chat-events", Some(opt)) => { + match opt.subcommand() { + ("list", Some(opt)) => { + call_result = self._super_chat_events_list(opt, dry_run, &mut err); + }, + _ => { + err.issues.push(CLIError::MissingMethodError("super-chat-events".to_string())); + writeln!(io::stderr(), "{}\n", opt.usage()).ok(); + } + } + }, ("thumbnails", Some(opt)) => { match opt.subcommand() { ("set", Some(opt)) => { @@ -8081,6 +8162,31 @@ fn main() { ]), ]), + ("super-chat-events", "methods: 'list'", vec![ + ("list", + Some(r##"Lists Super Chat events for a channel."##), + "Details at http://byron.github.io/google-apis-rs/google_youtube3_cli/super-chat-events_list", + vec![ + (Some(r##"part"##), + None, + Some(r##"The part parameter specifies the superChatEvent resource parts that the API response will include. Supported values are id and snippet."##), + Some(true), + Some(false)), + + (Some(r##"v"##), + Some(r##"p"##), + Some(r##"Set various optional parameters, matching the key=value form"##), + Some(false), + Some(true)), + + (Some(r##"out"##), + Some(r##"o"##), + Some(r##"Specify the file into which to write the program's output"##), + Some(false), + Some(false)), + ]), + ]), + ("thumbnails", "methods: 'set'", vec![ ("set", Some(r##"Uploads a custom video thumbnail to YouTube and sets it for a video."##), @@ -8366,7 +8472,7 @@ fn main() { let mut app = App::new("youtube3") .author("Sebastian Thiel ") - .version("1.0.4+20161202") + .version("1.0.4+20170130") .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 57b2f839c5..989ccfca87 100644 --- a/gen/youtube3/Cargo.toml +++ b/gen/youtube3/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtube3" -version = "1.0.4+20161202" +version = "1.0.4+20170130" 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.4+20161202" +documentation = "https://docs.rs/google-youtube3/1.0.4+20170130" license = "MIT" keywords = ["youtube", "google", "protocol", "web", "api"] diff --git a/gen/youtube3/README.md b/gen/youtube3/README.md index 64d36e0b2d..054b1caf11 100644 --- a/gen/youtube3/README.md +++ b/gen/youtube3/README.md @@ -5,84 +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.4+20161202*, where *20161202* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *YouTube* crate version *1.0.4+20170130*, where *20170130* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161202/google_youtube3/struct.YouTube.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.YouTube.html) ... -* [activities](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.Activity.html) - * [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ActivityListCall.html) -* [captions](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.Caption.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CaptionDeleteCall.html), [*download*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CaptionDownloadCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CaptionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CaptionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CaptionUpdateCall.html) +* [activities](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.Activity.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ActivityInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ActivityListCall.html) +* [captions](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.Caption.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CaptionDeleteCall.html), [*download*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CaptionDownloadCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CaptionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CaptionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CaptionUpdateCall.html) * channel banners - * [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ChannelBannerInsertCall.html) -* [channel sections](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ChannelSection.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ChannelSectionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ChannelSectionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ChannelSectionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ChannelSectionUpdateCall.html) -* [channels](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.Channel.html) - * [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ChannelListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ChannelUpdateCall.html) -* [comment threads](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CommentThread.html) - * [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CommentThreadInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CommentThreadListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CommentThreadUpdateCall.html) -* [comments](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.Comment.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CommentDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CommentListCall.html), [*mark as spam*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CommentMarkAsSpamCall.html), [*set moderation status*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CommentSetModerationStatuCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CommentUpdateCall.html) -* [fan funding events](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.FanFundingEvent.html) - * [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.FanFundingEventListCall.html) -* [guide categories](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.GuideCategory.html) - * [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.GuideCategoryListCall.html) -* [i18n languages](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.I18nLanguage.html) - * [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.I18nLanguageListCall.html) -* [i18n regions](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.I18nRegion.html) - * [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.I18nRegionListCall.html) -* [live broadcasts](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveBroadcast.html) - * [*bind*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveBroadcastBindCall.html), [*control*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveBroadcastControlCall.html), [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveBroadcastDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveBroadcastInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveBroadcastListCall.html), [*transition*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveBroadcastTransitionCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveBroadcastUpdateCall.html) -* [live chat bans](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatBan.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatBanDeleteCall.html) and [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatBanInsertCall.html) -* [live chat messages](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatMessage.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatMessageDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatMessageInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatMessageListCall.html) -* [live chat moderators](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatModerator.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatModeratorDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatModeratorInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveChatModeratorListCall.html) -* [live streams](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveStream.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveStreamDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveStreamInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveStreamListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.LiveStreamUpdateCall.html) -* [playlist items](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.PlaylistItem.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.PlaylistItemDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.PlaylistItemInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.PlaylistItemListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.PlaylistItemUpdateCall.html) -* [playlists](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.Playlist.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.PlaylistDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.PlaylistInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.PlaylistListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.PlaylistUpdateCall.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ChannelBannerInsertCall.html) +* [channel sections](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ChannelSection.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ChannelSectionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ChannelSectionInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ChannelSectionListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ChannelSectionUpdateCall.html) +* [channels](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.Channel.html) + * [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ChannelListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ChannelUpdateCall.html) +* [comment threads](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CommentThread.html) + * [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CommentThreadInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CommentThreadListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CommentThreadUpdateCall.html) +* [comments](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.Comment.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CommentDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CommentInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CommentListCall.html), [*mark as spam*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CommentMarkAsSpamCall.html), [*set moderation status*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CommentSetModerationStatuCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CommentUpdateCall.html) +* [fan funding events](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.FanFundingEvent.html) + * [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.FanFundingEventListCall.html) +* [guide categories](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.GuideCategory.html) + * [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.GuideCategoryListCall.html) +* [i18n languages](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.I18nLanguage.html) + * [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.I18nLanguageListCall.html) +* [i18n regions](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.I18nRegion.html) + * [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.I18nRegionListCall.html) +* [live broadcasts](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveBroadcast.html) + * [*bind*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveBroadcastBindCall.html), [*control*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveBroadcastControlCall.html), [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveBroadcastDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveBroadcastInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveBroadcastListCall.html), [*transition*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveBroadcastTransitionCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveBroadcastUpdateCall.html) +* [live chat bans](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatBan.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatBanDeleteCall.html) and [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatBanInsertCall.html) +* [live chat messages](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatMessage.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatMessageDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatMessageInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatMessageListCall.html) +* [live chat moderators](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatModerator.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatModeratorDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatModeratorInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveChatModeratorListCall.html) +* [live streams](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveStream.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveStreamDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveStreamInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveStreamListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.LiveStreamUpdateCall.html) +* [playlist items](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.PlaylistItem.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.PlaylistItemDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.PlaylistItemInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.PlaylistItemListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.PlaylistItemUpdateCall.html) +* [playlists](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.Playlist.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.PlaylistDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.PlaylistInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.PlaylistListCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.PlaylistUpdateCall.html) * search - * [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.SearchListCall.html) -* [sponsors](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.Sponsor.html) - * [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.SponsorListCall.html) -* [subscriptions](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.Subscription.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.SubscriptionInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.SubscriptionListCall.html) -* [thumbnails](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.Thumbnail.html) - * [*set*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ThumbnailSetCall.html) -* [video abuse report reasons](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoAbuseReportReason.html) - * [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoAbuseReportReasonListCall.html) -* [video categories](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoCategory.html) - * [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoCategoryListCall.html) -* [videos](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.Video.html) - * [*delete*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoDeleteCall.html), [*get rating*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoGetRatingCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoListCall.html), [*rate*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoRateCall.html), [*report abuse*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoReportAbuseCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoUpdateCall.html) + * [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.SearchListCall.html) +* [sponsors](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.Sponsor.html) + * [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.SponsorListCall.html) +* [subscriptions](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.Subscription.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.SubscriptionDeleteCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.SubscriptionInsertCall.html) and [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.SubscriptionListCall.html) +* [super chat events](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.SuperChatEvent.html) + * [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.SuperChatEventListCall.html) +* [thumbnails](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.Thumbnail.html) + * [*set*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ThumbnailSetCall.html) +* [video abuse report reasons](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoAbuseReportReason.html) + * [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoAbuseReportReasonListCall.html) +* [video categories](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoCategory.html) + * [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoCategoryListCall.html) +* [videos](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.Video.html) + * [*delete*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoDeleteCall.html), [*get rating*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoGetRatingCall.html), [*insert*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoInsertCall.html), [*list*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoListCall.html), [*rate*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoRateCall.html), [*report abuse*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoReportAbuseCall.html) and [*update*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoUpdateCall.html) * watermarks - * [*set*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.WatermarkSetCall.html) and [*unset*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.WatermarkUnsetCall.html) + * [*set*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.WatermarkSetCall.html) and [*unset*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.WatermarkUnsetCall.html) Upload supported by ... -* [*set thumbnails*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ThumbnailSetCall.html) -* [*insert captions*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CaptionInsertCall.html) -* [*insert videos*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.VideoInsertCall.html) -* [*set watermarks*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.WatermarkSetCall.html) -* [*insert channel banners*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.ChannelBannerInsertCall.html) -* [*update captions*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CaptionUpdateCall.html) +* [*set thumbnails*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ThumbnailSetCall.html) +* [*insert captions*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CaptionInsertCall.html) +* [*insert videos*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.VideoInsertCall.html) +* [*set watermarks*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.WatermarkSetCall.html) +* [*insert channel banners*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.ChannelBannerInsertCall.html) +* [*update captions*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CaptionUpdateCall.html) Download supported by ... -* [*download captions*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.CaptionDownloadCall.html) +* [*download captions*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.CaptionDownloadCall.html) Subscription supported by ... -* [*list playlist items*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.PlaylistItemListCall.html) +* [*list playlist items*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/struct.PlaylistItemListCall.html) @@ -90,17 +92,17 @@ Subscription supported by ... The API is structured into the following primary items: -* **[Hub](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/struct.YouTube.html)** +* **[Hub](https://docs.rs/google-youtube3/1.0.4+20170130/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.4+20161202/google_youtube3/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtube3/1.0.4+20170130/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.4+20161202/google_youtube3/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtube3/1.0.4+20161202/google_youtube3/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtube3/1.0.4+20170130/google_youtube3/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -200,17 +202,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-youtube3/1.0.4+20161202/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.4+20170130/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.4+20161202/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.4+20170130/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.4+20161202/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.4+20170130/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.4+20161202/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.4+20170130/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")`. @@ -220,29 +222,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.4+20161202/google_youtube3/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-youtube3/1.0.4+20161202/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.4+20170130/google_youtube3/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtube3/1.0.4+20170130/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.4+20161202/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.4+20170130/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.4+20161202/google_youtube3/trait.RequestValue.html) and -[decodable](https://docs.rs/google-youtube3/1.0.4+20161202/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.4+20170130/google_youtube3/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtube3/1.0.4+20170130/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.4+20161202/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.4+20170130/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.4+20161202/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.4+20170130/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.4+20161202/google_youtube3/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtube3/1.0.4+20170130/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 8978b64511..17042aebcb 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.4+20161202*, where *20161202* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *YouTube* crate version *1.0.4+20170130*, where *20170130* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *YouTube* *v3* API can be found at the //! [official documentation site](https://developers.google.com/youtube/v3). @@ -53,6 +53,8 @@ //! * [*list*](struct.SponsorListCall.html) //! * [subscriptions](struct.Subscription.html) //! * [*delete*](struct.SubscriptionDeleteCall.html), [*insert*](struct.SubscriptionInsertCall.html) and [*list*](struct.SubscriptionListCall.html) +//! * [super chat events](struct.SuperChatEvent.html) +//! * [*list*](struct.SuperChatEventListCall.html) //! * [thumbnails](struct.Thumbnail.html) //! * [*set*](struct.ThumbnailSetCall.html) //! * [video abuse report reasons](struct.VideoAbuseReportReason.html) @@ -255,7 +257,7 @@ // 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 +// 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)] @@ -412,8 +414,6 @@ pub struct YouTube { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for YouTube {} @@ -426,8 +426,6 @@ impl<'a, C, A> YouTube client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/youtube/v3/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -494,6 +492,9 @@ impl<'a, C, A> YouTube pub fn subscriptions(&'a self) -> SubscriptionMethods<'a, C, A> { SubscriptionMethods { hub: &self } } + pub fn super_chat_events(&'a self) -> SuperChatEventMethods<'a, C, A> { + SuperChatEventMethods { hub: &self } + } pub fn thumbnails(&'a self) -> ThumbnailMethods<'a, C, A> { ThumbnailMethods { hub: &self } } @@ -519,26 +520,6 @@ impl<'a, C, A> YouTube self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/youtube/v3/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -1021,6 +1002,61 @@ impl ToParts for FanFundingEvent { } } +/// 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 super chat events](struct.SuperChatEventListCall.html) (response) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SuperChatEventListResponse { + /// Serialized EventId of the request which produced this response. + #[serde(rename="eventId")] + pub event_id: Option, + /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#superChatEventListResponse". + pub kind: Option, + /// The visitorId identifies the visitor. + #[serde(rename="visitorId")] + pub visitor_id: Option, + /// A list of Super Chat purchases that match the request criteria. + pub items: Option>, + /// no description provided + #[serde(rename="tokenPagination")] + pub token_pagination: Option, + /// Etag of this resource. + pub etag: Option, + /// no description provided + #[serde(rename="pageInfo")] + pub page_info: Option, +} + +impl ResponseResult for SuperChatEventListResponse {} + +impl ToParts for SuperChatEventListResponse { + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// the parts you want to see in the server response. + fn to_parts(&self) -> String { + let mut r = String::new(); + if self.event_id.is_some() { r = r + "eventId,"; } + if self.next_page_token.is_some() { r = r + "nextPageToken,"; } + if self.kind.is_some() { r = r + "kind,"; } + if self.visitor_id.is_some() { r = r + "visitorId,"; } + if self.items.is_some() { r = r + "items,"; } + if self.token_pagination.is_some() { r = r + "tokenPagination,"; } + if self.etag.is_some() { r = r + "etag,"; } + if self.page_info.is_some() { r = r + "pageInfo,"; } + r.pop(); + r + } +} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1037,62 +1073,27 @@ impl Part for LiveChatTextMessageDetails {} /// 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 playlists](struct.PlaylistListCall.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 PlaylistListResponse { - /// Serialized EventId of the request which produced this response. - #[serde(rename="eventId")] - pub event_id: Option, - /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. - #[serde(rename="nextPageToken")] - pub next_page_token: Option, - /// Identifies what kind of resource this is. Value: the fixed string "youtube#playlistListResponse". - pub kind: Option, - /// The visitorId identifies the visitor. - #[serde(rename="visitorId")] - pub visitor_id: Option, - /// A list of playlists that match the request criteria. - pub items: Option>, - /// no description provided - #[serde(rename="tokenPagination")] - pub token_pagination: Option, - /// Etag of this resource. - pub etag: Option, - /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. - #[serde(rename="prevPageToken")] - pub prev_page_token: Option, - /// no description provided - #[serde(rename="pageInfo")] - pub page_info: Option, +pub struct LiveChatSuperChatDetails { + /// The tier in which the amount belongs to. Lower amounts belong to lower tiers. Starts at 1. + pub tier: Option, + /// The currency in which the purchase was made. + pub currency: Option, + /// A rendered string that displays the fund amount and currency to the user. + #[serde(rename="amountDisplayString")] + pub amount_display_string: Option, + /// The amount purchased by the user, in micros (1,750,000 micros = 1.75). + #[serde(rename="amountMicros")] + pub amount_micros: Option, + /// The comment added by the user to this Super Chat event. + #[serde(rename="userComment")] + pub user_comment: Option, } -impl ResponseResult for PlaylistListResponse {} +impl Part for LiveChatSuperChatDetails {} -impl ToParts for PlaylistListResponse { - /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. - /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or - /// the parts you want to see in the server response. - fn to_parts(&self) -> String { - let mut r = String::new(); - if self.event_id.is_some() { r = r + "eventId,"; } - if self.next_page_token.is_some() { r = r + "nextPageToken,"; } - if self.kind.is_some() { r = r + "kind,"; } - if self.visitor_id.is_some() { r = r + "visitorId,"; } - if self.items.is_some() { r = r + "items,"; } - if self.token_pagination.is_some() { r = r + "tokenPagination,"; } - if self.etag.is_some() { r = r + "etag,"; } - if self.prev_page_token.is_some() { r = r + "prevPageToken,"; } - if self.page_info.is_some() { r = r + "pageInfo,"; } - r.pop(); - r - } -} /// Pings that the app shall fire (authenticated by biscotti cookie). Each ping has a context, in which the app must fire the ping, and a url identifying the ping. /// @@ -1199,6 +1200,9 @@ pub struct ChannelTopicDetails { /// A list of Freebase topic IDs associated with the channel. You can retrieve information about each topic using the Freebase Topic API. #[serde(rename="topicIds")] pub topic_ids: Option>, + /// A list of Wikipedia URLs that describe the channel's content. + #[serde(rename="topicCategories")] + pub topic_categories: Option>, } impl Part for ChannelTopicDetails {} @@ -1276,6 +1280,23 @@ pub struct VideoMonetizationDetails { impl Part for VideoMonetizationDetails {} +/// The contentOwnerDetails object encapsulates channel data that is relevant for YouTube Partners linked with the channel. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct ChannelContentOwnerDetails { + /// The ID of the content owner linked to the channel. + #[serde(rename="contentOwner")] + pub content_owner: Option, + /// The date and time of when the channel was linked to the content owner. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(rename="timeLinked")] + pub time_linked: Option, +} + +impl Part for ChannelContentOwnerDetails {} + + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -1316,39 +1337,38 @@ pub struct VideoAbuseReportReasonSnippet { impl Part for VideoAbuseReportReasonSnippet {} -/// Describes processing status and progress and availability of some other Video resource parts. +/// 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 VideoProcessingDetails { - /// This value indicates whether file details are available for the uploaded video. You can retrieve a video's file details by requesting the fileDetails part in your videos.list() request. - #[serde(rename="fileDetailsAvailability")] - pub file_details_availability: Option, - /// This value indicates whether video editing suggestions, which might improve video quality or the playback experience, are available for the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. - #[serde(rename="editorSuggestionsAvailability")] - pub editor_suggestions_availability: Option, - /// The video's processing status. This value indicates whether YouTube was able to process the video or if the video is still being processed. - #[serde(rename="processingStatus")] - pub processing_status: Option, - /// This value indicates whether the video processing engine has generated suggestions that might improve YouTube's ability to process the the video, warnings that explain video processing problems, or errors that cause video processing problems. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. - #[serde(rename="processingIssuesAvailability")] - pub processing_issues_availability: Option, - /// The reason that YouTube failed to process the video. This property will only have a value if the processingStatus property's value is failed. - #[serde(rename="processingFailureReason")] - pub processing_failure_reason: Option, - /// This value indicates whether thumbnail images have been generated for the video. - #[serde(rename="thumbnailsAvailability")] - pub thumbnails_availability: Option, - /// The processingProgress object contains information about the progress YouTube has made in processing the video. The values are really only relevant if the video's processing status is processing. - #[serde(rename="processingProgress")] - pub processing_progress: Option, - /// This value indicates whether keyword (tag) suggestions are available for the video. Tags can be added to a video's metadata to make it easier for other users to find the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. - #[serde(rename="tagSuggestionsAvailability")] - pub tag_suggestions_availability: Option, +pub struct SuperChatEventSnippet { + /// The text contents of the comment left by the user. + #[serde(rename="commentText")] + pub comment_text: Option, + /// Channel id where the event occurred. + #[serde(rename="channelId")] + pub channel_id: Option, + /// Details about the supporter. + #[serde(rename="supporterDetails")] + pub supporter_details: Option, + /// The purchase amount, in micros of the purchase currency. e.g., 1 is represented as 1000000. + #[serde(rename="amountMicros")] + pub amount_micros: Option, + /// The currency in which the purchase was made. ISO 4217. + pub currency: Option, + /// The tier for the paid message, which is based on the amount of money spent to purchase the message. + #[serde(rename="messageType")] + pub message_type: Option, + /// A rendered string that displays the purchase amount and currency (e.g., "$1.00"). The string is rendered for the given language. + #[serde(rename="displayString")] + pub display_string: Option, + /// The date and time when the event occurred. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. + #[serde(rename="createdAt")] + pub created_at: Option, } -impl Part for VideoProcessingDetails {} +impl Part for SuperChatEventSnippet {} /// The conversionPings object encapsulates information about conversion pings that need to be respected by the channel. @@ -1787,15 +1807,9 @@ impl Part for VideoSnippet {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct LiveChatMessageSnippet { - /// Contains a string that can be displayed to the user. If this field is not present the message is silent, at the moment only messages of type TOMBSTONE and CHAT_ENDED_EVENT are silent. - #[serde(rename="displayMessage")] - pub display_message: Option, /// no description provided #[serde(rename="messageRetractedDetails")] pub message_retracted_details: Option, - /// Details about the funding event, this is only set if the type is 'fanFundingEvent'. - #[serde(rename="fanFundingEventDetails")] - pub fan_funding_event_details: Option, /// Whether the message has display content that should be displayed to users. #[serde(rename="hasDisplayContent")] pub has_display_content: Option, @@ -1803,14 +1817,8 @@ pub struct LiveChatMessageSnippet { #[serde(rename="publishedAt")] pub published_at: Option, /// no description provided - #[serde(rename="userBannedDetails")] - pub user_banned_details: Option, - /// no description provided #[serde(rename="liveChatId")] pub live_chat_id: Option, - /// The ID of the user that authored this message, this field is not always filled. textMessageEvent - the user that wrote the message fanFundingEvent - the user that funded the broadcast newSponsorEvent - the user that just became a sponsor messageDeletedEvent - the moderator that took the action messageRetractedEvent - the author that retracted their message userBannedEvent - the moderator that took the action - #[serde(rename="authorChannelId")] - pub author_channel_id: Option, /// no description provided #[serde(rename="pollEditedDetails")] pub poll_edited_details: Option, @@ -1818,11 +1826,26 @@ pub struct LiveChatMessageSnippet { #[serde(rename="textMessageDetails")] pub text_message_details: Option, /// no description provided - #[serde(rename="messageDeletedDetails")] - pub message_deleted_details: Option, - /// no description provided #[serde(rename="pollVotedDetails")] pub poll_voted_details: Option, + /// Contains a string that can be displayed to the user. If this field is not present the message is silent, at the moment only messages of type TOMBSTONE and CHAT_ENDED_EVENT are silent. + #[serde(rename="displayMessage")] + pub display_message: Option, + /// Details about the Super Chat event, this is only set if the type is 'superChatEvent'. + #[serde(rename="superChatDetails")] + pub super_chat_details: Option, + /// Details about the funding event, this is only set if the type is 'fanFundingEvent'. + #[serde(rename="fanFundingEventDetails")] + pub fan_funding_event_details: Option, + /// no description provided + #[serde(rename="userBannedDetails")] + pub user_banned_details: Option, + /// The ID of the user that authored this message, this field is not always filled. textMessageEvent - the user that wrote the message fanFundingEvent - the user that funded the broadcast newSponsorEvent - the user that just became a sponsor messageDeletedEvent - the moderator that took the action messageRetractedEvent - the author that retracted their message userBannedEvent - the moderator that took the action superChatEvent - the user that made the purchase + #[serde(rename="authorChannelId")] + pub author_channel_id: Option, + /// no description provided + #[serde(rename="messageDeletedDetails")] + pub message_deleted_details: Option, /// no description provided #[serde(rename="pollOpenedDetails")] pub poll_opened_details: Option, @@ -3661,6 +3684,41 @@ pub struct ActivitySnippet { impl Part for ActivitySnippet {} +/// Describes processing status and progress and availability of some other Video resource parts. +/// +/// This type is not used in any activity, and only used as *part* of another schema. +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct VideoProcessingDetails { + /// This value indicates whether file details are available for the uploaded video. You can retrieve a video's file details by requesting the fileDetails part in your videos.list() request. + #[serde(rename="fileDetailsAvailability")] + pub file_details_availability: Option, + /// This value indicates whether video editing suggestions, which might improve video quality or the playback experience, are available for the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. + #[serde(rename="editorSuggestionsAvailability")] + pub editor_suggestions_availability: Option, + /// The video's processing status. This value indicates whether YouTube was able to process the video or if the video is still being processed. + #[serde(rename="processingStatus")] + pub processing_status: Option, + /// This value indicates whether the video processing engine has generated suggestions that might improve YouTube's ability to process the the video, warnings that explain video processing problems, or errors that cause video processing problems. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. + #[serde(rename="processingIssuesAvailability")] + pub processing_issues_availability: Option, + /// The reason that YouTube failed to process the video. This property will only have a value if the processingStatus property's value is failed. + #[serde(rename="processingFailureReason")] + pub processing_failure_reason: Option, + /// This value indicates whether thumbnail images have been generated for the video. + #[serde(rename="thumbnailsAvailability")] + pub thumbnails_availability: Option, + /// The processingProgress object contains information about the progress YouTube has made in processing the video. The values are really only relevant if the video's processing status is processing. + #[serde(rename="processingProgress")] + pub processing_progress: Option, + /// This value indicates whether keyword (tag) suggestions are available for the video. Tags can be added to a video's metadata to make it easier for other users to find the video. You can retrieve these suggestions by requesting the suggestions part in your videos.list() request. + #[serde(rename="tagSuggestionsAvailability")] + pub tag_suggestions_availability: Option, +} + +impl Part for VideoProcessingDetails {} + + /// Basic details about a comment, such as its author and text. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4204,6 +4262,44 @@ pub struct LiveChatModeratorSnippet { impl Part for LiveChatModeratorSnippet {} +/// A superChatEvent resource represents a Super Chat purchase on a YouTube channel. +/// +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where 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 super chat events](struct.SuperChatEventListCall.html) (none) +/// +#[derive(Default, Clone, Debug, Serialize, Deserialize)] +pub struct SuperChatEvent { + /// The snippet object contains basic details about the Super Chat event. + pub snippet: Option, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#superChatEvent". + pub kind: Option, + /// Etag of this resource. + pub etag: Option, + /// The ID that YouTube assigns to uniquely identify the Super Chat event. + pub id: Option, +} + +impl Resource for SuperChatEvent {} + +impl ToParts for SuperChatEvent { + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// the parts you want to see in the server response. + fn to_parts(&self) -> String { + let mut r = String::new(); + if self.snippet.is_some() { r = r + "snippet,"; } + if self.kind.is_some() { r = r + "kind,"; } + if self.etag.is_some() { r = r + "etag,"; } + if self.id.is_some() { r = r + "id,"; } + r.pop(); + r + } +} + /// There is no detailed description. /// /// This type is not used in any activity, and only used as *part* of another schema. @@ -4245,22 +4341,64 @@ pub struct PlaylistItemContentDetails { impl Part for PlaylistItemContentDetails {} -/// The contentOwnerDetails object encapsulates channel data that is relevant for YouTube Partners linked with the channel. +/// There is no detailed description. /// -/// This type is not used in any activity, and only used as *part* of another schema. +/// # Activities +/// +/// This type is used in activities, which are methods you may call on this type or where this type is involved in. +/// The list links the activity name, along with information about where it is used (one of *request* and *response*). +/// +/// * [list playlists](struct.PlaylistListCall.html) (response) /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] -pub struct ChannelContentOwnerDetails { - /// The ID of the content owner linked to the channel. - #[serde(rename="contentOwner")] - pub content_owner: Option, - /// The date and time of when the channel was linked to the content owner. The value is specified in ISO 8601 (YYYY-MM-DDThh:mm:ss.sZ) format. - #[serde(rename="timeLinked")] - pub time_linked: Option, +pub struct PlaylistListResponse { + /// Serialized EventId of the request which produced this response. + #[serde(rename="eventId")] + pub event_id: Option, + /// The token that can be used as the value of the pageToken parameter to retrieve the next page in the result set. + #[serde(rename="nextPageToken")] + pub next_page_token: Option, + /// Identifies what kind of resource this is. Value: the fixed string "youtube#playlistListResponse". + pub kind: Option, + /// The visitorId identifies the visitor. + #[serde(rename="visitorId")] + pub visitor_id: Option, + /// A list of playlists that match the request criteria. + pub items: Option>, + /// no description provided + #[serde(rename="tokenPagination")] + pub token_pagination: Option, + /// Etag of this resource. + pub etag: Option, + /// The token that can be used as the value of the pageToken parameter to retrieve the previous page in the result set. + #[serde(rename="prevPageToken")] + pub prev_page_token: Option, + /// no description provided + #[serde(rename="pageInfo")] + pub page_info: Option, } -impl Part for ChannelContentOwnerDetails {} +impl ResponseResult for PlaylistListResponse {} +impl ToParts for PlaylistListResponse { + /// Return a comma separated list of members that are currently set, i.e. for which `self.member.is_some()`. + /// The produced string is suitable for use as a parts list that indicates the parts you are sending, and/or + /// the parts you want to see in the server response. + fn to_parts(&self) -> String { + let mut r = String::new(); + if self.event_id.is_some() { r = r + "eventId,"; } + if self.next_page_token.is_some() { r = r + "nextPageToken,"; } + if self.kind.is_some() { r = r + "kind,"; } + if self.visitor_id.is_some() { r = r + "visitorId,"; } + if self.items.is_some() { r = r + "items,"; } + if self.token_pagination.is_some() { r = r + "tokenPagination,"; } + if self.etag.is_some() { r = r + "etag,"; } + if self.prev_page_token.is_some() { r = r + "prevPageToken,"; } + if self.page_info.is_some() { r = r + "pageInfo,"; } + r.pop(); + r + } +} /// There is no detailed description. /// @@ -5265,6 +5403,9 @@ pub struct VideoTopicDetails { /// Similar to topic_id, except that these topics are merely relevant to the video. These are topics that may be mentioned in, or appear in the video. You can retrieve information about each topic using Freebase Topic API. #[serde(rename="relevantTopicIds")] pub relevant_topic_ids: Option>, + /// A list of Wikipedia URLs that provide a high-level description of the video's content. + #[serde(rename="topicCategories")] + pub topic_categories: Option>, } impl Part for VideoTopicDetails {} @@ -8118,6 +8259,29 @@ impl<'a, C, A> LiveBroadcastMethods<'a, C, A> { } } + /// Create a builder to help you perform the following task: + /// + /// Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active. + /// + /// # Arguments + /// + /// * `broadcastStatus` - The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to. + /// * `id` - The id parameter specifies the unique ID of the broadcast that is transitioning to another status. + /// * `part` - The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + pub fn transition(&self, broadcast_status: &str, id: &str, part: &str) -> LiveBroadcastTransitionCall<'a, C, A> { + LiveBroadcastTransitionCall { + hub: self.hub, + _broadcast_status: broadcast_status.to_string(), + _id: id.to_string(), + _part: part.to_string(), + _on_behalf_of_content_owner_channel: Default::default(), + _on_behalf_of_content_owner: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } + /// Create a builder to help you perform the following task: /// /// Creates a broadcast. @@ -8182,29 +8346,6 @@ impl<'a, C, A> LiveBroadcastMethods<'a, C, A> { _additional_params: Default::default(), } } - - /// Create a builder to help you perform the following task: - /// - /// Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active. - /// - /// # Arguments - /// - /// * `broadcastStatus` - The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to. - /// * `id` - The id parameter specifies the unique ID of the broadcast that is transitioning to another status. - /// * `part` - The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. - pub fn transition(&self, broadcast_status: &str, id: &str, part: &str) -> LiveBroadcastTransitionCall<'a, C, A> { - LiveBroadcastTransitionCall { - hub: self.hub, - _broadcast_status: broadcast_status.to_string(), - _id: id.to_string(), - _part: part.to_string(), - _on_behalf_of_content_owner_channel: Default::default(), - _on_behalf_of_content_owner: Default::default(), - _delegate: Default::default(), - _scopes: Default::default(), - _additional_params: Default::default(), - } - } } @@ -8360,6 +8501,67 @@ impl<'a, C, A> SearchMethods<'a, C, A> { +/// A builder providing access to all methods supported on *superChatEvent* resources. +/// It is not used directly, but through the `YouTube` hub. +/// +/// # Example +/// +/// Instantiate a resource builder +/// +/// ```test_harness,no_run +/// extern crate hyper; +/// extern crate yup_oauth2 as oauth2; +/// extern crate google_youtube3 as youtube3; +/// +/// # #[test] fn egal() { +/// use std::default::Default; +/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// use youtube3::YouTube; +/// +/// let secret: ApplicationSecret = Default::default(); +/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// hyper::Client::new(), +/// ::default(), None); +/// let mut hub = YouTube::new(hyper::Client::new(), auth); +/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders* +/// // like `list(...)` +/// // to build up your call. +/// let rb = hub.super_chat_events(); +/// # } +/// ``` +pub struct SuperChatEventMethods<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, +} + +impl<'a, C, A> MethodsBuilder for SuperChatEventMethods<'a, C, A> {} + +impl<'a, C, A> SuperChatEventMethods<'a, C, A> { + + /// Create a builder to help you perform the following task: + /// + /// Lists Super Chat events for a channel. + /// + /// # Arguments + /// + /// * `part` - The part parameter specifies the superChatEvent resource parts that the API response will include. Supported values are id and snippet. + pub fn list(&self, part: &str) -> SuperChatEventListCall<'a, C, A> { + SuperChatEventListCall { + hub: self.hub, + _part: part.to_string(), + _page_token: Default::default(), + _max_results: Default::default(), + _hl: Default::default(), + _delegate: Default::default(), + _scopes: Default::default(), + _additional_params: Default::default(), + } + } +} + + + /// A builder providing access to all methods supported on *thumbnail* resources. /// It is not used directly, but through the `YouTube` hub. /// @@ -8598,7 +8800,7 @@ impl<'a, C, A> ChannelSectionListCall<'a, C, A> where C: BorrowMut ChannelSectionInsertCall<'a, C, A> where C: BorrowMut ChannelSectionDeleteCall<'a, C, A> where C: BorrowMut ChannelSectionUpdateCall<'a, C, A> where C: BorrowMut PlaylistInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "playlists"; + let mut url = "https://www.googleapis.com/youtube/v3/playlists".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -9999,7 +10201,7 @@ impl<'a, C, A> PlaylistListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "playlists"; + let mut url = "https://www.googleapis.com/youtube/v3/playlists".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -10281,7 +10483,7 @@ impl<'a, C, A> PlaylistDeleteCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "playlists"; + let mut url = "https://www.googleapis.com/youtube/v3/playlists".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10509,7 +10711,7 @@ impl<'a, C, A> PlaylistUpdateCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "playlists"; + let mut url = "https://www.googleapis.com/youtube/v3/playlists".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -10770,7 +10972,7 @@ impl<'a, C, A> VideoReportAbuseCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "videos/reportAbuse"; + let mut url = "https://www.googleapis.com/youtube/v3/videos/reportAbuse".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11057,7 +11259,7 @@ impl<'a, C, A> VideoListCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "videos"; + let mut url = "https://www.googleapis.com/youtube/v3/videos".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -11366,7 +11568,7 @@ impl<'a, C, A> VideoRateCall<'a, C, A> where C: BorrowMut, A: oau } - let mut url = self.hub._base_url.clone() + "videos/rate"; + let mut url = "https://www.googleapis.com/youtube/v3/videos/rate".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11585,7 +11787,7 @@ impl<'a, C, A> VideoGetRatingCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "videos/getRating"; + let mut url = "https://www.googleapis.com/youtube/v3/videos/getRating".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -11812,7 +12014,7 @@ impl<'a, C, A> VideoDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "videos"; + let mut url = "https://www.googleapis.com/youtube/v3/videos".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12040,7 +12242,7 @@ impl<'a, C, A> VideoUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "videos"; + let mut url = "https://www.googleapis.com/youtube/v3/videos".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -12333,9 +12535,9 @@ impl<'a, C, A> VideoInsertCall<'a, C, A> where C: BorrowMut, A: o let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/youtube/v3/videos", "multipart") + ("https://www.googleapis.com/upload/youtube/v3/videos".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/youtube/v3/videos", "resumable") + ("https://www.googleapis.com/resumable/upload/youtube/v3/videos".to_string(), "resumable") } else { unreachable!() }; @@ -12767,7 +12969,7 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activities"; + let mut url = "https://www.googleapis.com/youtube/v3/activities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -13051,7 +13253,7 @@ impl<'a, C, A> ActivityInsertCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "activities"; + let mut url = "https://www.googleapis.com/youtube/v3/activities".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13332,7 +13534,7 @@ impl<'a, C, A> LiveStreamUpdateCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "liveStreams"; + let mut url = "https://www.googleapis.com/youtube/v3/liveStreams".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13620,7 +13822,7 @@ impl<'a, C, A> LiveStreamDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "liveStreams"; + let mut url = "https://www.googleapis.com/youtube/v3/liveStreams".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -13891,7 +14093,7 @@ impl<'a, C, A> LiveStreamListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "liveStreams"; + let mut url = "https://www.googleapis.com/youtube/v3/liveStreams".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -14200,7 +14402,7 @@ impl<'a, C, A> LiveStreamInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "liveStreams"; + let mut url = "https://www.googleapis.com/youtube/v3/liveStreams".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14492,7 +14694,7 @@ impl<'a, C, A> ChannelUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "channels"; + let mut url = "https://www.googleapis.com/youtube/v3/channels".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -14794,7 +14996,7 @@ impl<'a, C, A> ChannelListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "channels"; + let mut url = "https://www.googleapis.com/youtube/v3/channels".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -15099,9 +15301,9 @@ impl<'a, C, A> WatermarkSetCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/youtube/v3/watermarks/set", "multipart") + ("https://www.googleapis.com/upload/youtube/v3/watermarks/set".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/youtube/v3/watermarks/set", "resumable") + ("https://www.googleapis.com/resumable/upload/youtube/v3/watermarks/set".to_string(), "resumable") } else { unreachable!() }; @@ -15450,7 +15652,7 @@ impl<'a, C, A> WatermarkUnsetCall<'a, C, A> where C: BorrowMut, A } - let mut url = self.hub._base_url.clone() + "watermarks/unset"; + let mut url = "https://www.googleapis.com/youtube/v3/watermarks/unset".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -15673,7 +15875,7 @@ impl<'a, C, A> LiveChatModeratorInsertCall<'a, C, A> where C: BorrowMut LiveChatModeratorListCall<'a, C, A> where C: BorrowMut LiveChatModeratorDeleteCall<'a, C, A> where C: BorrowMut CaptionDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "captions"; + let mut url = "https://www.googleapis.com/youtube/v3/captions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -16645,9 +16847,9 @@ impl<'a, C, A> CaptionInsertCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/youtube/v3/captions", "multipart") + ("https://www.googleapis.com/upload/youtube/v3/captions".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/youtube/v3/captions", "resumable") + ("https://www.googleapis.com/resumable/upload/youtube/v3/captions".to_string(), "resumable") } else { unreachable!() }; @@ -17052,7 +17254,7 @@ impl<'a, C, A> CaptionListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "captions"; + let mut url = "https://www.googleapis.com/youtube/v3/captions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -17326,7 +17528,7 @@ impl<'a, C, A> CaptionDownloadCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "captions/{id}"; + let mut url = "https://www.googleapis.com/youtube/v3/captions/{id}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -17610,9 +17812,9 @@ impl<'a, C, A> CaptionUpdateCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/youtube/v3/captions", "multipart") + ("https://www.googleapis.com/upload/youtube/v3/captions".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/youtube/v3/captions", "resumable") + ("https://www.googleapis.com/resumable/upload/youtube/v3/captions".to_string(), "resumable") } else { unreachable!() }; @@ -17991,7 +18193,7 @@ impl<'a, C, A> I18nLanguageListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "i18nLanguages"; + let mut url = "https://www.googleapis.com/youtube/v3/i18nLanguages".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -18227,7 +18429,7 @@ impl<'a, C, A> GuideCategoryListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "guideCategories"; + let mut url = "https://www.googleapis.com/youtube/v3/guideCategories".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -18512,7 +18714,7 @@ impl<'a, C, A> CommentThreadListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "commentThreads"; + let mut url = "https://www.googleapis.com/youtube/v3/commentThreads".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -18816,7 +19018,7 @@ impl<'a, C, A> CommentThreadUpdateCall<'a, C, A> where C: BorrowMut CommentThreadInsertCall<'a, C, A> where C: BorrowMut CommentInsertCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "comments"; + let mut url = "https://www.googleapis.com/youtube/v3/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -19565,7 +19767,7 @@ impl<'a, C, A> CommentSetModerationStatuCall<'a, C, A> where C: BorrowMut CommentDeleteCall<'a, C, A> where C: BorrowMut, A: } - let mut url = self.hub._base_url.clone() + "comments"; + let mut url = "https://www.googleapis.com/youtube/v3/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -20016,7 +20218,7 @@ impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "comments"; + let mut url = "https://www.googleapis.com/youtube/v3/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -20281,7 +20483,7 @@ impl<'a, C, A> CommentUpdateCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "comments"; + let mut url = "https://www.googleapis.com/youtube/v3/comments".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -20521,7 +20723,7 @@ impl<'a, C, A> CommentMarkAsSpamCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "comments/markAsSpam"; + let mut url = "https://www.googleapis.com/youtube/v3/comments/markAsSpam".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::ForceSsl.as_ref().to_string(), ()); } @@ -20740,7 +20942,7 @@ impl<'a, C, A> PlaylistItemInsertCall<'a, C, A> where C: BorrowMut PlaylistItemDeleteCall<'a, C, A> where C: BorrowMut PlaylistItemListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "playlistItems"; + let mut url = "https://www.googleapis.com/youtube/v3/playlistItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -21512,7 +21714,7 @@ impl<'a, C, A> PlaylistItemUpdateCall<'a, C, A> where C: BorrowMut LiveChatMessageListCall<'a, C, A> where C: BorrowMut LiveChatMessageDeleteCall<'a, C, A> where C: BorrowMut LiveChatMessageInsertCall<'a, C, A> where C: BorrowMut VideoCategoryListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "videoCategories"; + let mut url = "https://www.googleapis.com/youtube/v3/videoCategories".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -22769,7 +22971,7 @@ impl<'a, C, A> I18nRegionListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "i18nRegions"; + let mut url = "https://www.googleapis.com/youtube/v3/i18nRegions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -23000,7 +23202,7 @@ impl<'a, C, A> SubscriptionInsertCall<'a, C, A> where C: BorrowMut SubscriptionDeleteCall<'a, C, A> where C: BorrowMut SubscriptionListCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "subscriptions"; + let mut url = "https://www.googleapis.com/youtube/v3/subscriptions".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -23808,7 +24010,7 @@ impl<'a, C, A> LiveChatBanInsertCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "liveChat/bans"; + let mut url = "https://www.googleapis.com/youtube/v3/liveChat/bans".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24048,7 +24250,7 @@ impl<'a, C, A> LiveChatBanDeleteCall<'a, C, A> where C: BorrowMut } - let mut url = self.hub._base_url.clone() + "liveChat/bans"; + let mut url = "https://www.googleapis.com/youtube/v3/liveChat/bans".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -24282,7 +24484,7 @@ impl<'a, C, A> SponsorListCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "sponsors"; + let mut url = "https://www.googleapis.com/youtube/v3/sponsors".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -24542,7 +24744,7 @@ impl<'a, C, A> VideoAbuseReportReasonListCall<'a, C, A> where C: BorrowMut LiveBroadcastControlCall<'a, C, A> where C: BorrowMut LiveBroadcastUpdateCall<'a, C, A> where C: BorrowMut LiveBroadcastBindCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "liveBroadcasts/bind"; + let mut url = "https://www.googleapis.com/youtube/v3/liveBroadcasts/bind".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Full.as_ref().to_string(), ()); } @@ -25627,6 +25829,297 @@ impl<'a, C, A> LiveBroadcastBindCall<'a, C, A> where C: BorrowMut } +/// Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active. +/// +/// A builder for the *transition* method supported by a *liveBroadcast* resource. +/// It is not used directly, but through a `LiveBroadcastMethods` instance. +/// +/// **Settable Parts** +/// +/// * *id* +/// * *snippet* +/// * *contentDetails* +/// * *status* +/// +/// # Scopes +/// +/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: +/// +/// * *https://www.googleapis.com/auth/youtube* +/// * *https://www.googleapis.com/auth/youtube.force-ssl* +/// +/// The default scope will be `Scope::Full`. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_youtube3 as youtube3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use youtube3::YouTube; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = YouTube::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.live_broadcasts().transition("broadcastStatus", "id", "part") +/// .on_behalf_of_content_owner_channel("magna") +/// .on_behalf_of_content_owner("ipsum") +/// .doit(); +/// # } +/// ``` +pub struct LiveBroadcastTransitionCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, + _broadcast_status: String, + _id: String, + _part: String, + _on_behalf_of_content_owner_channel: Option, + _on_behalf_of_content_owner: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for LiveBroadcastTransitionCall<'a, C, A> {} + +impl<'a, C, A> LiveBroadcastTransitionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, LiveBroadcast)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "youtube.liveBroadcasts.transition", + http_method: hyper::method::Method::Post }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); + params.push(("broadcastStatus", self._broadcast_status.to_string())); + params.push(("id", self._id.to_string())); + params.push(("part", self._part.to_string())); + if let Some(value) = self._on_behalf_of_content_owner_channel { + params.push(("onBehalfOfContentOwnerChannel", value.to_string())); + } + if let Some(value) = self._on_behalf_of_content_owner { + params.push(("onBehalfOfContentOwner", value.to_string())); + } + for &field in ["alt", "broadcastStatus", "id", "part", "onBehalfOfContentOwnerChannel", "onBehalfOfContentOwner"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/youtube/v3/liveBroadcasts/transition".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Full.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + Err(err) => { + dlg.response_json_decode_error(&json_response, &err); + return Err(Error::JsonDecodeError(json_response, err)); + } + } + }; + + dlg.finished(true); + return Ok(result_value) + } + } + } + } + + + /// The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to. + /// + /// Sets the *broadcast status* 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 broadcast_status(mut self, new_value: &str) -> LiveBroadcastTransitionCall<'a, C, A> { + self._broadcast_status = new_value.to_string(); + self + } + /// The id parameter specifies the unique ID of the broadcast that is transitioning to another status. + /// + /// 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) -> LiveBroadcastTransitionCall<'a, C, A> { + self._id = new_value.to_string(); + self + } + /// The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. + /// + /// Sets the *part* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + /// **Settable Parts** + /// + /// * *id* + /// * *snippet* + /// * *contentDetails* + /// * *status* + pub fn part(mut self, new_value: &str) -> LiveBroadcastTransitionCall<'a, C, A> { + self._part = new_value.to_string(); + self + } + /// This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. + /// + /// This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. + /// + /// Sets the *on behalf of content owner channel* query property to the given value. + pub fn on_behalf_of_content_owner_channel(mut self, new_value: &str) -> LiveBroadcastTransitionCall<'a, C, A> { + self._on_behalf_of_content_owner_channel = Some(new_value.to_string()); + self + } + /// Note: This parameter is intended exclusively for YouTube content partners. + /// + /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. + /// + /// Sets the *on behalf of content owner* query property to the given value. + pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> LiveBroadcastTransitionCall<'a, C, A> { + self._on_behalf_of_content_owner = Some(new_value.to_string()); + self + } + /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong + /// while executing the actual API request. + /// + /// It should be used to handle progress information, and to implement a certain level of resilience. + /// + /// Sets the *delegate* property to the given value. + pub fn delegate(mut self, new_value: &'a mut Delegate) -> LiveBroadcastTransitionCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> LiveBroadcastTransitionCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Full`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> LiveBroadcastTransitionCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Creates a broadcast. /// /// A builder for the *insert* method supported by a *liveBroadcast* resource. @@ -25674,14 +26167,14 @@ impl<'a, C, A> LiveBroadcastBindCall<'a, C, A> where C: BorrowMut /// req.status = Default::default(); // is LiveBroadcastStatus /// req.content_details = Default::default(); // is LiveBroadcastContentDetails /// req.snippet = Default::default(); // is LiveBroadcastSnippet -/// req.id = Some("dolore".to_string()); +/// req.id = Some("invidunt".to_string()); /// /// // You can configure optional parameters by calling the respective setters at will, and /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.live_broadcasts().insert(req) -/// .on_behalf_of_content_owner_channel("magna") -/// .on_behalf_of_content_owner("elitr") +/// .on_behalf_of_content_owner_channel("accusam") +/// .on_behalf_of_content_owner("labore") /// .doit(); /// # } /// ``` @@ -25737,7 +26230,7 @@ impl<'a, C, A> LiveBroadcastInsertCall<'a, C, A> where C: BorrowMut LiveBroadcastInsertCall<'a, C, A> where C: BorrowMut LiveBroadcastDeleteCall<'a, C, A> where C: BorrowMut LiveBroadcastDeleteCall<'a, C, A> where C: BorrowMut LiveBroadcastListCall<'a, C, A> where C: BorrowMut params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "liveBroadcasts"; + let mut url = "https://www.googleapis.com/youtube/v3/liveBroadcasts".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -26517,297 +27010,6 @@ impl<'a, C, A> LiveBroadcastListCall<'a, C, A> where C: BorrowMut } -/// Changes the status of a YouTube live broadcast and initiates any processes associated with the new status. For example, when you transition a broadcast's status to testing, YouTube starts to transmit video to that broadcast's monitor stream. Before calling this method, you should confirm that the value of the status.streamStatus property for the stream bound to your broadcast is active. -/// -/// A builder for the *transition* method supported by a *liveBroadcast* resource. -/// It is not used directly, but through a `LiveBroadcastMethods` instance. -/// -/// **Settable Parts** -/// -/// * *id* -/// * *snippet* -/// * *contentDetails* -/// * *status* -/// -/// # Scopes -/// -/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: -/// -/// * *https://www.googleapis.com/auth/youtube* -/// * *https://www.googleapis.com/auth/youtube.force-ssl* -/// -/// The default scope will be `Scope::Full`. -/// -/// # Example -/// -/// Instantiate a resource method builder -/// -/// ```test_harness,no_run -/// # extern crate hyper; -/// # extern crate yup_oauth2 as oauth2; -/// # extern crate google_youtube3 as youtube3; -/// # #[test] fn egal() { -/// # use std::default::Default; -/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; -/// # use youtube3::YouTube; -/// -/// # let secret: ApplicationSecret = Default::default(); -/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -/// # hyper::Client::new(), -/// # ::default(), None); -/// # let mut hub = YouTube::new(hyper::Client::new(), auth); -/// // You can configure optional parameters by calling the respective setters at will, and -/// // execute the final call using `doit()`. -/// // Values shown here are possibly random and not representative ! -/// let result = hub.live_broadcasts().transition("broadcastStatus", "id", "part") -/// .on_behalf_of_content_owner_channel("takimata") -/// .on_behalf_of_content_owner("dolores") -/// .doit(); -/// # } -/// ``` -pub struct LiveBroadcastTransitionCall<'a, C, A> - where C: 'a, A: 'a { - - hub: &'a YouTube, - _broadcast_status: String, - _id: String, - _part: String, - _on_behalf_of_content_owner_channel: Option, - _on_behalf_of_content_owner: Option, - _delegate: Option<&'a mut Delegate>, - _additional_params: HashMap, - _scopes: BTreeMap -} - -impl<'a, C, A> CallBuilder for LiveBroadcastTransitionCall<'a, C, A> {} - -impl<'a, C, A> LiveBroadcastTransitionCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { - - - /// Perform the operation you have build so far. - pub fn doit(mut self) -> Result<(hyper::client::Response, LiveBroadcast)> { - use std::io::{Read, Seek}; - use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; - let mut dd = DefaultDelegate; - let mut dlg: &mut Delegate = match self._delegate { - Some(d) => d, - None => &mut dd - }; - dlg.begin(MethodInfo { id: "youtube.liveBroadcasts.transition", - http_method: hyper::method::Method::Post }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((7 + self._additional_params.len())); - params.push(("broadcastStatus", self._broadcast_status.to_string())); - params.push(("id", self._id.to_string())); - params.push(("part", self._part.to_string())); - if let Some(value) = self._on_behalf_of_content_owner_channel { - params.push(("onBehalfOfContentOwnerChannel", value.to_string())); - } - if let Some(value) = self._on_behalf_of_content_owner { - params.push(("onBehalfOfContentOwner", value.to_string())); - } - for &field in ["alt", "broadcastStatus", "id", "part", "onBehalfOfContentOwnerChannel", "onBehalfOfContentOwner"].iter() { - if self._additional_params.contains_key(field) { - dlg.finished(false); - return Err(Error::FieldClash(field)); - } - } - for (name, value) in self._additional_params.iter() { - params.push((&name, value.clone())); - } - - params.push(("alt", "json".to_string())); - - let mut url = self.hub._base_url.clone() + "liveBroadcasts/transition"; - if self._scopes.len() == 0 { - self._scopes.insert(Scope::Full.as_ref().to_string(), ()); - } - - - if params.len() > 0 { - url.push('?'); - url.push_str(&url::form_urlencoded::serialize(params)); - } - - - - loop { - let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { - Ok(token) => token, - Err(err) => { - match dlg.token(&*err) { - Some(token) => token, - None => { - dlg.finished(false); - return Err(Error::MissingToken(err)) - } - } - } - }; - let auth_header = Authorization(Bearer { token: token.access_token }); - let mut req_result = { - let mut client = &mut *self.hub.client.borrow_mut(); - let mut req = client.borrow_mut().request(hyper::method::Method::Post, &url) - .header(UserAgent(self.hub._user_agent.clone())) - .header(auth_header.clone()); - - dlg.pre_request(); - req.send() - }; - - match req_result { - Err(err) => { - if let oauth2::Retry::After(d) = dlg.http_error(&err) { - sleep(d); - continue; - } - dlg.finished(false); - return Err(Error::HttpError(err)) - } - Ok(mut res) => { - if !res.status.is_success() { - let mut json_err = String::new(); - res.read_to_string(&mut json_err).unwrap(); - if let oauth2::Retry::After(d) = dlg.http_failure(&res, - json::from_str(&json_err).ok(), - json::from_str(&json_err).ok()) { - sleep(d); - continue; - } - dlg.finished(false); - return match json::from_str::(&json_err){ - Err(_) => Err(Error::Failure(res)), - Ok(serr) => Err(Error::BadRequest(serr)) - } - } - let result_value = { - let mut json_response = String::new(); - res.read_to_string(&mut json_response).unwrap(); - match json::from_str(&json_response) { - Ok(decoded) => (res, decoded), - Err(err) => { - dlg.response_json_decode_error(&json_response, &err); - return Err(Error::JsonDecodeError(json_response, err)); - } - } - }; - - dlg.finished(true); - return Ok(result_value) - } - } - } - } - - - /// The broadcastStatus parameter identifies the state to which the broadcast is changing. Note that to transition a broadcast to either the testing or live state, the status.streamStatus must be active for the stream that the broadcast is bound to. - /// - /// Sets the *broadcast status* 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 broadcast_status(mut self, new_value: &str) -> LiveBroadcastTransitionCall<'a, C, A> { - self._broadcast_status = new_value.to_string(); - self - } - /// The id parameter specifies the unique ID of the broadcast that is transitioning to another status. - /// - /// 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) -> LiveBroadcastTransitionCall<'a, C, A> { - self._id = new_value.to_string(); - self - } - /// The part parameter specifies a comma-separated list of one or more liveBroadcast resource properties that the API response will include. The part names that you can include in the parameter value are id, snippet, contentDetails, and status. - /// - /// Sets the *part* query property to the given value. - /// - /// Even though the property as already been set when instantiating this call, - /// we provide this method for API completeness. - /// - /// **Settable Parts** - /// - /// * *id* - /// * *snippet* - /// * *contentDetails* - /// * *status* - pub fn part(mut self, new_value: &str) -> LiveBroadcastTransitionCall<'a, C, A> { - self._part = new_value.to_string(); - self - } - /// This parameter can only be used in a properly authorized request. Note: This parameter is intended exclusively for YouTube content partners. - /// - /// The onBehalfOfContentOwnerChannel parameter specifies the YouTube channel ID of the channel to which a video is being added. This parameter is required when a request specifies a value for the onBehalfOfContentOwner parameter, and it can only be used in conjunction with that parameter. In addition, the request must be authorized using a CMS account that is linked to the content owner that the onBehalfOfContentOwner parameter specifies. Finally, the channel that the onBehalfOfContentOwnerChannel parameter value specifies must be linked to the content owner that the onBehalfOfContentOwner parameter specifies. - /// - /// This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and perform actions on behalf of the channel specified in the parameter value, without having to provide authentication credentials for each separate channel. - /// - /// Sets the *on behalf of content owner channel* query property to the given value. - pub fn on_behalf_of_content_owner_channel(mut self, new_value: &str) -> LiveBroadcastTransitionCall<'a, C, A> { - self._on_behalf_of_content_owner_channel = Some(new_value.to_string()); - self - } - /// Note: This parameter is intended exclusively for YouTube content partners. - /// - /// The onBehalfOfContentOwner parameter indicates that the request's authorization credentials identify a YouTube CMS user who is acting on behalf of the content owner specified in the parameter value. This parameter is intended for YouTube content partners that own and manage many different YouTube channels. It allows content owners to authenticate once and get access to all their video and channel data, without having to provide authentication credentials for each individual channel. The CMS account that the user authenticates with must be linked to the specified YouTube content owner. - /// - /// Sets the *on behalf of content owner* query property to the given value. - pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> LiveBroadcastTransitionCall<'a, C, A> { - self._on_behalf_of_content_owner = Some(new_value.to_string()); - self - } - /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong - /// while executing the actual API request. - /// - /// It should be used to handle progress information, and to implement a certain level of resilience. - /// - /// Sets the *delegate* property to the given value. - pub fn delegate(mut self, new_value: &'a mut Delegate) -> LiveBroadcastTransitionCall<'a, C, A> { - self._delegate = Some(new_value); - self - } - - /// Set any additional parameter of the query string used in the request. - /// It should be used to set parameters which are not yet available through their own - /// setters. - /// - /// Please note that this method must not be used to set any of the known paramters - /// which have their own setter method. If done anyway, the request will fail. - /// - /// # Additional Parameters - /// - /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. - /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. - /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. - /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. - /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. - /// * *alt* (query-string) - Data format for the response. - pub fn param(mut self, name: T, value: T) -> LiveBroadcastTransitionCall<'a, C, A> - where T: AsRef { - self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); - self - } - - /// Identifies the authorization scope for the method you are building. - /// - /// Use this method to actively specify which scope should be used, instead the default `Scope` variant - /// `Scope::Full`. - /// - /// The `scope` will be added to a set of scopes. This is important as one can maintain access - /// tokens for more than one scope. - /// - /// Usually there is more than one suitable scope to authorize an operation, some of which may - /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be - /// sufficient, a read-write scope will do as well. - pub fn add_scope(mut self, scope: T) -> LiveBroadcastTransitionCall<'a, C, A> - where T: AsRef { - self._scopes.insert(scope.as_ref().to_string(), ()); - self - } -} - - /// Uploads a channel banner image to YouTube. This method represents the first two steps in a three-step process to update the banner image for a channel: /// /// - Call the channelBanners.insert method to upload the binary image data to YouTube. The image must have a 16:9 aspect ratio and be at least 2120x1192 pixels. @@ -26896,9 +27098,9 @@ impl<'a, C, A> ChannelBannerInsertCall<'a, C, A> where C: BorrowMut SearchListCall<'a, C, A> where C: BorrowMut, A: oa params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "search"; + let mut url = "https://www.googleapis.com/youtube/v3/search".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); } @@ -27761,6 +27963,278 @@ impl<'a, C, A> SearchListCall<'a, C, A> where C: BorrowMut, A: oa } +/// Lists Super Chat events for a channel. +/// +/// A builder for the *list* method supported by a *superChatEvent* resource. +/// It is not used directly, but through a `SuperChatEventMethods` instance. +/// +/// **Settable Parts** +/// +/// * *id* +/// * *snippet* +/// +/// # Scopes +/// +/// You will need authorization for at least one of the following scopes to make a valid call, possibly depending on *parts*: +/// +/// * *https://www.googleapis.com/auth/youtube* +/// * *https://www.googleapis.com/auth/youtube.force-ssl* +/// * *https://www.googleapis.com/auth/youtube.readonly* +/// +/// The default scope will be `Scope::Readonly`. +/// +/// # Example +/// +/// Instantiate a resource method builder +/// +/// ```test_harness,no_run +/// # extern crate hyper; +/// # extern crate yup_oauth2 as oauth2; +/// # extern crate google_youtube3 as youtube3; +/// # #[test] fn egal() { +/// # use std::default::Default; +/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; +/// # use youtube3::YouTube; +/// +/// # let secret: ApplicationSecret = Default::default(); +/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, +/// # hyper::Client::new(), +/// # ::default(), None); +/// # let mut hub = YouTube::new(hyper::Client::new(), auth); +/// // You can configure optional parameters by calling the respective setters at will, and +/// // execute the final call using `doit()`. +/// // Values shown here are possibly random and not representative ! +/// let result = hub.super_chat_events().list("part") +/// .page_token("ut") +/// .max_results(23) +/// .hl("tempor") +/// .doit(); +/// # } +/// ``` +pub struct SuperChatEventListCall<'a, C, A> + where C: 'a, A: 'a { + + hub: &'a YouTube, + _part: String, + _page_token: Option, + _max_results: Option, + _hl: Option, + _delegate: Option<&'a mut Delegate>, + _additional_params: HashMap, + _scopes: BTreeMap +} + +impl<'a, C, A> CallBuilder for SuperChatEventListCall<'a, C, A> {} + +impl<'a, C, A> SuperChatEventListCall<'a, C, A> where C: BorrowMut, A: oauth2::GetToken { + + + /// Perform the operation you have build so far. + pub fn doit(mut self) -> Result<(hyper::client::Response, SuperChatEventListResponse)> { + use std::io::{Read, Seek}; + use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location}; + let mut dd = DefaultDelegate; + let mut dlg: &mut Delegate = match self._delegate { + Some(d) => d, + None => &mut dd + }; + dlg.begin(MethodInfo { id: "youtube.superChatEvents.list", + http_method: hyper::method::Method::Get }); + let mut params: Vec<(&str, String)> = Vec::with_capacity((6 + self._additional_params.len())); + params.push(("part", self._part.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._hl { + params.push(("hl", value.to_string())); + } + for &field in ["alt", "part", "pageToken", "maxResults", "hl"].iter() { + if self._additional_params.contains_key(field) { + dlg.finished(false); + return Err(Error::FieldClash(field)); + } + } + for (name, value) in self._additional_params.iter() { + params.push((&name, value.clone())); + } + + params.push(("alt", "json".to_string())); + + let mut url = "https://www.googleapis.com/youtube/v3/superChatEvents".to_string(); + if self._scopes.len() == 0 { + self._scopes.insert(Scope::Readonly.as_ref().to_string(), ()); + } + + + if params.len() > 0 { + url.push('?'); + url.push_str(&url::form_urlencoded::serialize(params)); + } + + + + loop { + let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) { + Ok(token) => token, + Err(err) => { + match dlg.token(&*err) { + Some(token) => token, + None => { + dlg.finished(false); + return Err(Error::MissingToken(err)) + } + } + } + }; + let auth_header = Authorization(Bearer { token: token.access_token }); + let mut req_result = { + let mut client = &mut *self.hub.client.borrow_mut(); + let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url) + .header(UserAgent(self.hub._user_agent.clone())) + .header(auth_header.clone()); + + dlg.pre_request(); + req.send() + }; + + match req_result { + Err(err) => { + if let oauth2::Retry::After(d) = dlg.http_error(&err) { + sleep(d); + continue; + } + dlg.finished(false); + return Err(Error::HttpError(err)) + } + Ok(mut res) => { + if !res.status.is_success() { + let mut json_err = String::new(); + res.read_to_string(&mut json_err).unwrap(); + if let oauth2::Retry::After(d) = dlg.http_failure(&res, + json::from_str(&json_err).ok(), + json::from_str(&json_err).ok()) { + sleep(d); + continue; + } + dlg.finished(false); + return match json::from_str::(&json_err){ + Err(_) => Err(Error::Failure(res)), + Ok(serr) => Err(Error::BadRequest(serr)) + } + } + let result_value = { + let mut json_response = String::new(); + res.read_to_string(&mut json_response).unwrap(); + match json::from_str(&json_response) { + Ok(decoded) => (res, decoded), + 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 part parameter specifies the superChatEvent resource parts that the API response will include. Supported values are id and snippet. + /// + /// Sets the *part* query property to the given value. + /// + /// Even though the property as already been set when instantiating this call, + /// we provide this method for API completeness. + /// + /// **Settable Parts** + /// + /// * *id* + /// * *snippet* + pub fn part(mut self, new_value: &str) -> SuperChatEventListCall<'a, C, A> { + self._part = new_value.to_string(); + self + } + /// The pageToken parameter identifies a specific page in the result set that should be returned. In an API response, the nextPageToken and prevPageToken properties identify other pages that could be retrieved. + /// + /// Sets the *page token* query property to the given value. + pub fn page_token(mut self, new_value: &str) -> SuperChatEventListCall<'a, C, A> { + self._page_token = Some(new_value.to_string()); + self + } + /// The maxResults parameter specifies the maximum number of items that should be returned in the result set. + /// + /// Sets the *max results* query property to the given value. + pub fn max_results(mut self, new_value: u32) -> SuperChatEventListCall<'a, C, A> { + self._max_results = Some(new_value); + self + } + /// The hl parameter instructs the API to retrieve localized resource metadata for a specific application language that the YouTube website supports. The parameter value must be a language code included in the list returned by the i18nLanguages.list method. + /// + /// If localized resource details are available in that language, the resource's snippet.localized object will contain the localized values. However, if localized details are not available, the snippet.localized object will contain resource details in the resource's default language. + /// + /// Sets the *hl* query property to the given value. + pub fn hl(mut self, new_value: &str) -> SuperChatEventListCall<'a, C, A> { + self._hl = 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) -> SuperChatEventListCall<'a, C, A> { + self._delegate = Some(new_value); + self + } + + /// Set any additional parameter of the query string used in the request. + /// It should be used to set parameters which are not yet available through their own + /// setters. + /// + /// Please note that this method must not be used to set any of the known paramters + /// which have their own setter method. If done anyway, the request will fail. + /// + /// # Additional Parameters + /// + /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided. + /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user. + /// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. + /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. + /// * *userIp* (query-string) - IP address of the site where the request originates. Use this if you want to enforce per-user limits. + /// * *fields* (query-string) - Selector specifying which fields to include in a partial response. + /// * *alt* (query-string) - Data format for the response. + pub fn param(mut self, name: T, value: T) -> SuperChatEventListCall<'a, C, A> + where T: AsRef { + self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string()); + self + } + + /// Identifies the authorization scope for the method you are building. + /// + /// Use this method to actively specify which scope should be used, instead the default `Scope` variant + /// `Scope::Readonly`. + /// + /// The `scope` will be added to a set of scopes. This is important as one can maintain access + /// tokens for more than one scope. + /// + /// Usually there is more than one suitable scope to authorize an operation, some of which may + /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be + /// sufficient, a read-write scope will do as well. + pub fn add_scope(mut self, scope: T) -> SuperChatEventListCall<'a, C, A> + where T: AsRef { + self._scopes.insert(scope.as_ref().to_string(), ()); + self + } +} + + /// Uploads a custom video thumbnail to YouTube and sets it for a video. /// /// A builder for the *set* method supported by a *thumbnail* resource. @@ -27789,7 +28263,7 @@ impl<'a, C, A> SearchListCall<'a, C, A> where C: BorrowMut, A: oa /// // execute the final call using `upload(...)`. /// // Values shown here are possibly random and not representative ! /// let result = hub.thumbnails().set("videoId") -/// .on_behalf_of_content_owner("ut") +/// .on_behalf_of_content_owner("erat") /// .upload(fs::File::open("file.ext").unwrap(), "application/octet-stream".parse().unwrap()); /// # } /// ``` @@ -27840,9 +28314,9 @@ impl<'a, C, A> ThumbnailSetCall<'a, C, A> where C: BorrowMut, A: let (mut url, upload_type) = if protocol == "simple" { - (self.hub._root_url.clone() + "/upload/youtube/v3/thumbnails/set", "multipart") + ("https://www.googleapis.com/upload/youtube/v3/thumbnails/set".to_string(), "multipart") } else if protocol == "resumable" { - (self.hub._root_url.clone() + "/resumable/upload/youtube/v3/thumbnails/set", "resumable") + ("https://www.googleapis.com/resumable/upload/youtube/v3/thumbnails/set".to_string(), "resumable") } else { unreachable!() }; @@ -28140,9 +28614,9 @@ impl<'a, C, A> ThumbnailSetCall<'a, C, A> where C: BorrowMut, A: /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.fan_funding_events().list("part") -/// .page_token("tempor") -/// .max_results(16) -/// .hl("erat") +/// .page_token("kasd") +/// .max_results(34) +/// .hl("clita") /// .doit(); /// # } /// ``` @@ -28198,7 +28672,7 @@ impl<'a, C, A> FanFundingEventListCall<'a, C, A> where C: BorrowMut FanFundingEventListCall<'a, C, A> where C: BorrowMut"] description = "A complete library to interact with YouTube Analytics (protocol v1)" repository = "https://github.com/Byron/google-apis-rs/tree/master/gen/youtubeanalytics1-cli" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-youtubeanalytics1] path = "../youtubeanalytics1" -version = "1.0.4+20161213" +version = "1.0.4+20170517" diff --git a/gen/youtubeanalytics1-cli/README.md b/gen/youtubeanalytics1-cli/README.md index 8acb82852e..8d185a8105 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 *20161213*. The CLI is at version *1.0.4*. +This documentation was generated from the *YouTube Analytics* API at revision *20170517*. The CLI is at version *1.0.4*. ```bash youtubeanalytics1 [options] diff --git a/gen/youtubeanalytics1-cli/mkdocs.yml b/gen/youtubeanalytics1-cli/mkdocs.yml index fad7682b97..c2b6cf9741 100644 --- a/gen/youtubeanalytics1-cli/mkdocs.yml +++ b/gen/youtubeanalytics1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube Analytics v1.0.4+20161213 +site_name: YouTube Analytics v1.0.4+20170517 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 c4af1f3615..c9f436c733 100644 --- a/gen/youtubeanalytics1-cli/src/main.rs +++ b/gen/youtubeanalytics1-cli/src/main.rs @@ -562,6 +562,9 @@ impl<'n> Engine<'n> { "max-results" => { call = call.max_results(arg_from_str(value.unwrap_or("-0"), err, "max-results", "integer")); }, + "include-historical-channel-data" => { + call = call.include_historical_channel_data(arg_from_str(value.unwrap_or("false"), err, "include-historical-channel-data", "boolean")); + }, "filters" => { call = call.filters(value.unwrap_or("")); }, @@ -584,7 +587,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(["sort", "max-results", "dimensions", "start-index", "currency", "filters"].iter().map(|v|*v)); + v.extend(["sort", "max-results", "dimensions", "start-index", "include-historical-channel-data", "currency", "filters"].iter().map(|v|*v)); v } )); } } @@ -944,7 +947,7 @@ fn main() { let mut app = App::new("youtubeanalytics1") .author("Sebastian Thiel ") - .version("1.0.4+20161213") + .version("1.0.4+20170517") .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 ceb5dcb532..22d8b952eb 100644 --- a/gen/youtubeanalytics1/Cargo.toml +++ b/gen/youtubeanalytics1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtubeanalytics1" -version = "1.0.4+20161213" +version = "1.0.4+20170517" 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.4+20161213" +documentation = "https://docs.rs/google-youtubeanalytics1/1.0.4+20170517" license = "MIT" keywords = ["youtubeAnalytics", "google", "protocol", "web", "api"] diff --git a/gen/youtubeanalytics1/README.md b/gen/youtubeanalytics1/README.md index f528e43064..dc5c4440c7 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.4+20161213*, where *20161213* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *YouTube Analytics* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20161213/google_youtubeanalytics1/struct.YouTubeAnalytics.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/struct.YouTubeAnalytics.html) ... -* [group items](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/struct.GroupItem.html) - * [*delete*](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/struct.GroupItemDeleteCall.html), [*insert*](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/struct.GroupItemInsertCall.html) and [*list*](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/struct.GroupItemListCall.html) -* [groups](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/struct.Group.html) - * [*delete*](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/struct.GroupDeleteCall.html), [*insert*](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/struct.GroupListCall.html) and [*update*](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/struct.GroupUpdateCall.html) +* [group items](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/struct.GroupItem.html) + * [*delete*](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/struct.GroupItemDeleteCall.html), [*insert*](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/struct.GroupItemInsertCall.html) and [*list*](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/struct.GroupItemListCall.html) +* [groups](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/struct.Group.html) + * [*delete*](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/struct.GroupDeleteCall.html), [*insert*](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/struct.GroupInsertCall.html), [*list*](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/struct.GroupListCall.html) and [*update*](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/struct.GroupUpdateCall.html) * reports - * [*query*](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/struct.ReportQueryCall.html) + * [*query*](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/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.4+20161213/google_youtubeanalytics1/struct.YouTubeAnalytics.html)** +* **[Hub](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/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.4+20161213/google_youtubeanalytics1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/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.4+20161213/google_youtubeanalytics1/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/google_youtubeanalytics1/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-youtubeanalytics1/1.0.4+20161213/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.4+20170517/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.4+20161213/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.4+20170517/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.4+20161213/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.4+20170517/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.4+20161213/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.4+20170517/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")`. @@ -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-youtubeanalytics1/1.0.4+20161213/google_youtubeanalytics1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/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.4+20170517/google_youtubeanalytics1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/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.4+20161213/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.4+20170517/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.4+20161213/google_youtubeanalytics1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-youtubeanalytics1/1.0.4+20161213/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.4+20170517/google_youtubeanalytics1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/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.4+20161213/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.4+20170517/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.4+20161213/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.4+20170517/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.4+20161213/google_youtubeanalytics1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtubeanalytics1/1.0.4+20170517/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 9bf59e77f4..49b27bf1b3 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.4+20161213*, where *20161213* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *YouTube Analytics* crate version *1.0.4+20170517*, where *20170517* is the exact revision of the *youtubeAnalytics:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *YouTube Analytics* *v1* API can be found at the //! [official documentation site](http://developers.google.com/youtube/analytics/). @@ -181,7 +181,7 @@ // 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 +// 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)] @@ -326,8 +326,6 @@ pub struct YouTubeAnalytics { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for YouTubeAnalytics {} @@ -340,8 +338,6 @@ impl<'a, C, A> YouTubeAnalytics client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://www.googleapis.com/youtube/analytics/v1/".to_string(), - _root_url: "https://www.googleapis.com/".to_string(), } } @@ -364,26 +360,6 @@ impl<'a, C, A> YouTubeAnalytics self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://www.googleapis.com/youtube/analytics/v1/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// 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 { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -659,6 +635,7 @@ impl<'a, C, A> ReportMethods<'a, C, A> { _start_index: Default::default(), _sort: Default::default(), _max_results: Default::default(), + _include_historical_channel_data: Default::default(), _filters: Default::default(), _dimensions: Default::default(), _currency: Default::default(), @@ -913,8 +890,9 @@ impl<'a, C, A> GroupMethods<'a, C, A> { /// .start_index(-61) /// .sort("sadipscing") /// .max_results(-31) -/// .filters("ea") -/// .dimensions("no") +/// .include_historical_channel_data(false) +/// .filters("no") +/// .dimensions("justo") /// .currency("justo") /// .doit(); /// # } @@ -930,6 +908,7 @@ pub struct ReportQueryCall<'a, C, A> _start_index: Option, _sort: Option, _max_results: Option, + _include_historical_channel_data: Option, _filters: Option, _dimensions: Option, _currency: Option, @@ -954,7 +933,7 @@ impl<'a, C, A> ReportQueryCall<'a, C, A> where C: BorrowMut, A: o }; dlg.begin(MethodInfo { id: "youtubeAnalytics.reports.query", http_method: hyper::method::Method::Get }); - let mut params: Vec<(&str, String)> = Vec::with_capacity((12 + self._additional_params.len())); + let mut params: Vec<(&str, String)> = Vec::with_capacity((13 + self._additional_params.len())); params.push(("ids", self._ids.to_string())); params.push(("start-date", self._start_date.to_string())); params.push(("end-date", self._end_date.to_string())); @@ -968,6 +947,9 @@ impl<'a, C, A> ReportQueryCall<'a, C, A> where C: BorrowMut, A: o if let Some(value) = self._max_results { params.push(("max-results", value.to_string())); } + if let Some(value) = self._include_historical_channel_data { + params.push(("include-historical-channel-data", value.to_string())); + } if let Some(value) = self._filters { params.push(("filters", value.to_string())); } @@ -977,7 +959,7 @@ impl<'a, C, A> ReportQueryCall<'a, C, A> where C: BorrowMut, A: o if let Some(value) = self._currency { params.push(("currency", value.to_string())); } - for &field in ["alt", "ids", "start-date", "end-date", "metrics", "start-index", "sort", "max-results", "filters", "dimensions", "currency"].iter() { + for &field in ["alt", "ids", "start-date", "end-date", "metrics", "start-index", "sort", "max-results", "include-historical-channel-data", "filters", "dimensions", "currency"].iter() { if self._additional_params.contains_key(field) { dlg.finished(false); return Err(Error::FieldClash(field)); @@ -989,7 +971,7 @@ impl<'a, C, A> ReportQueryCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "reports"; + let mut url = "https://www.googleapis.com/youtube/analytics/v1/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YoutubeReadonly.as_ref().to_string(), ()); } @@ -1134,6 +1116,13 @@ impl<'a, C, A> ReportQueryCall<'a, C, A> where C: BorrowMut, A: o self._max_results = Some(new_value); self } + /// If set to true historical data (i.e. channel data from before the linking of the channel to the content owner) will be retrieved. + /// + /// Sets the *include-historical-channel-data* query property to the given value. + pub fn include_historical_channel_data(mut self, new_value: bool) -> ReportQueryCall<'a, C, A> { + self._include_historical_channel_data = Some(new_value); + self + } /// A list of filters that should be applied when retrieving YouTube Analytics data. The Available Reports document identifies the dimensions that can be used to filter each report, and the Dimensions document defines those dimensions. If a request uses multiple filters, join them together with a semicolon (;), and the returned result table will satisfy both filters. For example, a filters parameter value of video==dMH0bHeiRNg;country==IT restricts the result set to include data for the given video in Italy. /// /// Sets the *filters* query property to the given value. @@ -1240,7 +1229,7 @@ impl<'a, C, A> ReportQueryCall<'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.group_items().insert(req) -/// .on_behalf_of_content_owner("justo") +/// .on_behalf_of_content_owner("et") /// .doit(); /// # } /// ``` @@ -1287,7 +1276,7 @@ impl<'a, C, A> GroupItemInsertCall<'a, C, A> where C: BorrowMut, params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groupItems"; + let mut url = "https://www.googleapis.com/youtube/analytics/v1/groupItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Youtube.as_ref().to_string(), ()); } @@ -1481,7 +1470,7 @@ impl<'a, C, A> GroupItemInsertCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.group_items().list("groupId") -/// .on_behalf_of_content_owner("et") +/// .on_behalf_of_content_owner("diam") /// .doit(); /// # } /// ``` @@ -1529,7 +1518,7 @@ impl<'a, C, A> GroupItemListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groupItems"; + let mut url = "https://www.googleapis.com/youtube/analytics/v1/groupItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YoutubeReadonly.as_ref().to_string(), ()); } @@ -1709,7 +1698,7 @@ impl<'a, C, A> GroupItemListCall<'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.group_items().delete("id") -/// .on_behalf_of_content_owner("ipsum") +/// .on_behalf_of_content_owner("Lorem") /// .doit(); /// # } /// ``` @@ -1756,7 +1745,7 @@ impl<'a, C, A> GroupItemDeleteCall<'a, C, A> where C: BorrowMut, } - let mut url = self.hub._base_url.clone() + "groupItems"; + let mut url = "https://www.googleapis.com/youtube/analytics/v1/groupItems".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Youtube.as_ref().to_string(), ()); } @@ -1926,7 +1915,7 @@ impl<'a, C, A> GroupItemDeleteCall<'a, C, A> where C: BorrowMut, /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.groups().delete("id") -/// .on_behalf_of_content_owner("et") +/// .on_behalf_of_content_owner("duo") /// .doit(); /// # } /// ``` @@ -1973,7 +1962,7 @@ impl<'a, C, A> GroupDeleteCall<'a, C, A> where C: BorrowMut, A: o } - let mut url = self.hub._base_url.clone() + "groups"; + let mut url = "https://www.googleapis.com/youtube/analytics/v1/groups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Youtube.as_ref().to_string(), ()); } @@ -2149,7 +2138,7 @@ impl<'a, C, A> GroupDeleteCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.groups().insert(req) -/// .on_behalf_of_content_owner("duo") +/// .on_behalf_of_content_owner("aliquyam") /// .doit(); /// # } /// ``` @@ -2196,7 +2185,7 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups"; + let mut url = "https://www.googleapis.com/youtube/analytics/v1/groups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Youtube.as_ref().to_string(), ()); } @@ -2390,10 +2379,10 @@ impl<'a, C, A> GroupInsertCall<'a, C, A> where C: BorrowMut, A: o /// // execute the final call using `doit()`. /// // Values shown here are possibly random and not representative ! /// let result = hub.groups().list() -/// .page_token("aliquyam") -/// .on_behalf_of_content_owner("sea") +/// .page_token("sea") +/// .on_behalf_of_content_owner("Lorem") /// .mine(false) -/// .id("eos") +/// .id("erat") /// .doit(); /// # } /// ``` @@ -2451,7 +2440,7 @@ 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 = "https://www.googleapis.com/youtube/analytics/v1/groups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YoutubeReadonly.as_ref().to_string(), ()); } @@ -2648,7 +2637,7 @@ impl<'a, C, A> GroupListCall<'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.groups().update(req) -/// .on_behalf_of_content_owner("erat") +/// .on_behalf_of_content_owner("sadipscing") /// .doit(); /// # } /// ``` @@ -2695,7 +2684,7 @@ impl<'a, C, A> GroupUpdateCall<'a, C, A> where C: BorrowMut, A: o params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "groups"; + let mut url = "https://www.googleapis.com/youtube/analytics/v1/groups".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::Youtube.as_ref().to_string(), ()); } @@ -2862,3 +2851,4 @@ impl<'a, C, A> GroupUpdateCall<'a, C, A> where C: BorrowMut, A: o } + diff --git a/gen/youtubereporting1-cli/Cargo.toml b/gen/youtubereporting1-cli/Cargo.toml index d4b626f3e2..e74949f081 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.4+20160719" +version = "1.0.4+20170520" 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" @@ -24,7 +24,7 @@ serde_json = "^ 0.9" serde_derive = "^ 0.9" yup-oauth2 = "^ 1.0" strsim = "^0.5" -hyper-rustls = "^0.3" +hyper-rustls = "^0.6" yup-hyper-mock = "^2.0" clap = "^2.0" @@ -34,4 +34,4 @@ clap = "^2.0" [dependencies.google-youtubereporting1] path = "../youtubereporting1" -version = "1.0.4+20160719" +version = "1.0.4+20170520" diff --git a/gen/youtubereporting1-cli/README.md b/gen/youtubereporting1-cli/README.md index b323860c9e..4758f14164 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 *20160719*. The CLI is at version *1.0.4*. +This documentation was generated from the *YouTube Reporting* API at revision *20170520*. The CLI is at version *1.0.4*. ```bash youtubereporting1 [options] diff --git a/gen/youtubereporting1-cli/mkdocs.yml b/gen/youtubereporting1-cli/mkdocs.yml index c3f2c9ec78..3cc367e767 100644 --- a/gen/youtubereporting1-cli/mkdocs.yml +++ b/gen/youtubereporting1-cli/mkdocs.yml @@ -1,4 +1,4 @@ -site_name: YouTube Reporting v1.0.4+20160719 +site_name: YouTube Reporting v1.0.4+20170520 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 515a7d66ae..0bd34baf93 100644 --- a/gen/youtubereporting1-cli/src/main.rs +++ b/gen/youtubereporting1-cli/src/main.rs @@ -821,7 +821,8 @@ fn main() { Some(false)), ]), ("reports-list", - Some(r##"Lists reports created by a specific job. Returns NOT_FOUND if the job does not exist."##), + Some(r##"Lists reports created by a specific job. + Returns NOT_FOUND if the job does not exist."##), "Details at http://byron.github.io/google-apis-rs/google_youtubereporting1_cli/jobs_reports-list", vec![ (Some(r##"job-id"##), @@ -846,12 +847,14 @@ fn main() { ("media", "methods: 'download'", vec![ ("download", - Some(r##"Method for media download. Download is supported on the URI `/v1/media/{+name}?alt=media`."##), + Some(r##"Method for media download. Download is supported + on the URI `/v1/media/{+name}?alt=media`."##), "Details at http://byron.github.io/google-apis-rs/google_youtubereporting1_cli/media_download", vec![ (Some(r##"resource-name"##), None, - Some(r##"Name of the media that is being downloaded. See ReadRequest.resource_name."##), + Some(r##"Name of the media that is being downloaded. See + ReadRequest.resource_name."##), Some(true), Some(false)), @@ -892,7 +895,7 @@ fn main() { let mut app = App::new("youtubereporting1") .author("Sebastian Thiel ") - .version("1.0.4+20160719") + .version("1.0.4+20170520") .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 50d70ae7ba..51599884fc 100644 --- a/gen/youtubereporting1/Cargo.toml +++ b/gen/youtubereporting1/Cargo.toml @@ -4,12 +4,12 @@ [package] name = "google-youtubereporting1" -version = "1.0.4+20160719" +version = "1.0.4+20170520" 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.4+20160719" +documentation = "https://docs.rs/google-youtubereporting1/1.0.4+20170520" license = "MIT" keywords = ["youtubereporting", "google", "protocol", "web", "api"] diff --git a/gen/youtubereporting1/README.md b/gen/youtubereporting1/README.md index 79dda0438a..bf388d2c53 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.4+20160719*, where *20160719* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +This documentation was generated from *YouTube Reporting* crate version *1.0.4+20170520*, where *20170520* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. 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.4+20160719/google_youtubereporting1/struct.YouTubeReporting.html) ... +Handle the following *Resources* with ease from the central [hub](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.YouTubeReporting.html) ... -* [jobs](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.Job.html) - * [*create*](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.JobCreateCall.html), [*delete*](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.JobDeleteCall.html), [*get*](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.JobGetCall.html), [*list*](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.JobListCall.html), [*reports get*](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.JobReportGetCall.html) and [*reports list*](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.JobReportListCall.html) -* [media](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.Media.html) - * [*download*](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.MediaDownloadCall.html) -* [report types](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.ReportType.html) - * [*list*](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.ReportTypeListCall.html) +* [jobs](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.Job.html) + * [*create*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.JobCreateCall.html), [*delete*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.JobDeleteCall.html), [*get*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.JobGetCall.html), [*list*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.JobListCall.html), [*reports get*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.JobReportGetCall.html) and [*reports list*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.JobReportListCall.html) +* [media](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.Media.html) + * [*download*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.MediaDownloadCall.html) +* [report types](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.ReportType.html) + * [*list*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/struct.ReportTypeListCall.html) Download supported by ... -* [*download media*](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/struct.MediaDownloadCall.html) +* [*download media*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/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.4+20160719/google_youtubereporting1/struct.YouTubeReporting.html)** +* **[Hub](https://docs.rs/google-youtubereporting1/1.0.4+20170520/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.4+20160719/google_youtubereporting1/trait.MethodsBuilder.html) which in turn - allow access to individual [*Call Builders*](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/trait.CallBuilder.html) -* **[Resources](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/trait.Resource.html)** + * creates [*Method Builders*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/trait.MethodsBuilder.html) which in turn + allow access to individual [*Call Builders*](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/trait.CallBuilder.html) +* **[Resources](https://docs.rs/google-youtubereporting1/1.0.4+20170520/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.4+20160719/google_youtubereporting1/trait.Part.html)** + * **[Parts](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/trait.Part.html)** * a collection of properties * never directly used in *Activities* -* **[Activities](https://docs.rs/google-youtubereporting1/1.0.4+20160719/google_youtubereporting1/trait.CallBuilder.html)** +* **[Activities](https://docs.rs/google-youtubereporting1/1.0.4+20170520/google_youtubereporting1/trait.CallBuilder.html)** * operations to apply to *Resources* All *structures* are marked with applicable traits to further categorize them and ease browsing. @@ -134,17 +134,17 @@ match result { ``` ## Handling Errors -All errors produced by the system are provided either as [Result](https://docs.rs/google-youtubereporting1/1.0.4+20160719/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.4+20170520/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.4+20160719/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.4+20170520/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.4+20160719/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.4+20170520/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.4+20160719/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.4+20170520/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")`. @@ -154,29 +154,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.4+20160719/google_youtubereporting1/trait.Delegate.html) to the -[Method Builder](https://docs.rs/google-youtubereporting1/1.0.4+20160719/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.4+20170520/google_youtubereporting1/trait.Delegate.html) to the +[Method Builder](https://docs.rs/google-youtubereporting1/1.0.4+20170520/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.4+20160719/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.4+20170520/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.4+20160719/google_youtubereporting1/trait.RequestValue.html) and -[decodable](https://docs.rs/google-youtubereporting1/1.0.4+20160719/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.4+20170520/google_youtubereporting1/trait.RequestValue.html) and +[decodable](https://docs.rs/google-youtubereporting1/1.0.4+20170520/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.4+20160719/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.4+20170520/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.4+20160719/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.4+20170520/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.4+20160719/google_youtubereporting1/trait.RequestValue.html) are moved +* [request values](https://docs.rs/google-youtubereporting1/1.0.4+20170520/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 e379c1e5d0..3ebc39429c 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.4+20160719*, where *20160719* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. +//! This documentation was generated from *YouTube Reporting* crate version *1.0.4+20170520*, where *20170520* is the exact revision of the *youtubereporting:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*. //! //! Everything else about the *YouTube Reporting* *v1* API can be found at the //! [official documentation site](https://developers.google.com/youtube/reporting/v1/reports/). @@ -189,7 +189,7 @@ // 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 +// 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)] @@ -324,8 +324,6 @@ pub struct YouTubeReporting { client: RefCell, auth: RefCell, _user_agent: String, - _base_url: String, - _root_url: String, } impl<'a, C, A> Hub for YouTubeReporting {} @@ -338,8 +336,6 @@ impl<'a, C, A> YouTubeReporting client: RefCell::new(client), auth: RefCell::new(authenticator), _user_agent: "google-api-rust-client/1.0.4".to_string(), - _base_url: "https://youtubereporting.googleapis.com/".to_string(), - _root_url: "https://youtubereporting.googleapis.com/".to_string(), } } @@ -362,26 +358,6 @@ impl<'a, C, A> YouTubeReporting self._user_agent = agent_name; prev } - - /// Set the base url to use in all requests to the server. - /// It defaults to `https://youtubereporting.googleapis.com/`. - /// - /// Returns the previously set base url. - pub fn base_url(&mut self, new_base_url: String) -> String { - let prev = self._base_url.clone(); - self._base_url = new_base_url; - prev - } - - /// Set the root url to use in all requests to the server. - /// It defaults to `https://youtubereporting.googleapis.com/`. - /// - /// Returns the previously set root url. - pub fn root_url(&mut self, new_root_url: String) -> String { - let prev = self._root_url.clone(); - self._root_url = new_root_url; - prev - } } @@ -399,7 +375,11 @@ impl<'a, C, A> YouTubeReporting /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListReportTypesResponse { - /// A token to retrieve next page of results. Pass this value in the ListReportTypesRequest.page_token field in the subsequent call to `ListReportTypes` method to retrieve the next page of results. + /// A token to retrieve next page of results. + /// Pass this value in the + /// ListReportTypesRequest.page_token + /// field in the subsequent call to `ListReportTypes` method to retrieve the next + /// page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The list of report types. @@ -440,7 +420,11 @@ impl ResponseResult for Media {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListJobsResponse { - /// A token to retrieve next page of results. Pass this value in the ListJobsRequest.page_token field in the subsequent call to `ListJobs` method to retrieve the next page of results. + /// A token to retrieve next page of results. + /// Pass this value in the + /// ListJobsRequest.page_token + /// field in the subsequent call to `ListJobs` method to retrieve the next + /// page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The list of jobs. @@ -466,15 +450,18 @@ impl ResponseResult for ListJobsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct Job { - /// The date/time when this job will expire/expired. After a job expired, no new reports are generated. + /// The date/time when this job will expire/expired. After a job expired, no + /// new reports are generated. #[serde(rename="expireTime")] pub expire_time: Option, - /// The type of reports this job creates. Corresponds to the ID of a ReportType. + /// The type of reports this job creates. Corresponds to the ID of a + /// ReportType. #[serde(rename="reportTypeId")] pub report_type_id: Option, /// The name of the job (max. 100 characters). pub name: Option, - /// True if this a system-managed job that cannot be modified by the user; otherwise false. + /// True if this a system-managed job that cannot be modified by the user; + /// otherwise false. #[serde(rename="systemManaged")] pub system_managed: Option, /// The creation date/time of the job. @@ -500,7 +487,11 @@ impl ResponseResult for Job {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ListReportsResponse { - /// A token to retrieve next page of results. Pass this value in the ListReportsRequest.page_token field in the subsequent call to `ListReports` method to retrieve the next page of results. + /// A token to retrieve next page of results. + /// Pass this value in the + /// ListReportsRequest.page_token + /// field in the subsequent call to `ListReports` method to retrieve the next + /// page of results. #[serde(rename="nextPageToken")] pub next_page_token: Option, /// The list of report types. @@ -521,7 +512,9 @@ impl ResponseResult for ListReportsResponse {} /// #[derive(Default, Clone, Debug, Serialize, Deserialize)] pub struct ReportType { - /// True if this a system-managed report type; otherwise false. Reporting jobs for system-managed report types are created automatically and can thus not be used in the `CreateJob` method. + /// True if this a system-managed report type; otherwise false. Reporting jobs + /// for system-managed report types are created automatically and can thus not + /// be used in the `CreateJob` method. #[serde(rename="systemManaged")] pub system_managed: Option, /// The ID of the report type (max. 100 characters). @@ -536,7 +529,8 @@ pub struct ReportType { impl Resource for ReportType {} -/// A report's metadata including the URL from which the report itself can be downloaded. +/// A report's metadata including the URL from which the report itself can be +/// downloaded. /// /// # Activities /// @@ -553,12 +547,14 @@ pub struct Report { /// The date/time when the job this report belongs to will expire/expired. #[serde(rename="jobExpireTime")] pub job_expire_time: Option, - /// The start of the time period that the report instance covers. The value is inclusive. + /// The start of the time period that the report instance covers. The value is + /// inclusive. #[serde(rename="startTime")] pub start_time: Option, /// The server-generated ID of the report. pub id: Option, - /// The end of the time period that the report instance covers. The value is exclusive. + /// The end of the time period that the report instance covers. The value is + /// exclusive. #[serde(rename="endTime")] pub end_time: Option, /// The date/time when this report was created. @@ -572,7 +568,15 @@ pub struct Report { impl ResponseResult for Report {} -/// 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 `{}`. +/// 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 /// @@ -632,11 +636,13 @@ impl<'a, C, A> MediaMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Method for media download. Download is supported on the URI `/v1/media/{+name}?alt=media`. + /// Method for media download. Download is supported + /// on the URI `/v1/media/{+name}?alt=media`. /// /// # Arguments /// - /// * `resourceName` - Name of the media that is being downloaded. See ReadRequest.resource_name. + /// * `resourceName` - Name of the media that is being downloaded. See + /// ReadRequest.resource_name. pub fn download(&self, resource_name: &str) -> MediaDownloadCall<'a, C, A> { MediaDownloadCall { hub: self.hub, @@ -803,7 +809,8 @@ impl<'a, C, A> JobMethods<'a, C, A> { /// Create a builder to help you perform the following task: /// - /// Lists reports created by a specific job. Returns NOT_FOUND if the job does not exist. + /// Lists reports created by a specific job. + /// Returns NOT_FOUND if the job does not exist. /// /// # Arguments /// @@ -867,7 +874,8 @@ impl<'a, C, A> JobMethods<'a, C, A> { // CallBuilders ### // ################# -/// Method for media download. Download is supported on the URI `/v1/media/{+name}?alt=media`. +/// Method for media download. Download is supported +/// on the URI `/v1/media/{+name}?alt=media`. /// /// This method supports **media download**. To enable it, adjust the builder like this: /// `.param("alt", "media")`. @@ -959,7 +967,7 @@ impl<'a, C, A> MediaDownloadCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); } - let mut url = self.hub._base_url.clone() + "v1/media/{+resourceName}"; + let mut url = "https://youtubereporting.googleapis.com/v1/media/{+resourceName}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -1065,7 +1073,8 @@ impl<'a, C, A> MediaDownloadCall<'a, C, A> where C: BorrowMut, A: } - /// Name of the media that is being downloaded. See ReadRequest.resource_name. + /// Name of the media that is being downloaded. See + /// ReadRequest.resource_name. /// /// Sets the *resource name* path property to the given value. /// @@ -1100,12 +1109,12 @@ impl<'a, C, A> MediaDownloadCall<'a, C, A> where C: BorrowMut, A: /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (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> @@ -1221,7 +1230,7 @@ impl<'a, C, A> ReportTypeListCall<'a, C, A> where C: BorrowMut, A params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/reportTypes"; + let mut url = "https://youtubereporting.googleapis.com/v1/reportTypes".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -1303,28 +1312,35 @@ impl<'a, C, A> ReportTypeListCall<'a, C, A> where C: BorrowMut, A } - /// A token identifying a page of results the server should return. Typically, this is the value of ListReportTypesResponse.next_page_token returned in response to the previous call to the `ListReportTypes` method. + /// A token identifying a page of results the server should return. Typically, + /// this is the value of + /// ListReportTypesResponse.next_page_token + /// returned in response to the previous call to the `ListReportTypes` method. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> ReportTypeListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Requested page size. Server may return fewer report types than requested. If unspecified, server will pick an appropriate default. + /// Requested page size. Server may return fewer report types than requested. + /// If unspecified, server will pick an appropriate default. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> ReportTypeListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + /// The content owner's external ID on which behalf the user is acting on. If + /// not set, the user is acting for himself (his own channel). /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> ReportTypeListCall<'a, C, A> { self._on_behalf_of_content_owner = Some(new_value.to_string()); self } - /// If set to true, also system-managed report types will be returned; otherwise only the report types that can be used to create new reporting jobs will be returned. + /// If set to true, also system-managed report types will be returned; + /// otherwise only the report types that can be used to create new reporting + /// jobs will be returned. /// /// Sets the *include system managed* query property to the given value. pub fn include_system_managed(mut self, new_value: bool) -> ReportTypeListCall<'a, C, A> { @@ -1356,12 +1372,12 @@ impl<'a, C, A> ReportTypeListCall<'a, C, A> where C: BorrowMut, A /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (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> @@ -1464,7 +1480,7 @@ impl<'a, C, A> JobDeleteCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/jobs/{jobId}"; + let mut url = "https://youtubereporting.googleapis.com/v1/jobs/{jobId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -1577,7 +1593,8 @@ impl<'a, C, A> JobDeleteCall<'a, C, A> where C: BorrowMut, A: oau self._job_id = new_value.to_string(); self } - /// The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + /// The content owner's external ID on which behalf the user is acting on. If + /// not set, the user is acting for himself (his own channel). /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> JobDeleteCall<'a, C, A> { @@ -1609,12 +1626,12 @@ impl<'a, C, A> JobDeleteCall<'a, C, A> where C: BorrowMut, A: oau /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (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> @@ -1719,7 +1736,7 @@ impl<'a, C, A> JobReportGetCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/jobs/{jobId}/reports/{reportId}"; + let mut url = "https://youtubereporting.googleapis.com/v1/jobs/{jobId}/reports/{reportId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -1842,7 +1859,8 @@ impl<'a, C, A> JobReportGetCall<'a, C, A> where C: BorrowMut, A: self._report_id = new_value.to_string(); self } - /// The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + /// The content owner's external ID on which behalf the user is acting on. If + /// not set, the user is acting for himself (his own channel). /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> JobReportGetCall<'a, C, A> { @@ -1874,12 +1892,12 @@ impl<'a, C, A> JobReportGetCall<'a, C, A> where C: BorrowMut, A: /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (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> @@ -1982,7 +2000,7 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/jobs/{jobId}"; + let mut url = "https://youtubereporting.googleapis.com/v1/jobs/{jobId}".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -2095,7 +2113,8 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 self._job_id = new_value.to_string(); self } - /// The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + /// The content owner's external ID on which behalf the user is acting on. If + /// not set, the user is acting for himself (his own channel). /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> JobGetCall<'a, C, A> { @@ -2127,12 +2146,12 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (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> @@ -2160,7 +2179,8 @@ impl<'a, C, A> JobGetCall<'a, C, A> where C: BorrowMut, A: oauth2 } -/// Lists reports created by a specific job. Returns NOT_FOUND if the job does not exist. +/// Lists reports created by a specific job. +/// Returns NOT_FOUND if the job does not exist. /// /// A builder for the *reports.list* method supported by a *job* resource. /// It is not used directly, but through a `JobMethods` instance. @@ -2260,7 +2280,7 @@ impl<'a, C, A> JobReportListCall<'a, C, A> where C: BorrowMut, A: params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/jobs/{jobId}/reports"; + let mut url = "https://youtubereporting.googleapis.com/v1/jobs/{jobId}/reports".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -2373,35 +2393,42 @@ impl<'a, C, A> JobReportListCall<'a, C, A> where C: BorrowMut, A: self._job_id = new_value.to_string(); self } - /// If set, only reports whose start time is smaller than the specified date/time are returned. + /// If set, only reports whose start time is smaller than the specified + /// date/time are returned. /// /// Sets the *start time before* query property to the given value. pub fn start_time_before(mut self, new_value: &str) -> JobReportListCall<'a, C, A> { self._start_time_before = Some(new_value.to_string()); self } - /// If set, only reports whose start time is greater than or equal the specified date/time are returned. + /// If set, only reports whose start time is greater than or equal the + /// specified date/time are returned. /// /// Sets the *start time at or after* query property to the given value. pub fn start_time_at_or_after(mut self, new_value: &str) -> JobReportListCall<'a, C, A> { self._start_time_at_or_after = Some(new_value.to_string()); self } - /// A token identifying a page of results the server should return. Typically, this is the value of ListReportsResponse.next_page_token returned in response to the previous call to the `ListReports` method. + /// A token identifying a page of results the server should return. Typically, + /// this is the value of + /// ListReportsResponse.next_page_token + /// returned in response to the previous call to the `ListReports` method. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> JobReportListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Requested page size. Server may return fewer report types than requested. If unspecified, server will pick an appropriate default. + /// Requested page size. Server may return fewer report types than requested. + /// If unspecified, server will pick an appropriate default. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> JobReportListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + /// The content owner's external ID on which behalf the user is acting on. If + /// not set, the user is acting for himself (his own channel). /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> JobReportListCall<'a, C, A> { @@ -2440,12 +2467,12 @@ impl<'a, C, A> JobReportListCall<'a, C, A> where C: BorrowMut, A: /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (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> @@ -2561,7 +2588,7 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/jobs"; + let mut url = "https://youtubereporting.googleapis.com/v1/jobs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -2643,28 +2670,35 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth } - /// A token identifying a page of results the server should return. Typically, this is the value of ListReportTypesResponse.next_page_token returned in response to the previous call to the `ListJobs` method. + /// A token identifying a page of results the server should return. Typically, + /// this is the value of + /// ListReportTypesResponse.next_page_token + /// returned in response to the previous call to the `ListJobs` method. /// /// Sets the *page token* query property to the given value. pub fn page_token(mut self, new_value: &str) -> JobListCall<'a, C, A> { self._page_token = Some(new_value.to_string()); self } - /// Requested page size. Server may return fewer jobs than requested. If unspecified, server will pick an appropriate default. + /// Requested page size. Server may return fewer jobs than requested. + /// If unspecified, server will pick an appropriate default. /// /// Sets the *page size* query property to the given value. pub fn page_size(mut self, new_value: i32) -> JobListCall<'a, C, A> { self._page_size = Some(new_value); self } - /// The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + /// The content owner's external ID on which behalf the user is acting on. If + /// not set, the user is acting for himself (his own channel). /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> JobListCall<'a, C, A> { self._on_behalf_of_content_owner = Some(new_value.to_string()); self } - /// If set to true, also system-managed jobs will be returned; otherwise only user-created jobs will be returned. System-managed jobs can neither be modified nor deleted. + /// If set to true, also system-managed jobs will be returned; otherwise only + /// user-created jobs will be returned. System-managed jobs can neither be + /// modified nor deleted. /// /// Sets the *include system managed* query property to the given value. pub fn include_system_managed(mut self, new_value: bool) -> JobListCall<'a, C, A> { @@ -2696,12 +2730,12 @@ impl<'a, C, A> JobListCall<'a, C, A> where C: BorrowMut, A: oauth /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (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> @@ -2809,7 +2843,7 @@ impl<'a, C, A> JobCreateCall<'a, C, A> where C: BorrowMut, A: oau params.push(("alt", "json".to_string())); - let mut url = self.hub._base_url.clone() + "v1/jobs"; + let mut url = "https://youtubereporting.googleapis.com/v1/jobs".to_string(); if self._scopes.len() == 0 { self._scopes.insert(Scope::YtAnalyticMonetaryReadonly.as_ref().to_string(), ()); } @@ -2915,7 +2949,8 @@ impl<'a, C, A> JobCreateCall<'a, C, A> where C: BorrowMut, A: oau self._request = new_value; self } - /// The content owner's external ID on which behalf the user is acting on. If not set, the user is acting for himself (his own channel). + /// The content owner's external ID on which behalf the user is acting on. If + /// not set, the user is acting for himself (his own channel). /// /// Sets the *on behalf of content owner* query property to the given value. pub fn on_behalf_of_content_owner(mut self, new_value: &str) -> JobCreateCall<'a, C, A> { @@ -2947,12 +2982,12 @@ impl<'a, C, A> JobCreateCall<'a, C, A> where C: BorrowMut, A: oau /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart"). /// * *access_token* (query-string) - OAuth access token. - /// * *fields* (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> @@ -2980,3 +3015,4 @@ impl<'a, C, A> JobCreateCall<'a, C, A> where C: BorrowMut, A: oau } +